Home Teaching Research Publications

Advanced Operating Systems (LV 7680)

Developing on Linux

This page provides instructions for setting up your Linux machine for working on the AOS project. These instructions will be distribution specific (for Ubuntu) but they should at least give you an idea of how to set up other distributions.

The components you will need to install are:

  • Build dependencies
  • A serial terminal program (we recommend picocom)
  • TFTP server
  • An NFS server/share
  • netcat

Once installed, the installation can be tested by following the milestone 0 instructions.

Build Dependencies

Follow the seL4 build dependencies instructions. Note: that you only require the aarch64 cross-compilers.

Once this stage is completed successfully, you should be able to compile the AOS project.

Other dependencies

Install the following packages in order to run the project and communicate with the hardware:

    sudo apt-get install git
    sudo apt-get install netcat.traditional
    sudo update-alternatives --set nc /bin/nc.traditional
    sudo apt-get install picocom
    sudo apt-get install tftpd-hpa tftp-hpa
    sudo apt-get install nfs-kernel-server

Setting up the network

Use a spare ethernet port

If your development machine has a spare ethernet port, you can configure it statically with IP address 192.168.168.1 to use it for connecting to the ODROID. In this case, if you are using a network manager of some kind, make sure it does not grab the ethernet port.

Use USB Ethernet NIC

If you do not have a spare ethernet port, insert the provided USB Ethernet NIC into a spare USB port on your Linux host machine and run the following:

    $ sudo dmesg

The name that your system assigned to the Ethernet port should appear near the bottom of the output. For example:

    asix 7-4:1.0 eth1: register 'asix' at usb-0000:00:1a.7-4, ASIX AX88772B USB 2.0 Ethernet, XX:XX:XX:XX:XX:XX

You may find that the port was immediately renamed:

    asix 7-4:1.0 enxXXXXXXXXXXXX: renamed from eth1

Static configuration

The following instructions assume that the Ethernet port was named eth1 and that no renaming occurred. If this is not the case, replace eth1 appropriately (enxXXXXXXXXXXXX in the above example).

Add the following lines to /etc/network/interfaces:

    iface eth1 inet static
        address 192.168.168.1
        netmask 255.255.255.0

Bring up the interface:

    sudo ifup eth1

Setting up the TFTP server

After installing the tftpd-hpa package, the default Ubuntu tftp directory will be /srv/tftp. You will either need to modify our helper scripts to match the new default, or modify /etc/default/tftpd-hpa, i.e. change TFTP_DIRECTORY to match our source.

You may need to adjust ownership and/or permissions to allow you access to the directory (e.g. chmod a+rwx /var/lib/tftpboot) if you are in a benign environment.

Our source expects the tftp directory to be /var/tftpboot/$USER.

Make sure to enable and start the tftp server with:

    $ sudo systemctl enable tftpd-hpa && sudo systemctl start tftpd-hpa

Set up an NFS share

Make sure NFS server is installed:

    $ sudo apt-get install nfs-kernel-server nfs-common

Then set up the exports by editing /etc/exports and adding the following lines (adjusted for the location of your tftp root directory and your username):

    /var/tftpboot/USERNAME 192.168.168.2(rw,sync,all_squash,subtree_check,anonuid=UID,anongid=GID,insecure)

Substitute /var/tftpboot/USERNAME to whatever is set TFTP_DIRECTORY to in your tftpd configuration.

Substitute UID with your Unix user ID (usually 1000 -- find out using id).

Substitute GID with your Unix group ID (usually 1000 -- find out using id).

To restart the nfs server with the updated exports, run:

    $ sudo service nfs-kernel-server restart

Serial Line Access

Add your account to group dialout to give access to /dev/ttyUSB0. You'll need to logout and back in to update your groups. If you skip this, picocom may need root permissions to run.

You may be required to change the settings for picocom. Use dmesg to work out which port the USB to serial converter has been attached to (its usually /dev/ttyUSB0). Then set picocom to use that serial port, 115200 baud rate, 8N1, and no hardware flow control, using sudo picocom -b 115200 /dev/ttyUSB0.