User`s manual

UC-8410/8416/8418-LX User’s Manual Getting Started
2-9
Checking the Flash Memory Space
The UC-8410/8416/8418 uses a specially designed root file system. Only /tmp, /etc, /home,
/usr/local/bin, /usr/local/sbin, /usr/local/libexec, and /usr/local/lib directories are writable. Others
are read-only. The writable directories are mounted on /dev/mtdblock4. If the /dev/mtdblock4 is
full, you will not be able to save data to the Flash ROM. Use the following command to calculate
the amount of “Available” flash memory:
/>df –h
root@Moxa:/# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 13.4M 9.8M 3.5M 74% /
/dev/root 13.4M 9.8M 3.5M 74% /
/dev/ram15 1.7M 19.0k 1.6M 1% /dev
/dev/ram0 499.0k 18.0k 456.0k 4% /var
/dev/mtdblock4 32.0M 1.9M 30.1M 6% /tmp
/dev/mtdblock4 32.0M 1.9M 30.1M 6% /home
/dev/mtdblock4 32.0M 1.9M 30.1M 6% /etc
tmpfs 252.5M 0 252.5M 0% /dev/shm
/dev/sdb1 483.4M 57.9M 425.5M 12% /var/sdb
root@Moxa:/#
If there isn’t enough “Available” space for your application, you will need to delete some existing
files. To do this, connect your PC to the UC-8410/8416/8418 with the console cable, and then use
the console utility to delete the files from the UC-8410/8416/8418’s flash memory.
Compiling Hello.c
The CD contains several sample programs. Here we use Hello.c to show you how to compile and
run your applications. Type the following commands from your PC to copy the files used for this
example from the CD to your computer’s hard drive:
# cd /tmp/
# mkdir example
# cp –r /mnt/cdrom/example/* /tmp/example
To compile the program, go to the hello subdirectory and issue the following commands:
#cd example/hello
#make
You should receive the following response:
[root@localhost hello]# make
xscale-linux-gcc –o hello-release hello.c
xscale-linux-strip –s hello-release
xscale-linux-gcc –ggdb -o hello-debug hello.c
[root@localhost hello]# _
Next, execute hello.exe to generate hello-release and hello-debug, which are described below:
hello-release—an IXP platform execution file (created specifically to run on the
UC-8410/8416/8418)
hello-debug—an IXP platform GDB debug server execution file (see Chapter 5 for details about
the GDB debug tool).