User`s manual

UC-8410/8416/8418/8430 Getting Started
2-7
ATTENTION
If you have an older version of Linux Tool Chain on your Moxa embedded computer (such as the W300 Series,
IA240/241, and UC-7112-LX Plus) and would like to install the new Linux Tool Chain for the
UC-8410/8416/8418/8430
, the old Linux Tool Chain files will be immediately overwritten, and the programs
compiled by this new Tool Chain may not work on your old models. We strongly suggest you rename the
directory of the old Linux Tool Chain before installing the new one if you would like to use the old Linux Tool
Chain for other embedded computers.
Checking the Flash Memory Space
The UC-8410/8416/8418/8430/8430 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 Availableflash
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 isnt enough Availablespace for your application, you will need to delete some existing files. To do
this, connect your PC to the UC-8410/8416/8418/8430/8430 with the console cable, and then use the console
utility to delete the files from the UC-8410/8416/8418/8430’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 computers 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: