ODDAS-LINUX
(a Linux distribution for control and data acquisition)
This mini-distribution is being developed for the ODDAS
project.
1. INTRODUCTION
GNU/Linux for the desktop has been rapidly expanding in size as the impact
of incredibly cheap disk space and RAM take hold. However, this is mostly
due to the addition of large GUI packages. The kernel itself and the basic
utilities are still fairly small. Thus they can be used on embedded systems
with, say, 8M of RAM and 16M of flash memory serving as mass storage. That
was an awful lot of memory a few years ago, but now it is getting tough
to find that little memory. When I ordered the PCM-4335 from Aaeon
which I used for a test platform for this system, I found it was hard to
find an 8M SODIMM, so I went with 16M of memory. I boot with the mem=8M
flag so that I can reassure myself that the thing runs with 8M. I also
purchased a 16M Disk on Chip to plug into the board, which will eventually
serve as the mass storage device, but is currently unused (I'm am now cheating,
using an IDE hard drive with a 16M partition).
2. CHOOSING THE FUNCTIONALITY
The system has some basic utilities and networking capability. I tested
the networking using PPP over the serial link, but it ought to work with
Ethernet as well if you were to get a board with Ethernet on it. The Linux
system is a full multi-tasking, multi-user system. With the kernel, utilities
and all of the libraries loaded a tad more than 3M of disk space is used.
This is made possible by two excellent utilities, busybox
and tinylogin.
I chose things assuming that one would rarely be logged on to the console
attached to the PC-104 card. But you might need telnet to check up on things,
ftp to download new versions of your software, and an http server to update
you on system status. Hence, it has telnet, ftp and http servers, but no
clients. Also, it has ssmtp, so that mail sent to a user on the embedded
system can be rerouted to their home workstation. Cron is available for
regular mailing of statistics or running of diagnostics or whatever. Finally,
the syslogd is set up so that it can log events on a remote log server.
Here is a brief list of what is included:
GNU C library - all the functions you could ever want. Well, almost. At
least I did not remove the ones that were not in use, as I figured they
might be used by a user program.
termcap - for attaching with alternate terminals
shell - ash, a small shell that acts like an sh should, but without command
line editing and completion.
cron - for scheduling regularly scheduled events
editors - ce, a very small emacs clone. I should offer tiny elvis as an
option, I suppose. Generally I would expect that you would edit on your
desktop machine and transfer the files with FTP.
busybox - see the link above. Lots of useful command line utilities.
tinylogin - see the link above. Very small login utilities.
ftp server - for transferring files to and fro.
telnet - for remote logins over a network.
httpd - micro_httpd used to serve up web pages over the network link.
mail - mailx and ssmtp allow programs to e-mail notifications to you on
your host system.
syslog - so you can keep track of what is happening.
3. DOWNLOAD AND BUILD THE ODDAS-LINUX SYSTEM
The system with all of the source code is on our CVS
tree, or if you prefer not to chase a moving target you can download
an alpha release here.
To build it, all I need to do on my machine is to run the script "build_oddas_linux".
If you have installed the same development
tools for x86 to x86 as I used, then hopefully that is all that you
will need to do as well. Otherwise, you will need to edit the script a
bit, to point it at your compilers. If you are running on an x86, you can
probably get away with compiling with your native tools.
Build the kernel which was installed as part of the cross-development
tools. It is version 2.2.16, which is the latest stable version at this
time. A couple of sample config files are located in the ODDAS-Linux root
directory.
For more information, read the INSTALL
directions.
4. INSTALL THE ODDAS-LINUX SYSTEM
There are many ways to get software down to an embedded board. The easiest
is NFS, but unfortunately my board does not have Ethernet built in (from
now on, I'll always make sure my boards have it). Any how, I boot a small
rescue system from a floppy, partition and format the disk, then download
the real system using floppies.
Another possibility would be to plug the target's IDE hard drive into
your desktop system. Partition it, create the file system, and mount it
under /mnt/. Then you can copy the rootfs files over to /mnt. Make sure
that you use "cp -a" or you'll mess up all my links and permissions (same
goes if you use tar, make sure that you use the "p" option!). If you have
the hard drive on /mnt then you can even run lilo, with the "lilo -r /mnt"
command, so that the system will boot off the hard drive after installing
it on the target.
Note that the file /etc/ftpusers exists on the system and prevents FTP
by root. Perhaps this is a mistake for a system that one never logs onto
directly, if you feel that it is then remove root from the list of users
in /etc/ftpusers. Or, create a new account using the adduser.
WARNING: I did not take the time to sort through the device files, so
I just dumped all of the ones from my desktop onto this system. As a result,
you will use up a lot of i-nodes. Since you cannot add them once the file
system has been created, you might want to toss a thousand or so extra
-nodes on when you make the file system. See the mke2fs man page for help.
For more information, read the INSTALL
directions.
5. HAVE A LOT OF FUN!
I don't know what you plan to do with this system. I plan the following:
set it up so it is easy to compile with native tools
Make the option to replace FTP and TELNET with OpenSSH
boot from DiskOnChip
get it to run RT-Linux or RTAI
obtain or write a driver for a PC-104 CAN controller, under RT-Linux.
work on the smart sensors for some example project,
have the system collect data on its control performance and show it on
a web page.
Author: Pete Buechler <peter.buechler@home.com>
Last updated: 22 February 2001.