Developing your AOS project on Linux
Many students have Linux machines which they would like to be able to use to work away from the labs. The following is a guide as to how to set up the necessary drivers/software. These instructions will be debian specific in some spots (e.g. setting up the tftp server) but they should at least give you an idea of how to set up other distributions.
This page might be of use, however out of date.The components you will need to install are:
- Cross compilers
- Driver for the NSLU2's USB->serial converter
- A serial terminal program (we use
minicom,conserverorseyon) - TFTP server
- time server
- An NFS server/share
- netcat
- nslu2-util
Once installed, the installation can be tested by following the milestone 0 instructions. Some parts of this procedure are un-tested.
Cross compilers
Crosstool is a system which will automagically build cross-compilers. Prior to crosstool, building cross-compilers was a fairly horrible process.
You can either try using this pre-compiled cross-compiler tarball (built on a i386 Debian testing host, unpack into /opt/crosstool), or otherwise follow these steps:
- Obtain the version 0.42 of crosstool (there are reports that the latest version doesn't work with these instructions): http://kegel.com/crosstool
- gunzip and tar xvf: tar xvfz crossstool-0.42.tar.gz
- Edit the build script: emacs demo-armv5b-softfloat.sh. Comment out the 'eval' lines and add: eval `cat armv5b-softfloat.dat gcc-3.4.5-glibc-2.3.5.dat` sh all.sh --notest
- sudo mkdir crosstool; sudo chown $USER:$USER /opt/crosstool
- Run the build script. ./demo-armv5b-softfloat.sh Go to bed.
- When you get up, you should have a toolchain in
/opt/crosstool/gcc-3.4.5-glibc-2.3.5/armv5b-softfloat-linux/bin/.
Add this directory to your
PATH.
Installing drivers
You need device drivers for the USB to Ethernet dongle, and the
FT232RL USB-Serial converter. Fortunately, these drivers are in the
linux kernel and are compiled by most modern distributions, so you
should be able to plug them in and see messages from the drivers via
dmesg.
The modules required are:
- asix : USB-to-Ethernet
- ftdi_sio : USB-to-Serial
If you don't have hotplug set up correctly, you may need to use use
modprobe to load the modules. e.g. modprobe asix. You
probably want to get this all working automatically, as it is in the
labs.
At this stage, we assume a working serial converter and ethernet
port. The serial converter is assumed to use device
/dev/ttyUSB0 and the ethernet port is assumed to use
eth1. Substitute below if your setup varies (e.g. if you
are using a real Ethernet port or network).
Setting up the network
The AOS board expects to find a host at 192.168.0.1.
You can change this temporarily in the bootloader, but its easiest to
set up your host to be at this address. This is not a problem if you
are using an independent network provided by the USB to Ethernet
dongle.
If your USB to Ethernet dongle is using eth1 (note that
it will simply get the next unused ethX interface - i.e. if your wired
Ethernet is eth0, wireless is eth1, then the USB-Ethernet converter
will be eth2. This should show up in the output of
dmesg).
ifconfig eth1 192.168.0.1 up
Setting up the TFTP server
The bootloader will download your software image from a tftp server running on your host. So you need to set one up:
apt-get install tftpd
Edit your /etc/inetd.conf. Change the following line to reflect the location of the directory which you want to use as your tftp root. (In this case it is /tftpboot).
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot
You may need to restart inetd at this point using
/etc/init.d/inetd restart
You will also need to adjust your handy Makefile if you want it to
automatically copy the bootimg.bin file to the tftpboot directory. The
variable to look for is: TFTPROOT
Setting up the time server
Uncomment the following line in /etc/inetd.conf :
#time dgram udp wait root internal
Set up an NFS share
Install the NFS server:
daves@gedanken:~$ apt-get install nfs-kernel-server nfs-common portmapThen set up the exports by editing
/etc/exports and adding
the following lines (adjusted for the location of your tftp root
directory):
/tftpboot 192.168.0.2(rw,no_root_squash,insecure)
Install the NSLU2 utility program
It is necessary to be able to control the NSLU2 using a utility program. It controls the reset line, allowing the NSLU2 to boot once a serial console has been opened.
Download the source code.
Uncompress it, make, and copy the resulting executable to
a directory in your $PATH (or add the nslu2-util directory to your
$PATH).
Install other required software
Install the following packages:
apt-get install minicom netcat wireshark scons=0.96.93 make mercurial
Note on SCons versions
Note that you will need an old version of SCons, 0.96.93 (or probably something similar) to successfully build the project. If you can't find an appropriate package for your distribution, we suggest downloading this source and building it yourself.
Patches to fix the build with new versions of SCons will be happily accepted!



