Printer-Friendly
Version
|
Milestone 0: Familiarisation
This is a simple exercise designed to get you started on seL4. It contains
very detailed instructions, together with the existing source code and the
seL4 manual you should have no problem doing it.
Your Environment
If you haven't already you may want to take a look at Sabre Lite Lab to
set up your development environment and your Sabre Lite.
Most of the 9242 binaries (eg. cross compilers) are in
~cs9242/crossdev/arm-2013.05. You can add this to your path with:
export PATH=$PATH:/home/cs9242/crossdev/arm-2013.05/bin
export PYTHONPATH=$PYTHONPATH:/home/cs9242/bin/py
If you are lazy you can just use the 9242 command for the cs9242
shell:
~ % 9242
newclass starting new subshell for class COMP9242...
~ % arm-none-linux-gnueabi-ld
arm-none-linux-gnueabi-ld: no input files
Note: Your minicom should default to 115200, 8N1, no hardware flow control. If
it doesn't then you will have problems talking to your Sabre.
Building SOS
-
Get yourself a copy of the skeleton SOS. We use
git for revision control for this project, and
it will be simplest if you do also. You will be submitting
patches/diffs for each milestone in the project. We support
and expect only git generated patches/diffs. You will need
to support yourself if you use any other tools.
You can find some pointers on using git on
our git page
git clone /home/cs9242/public_html/current/project/files/aos-2014
cd aos-2014
make aos_defconfig
make
Getting SOS on non-lab machines
- If you are not using a lab machine, you will need to ensure that
git is in your $PATH at CSE (as well as installed on your local machine!) before performing a check-out. Put this line in your .bashrc (or equivalent):
PATH=/home/cs9242/bin:$PATH
- Now check out the code:
git clone ssh://YOURLOGIN@login.cse.unsw.edu.au//home/cs9242/public_html/current/project/files/aos-2014
Getting it Going
Booting your Sabre Lite for the first time is easy:
- Plug in the Sabre Lite (USB and Ethernet) and reset it.
- In a terminal, launch minicom, % minicom.
- Build, copy the sos image and reset your Sabre by just typing
% make.
- You should see a successful boot of the sos skeleton. Now it is up
to you to bring an entirely new operating system up, good luck.
Development cycle
We have developed a few tools to speed the development cycle
along. The makefile can copy the sos operating system, known as a
bootimage to your tftp directory and reset the Sabre. Below is a
typical development cycle, assuming the path changes to your login
script:
- Plug in the Sabre Lite, don't forget the ethernet.
- In a terminal, launch minicom, % minicom.
- In another terminal, launch netcat, % nc -lup 26706.
- Make your changes, (hint: learn cscope).
- Build, copy the bootimg and reset your Sabre with % make.
- Test your changes.
- Repeat from step 4 above until satisfied, or you fall over for lack
of sleep.
- Ending the minicom session, ^A q, and ^C will
end the netcat session.
The Milestone
The example skeleton operating system includes an application
tty_test which starts up, prints out its name, and then
blocks itself forever.
The example includes a printf implementation that outputs
data to seL4's debug console. In fact it uses the seL4 debug API
seL4_DebugPutChar . This function should only be used for internal
SOS debugging, not as a console for applications, so, your
task is to modify the sos_write function to send data through the
operating system and across the network to your netcat(nc ) console.
The second part of milestone zero is to find a partner for the rest of
the project. The project is to be completed, in pairs, unless prior
permission has been obtained from the LiC.
Recommended procedure
- Read (and understand) the code in
apps/sos/src/main.c
and the code in the apps/tty_test application directory.
- Read the documentation on libserial.
- Design a simple IPC protocol to transfer data from the user
program to your operating system (Recommended reading: seL4 Reference
Manual, Chapter 4 (all), Chapter 9 (Section 9.1, 9.2, 9.3.9, 9.3.10, 9.3.11). Note that an endpoint has already been set
up between the tty_test application and sos.)
- Write the client side implementation in
sos_write .
- Change the
syscall_loop in main.c
to recognise your new protocol, and print out a debug message when you
receive one of these messages.
- Edit
tty_test.c so that it tests your
sos_write function.
- Change the server side so that it now prints the data to libserial,
which will send it onto the network.
- Test that all of
tty_test 's output now goes to
the netcat console, not the console debugger.
Assessment
Milestone submission
See the milestone submission
guidelines for instructions on submitting your milestone
solution.
Milestone Demonstration
You will need to demonstrate user applications printing to the 2nd
console via libserial, running on the Sabre Lite hardware to the tutor during the
demonstration period. You should be prepared to show your tutor which files
you modified in your solution, and explain any design decisions you made.
Note that since you do not have any form of memory management yet, your protocol
will be fairly simple for now, but should be upgraded as more parts of the system
are completed. Your tutor will be particularly interested in the details of your IPC
interface with different sized blocks of data etc, and how you plan to improve it in future.
You will let the tutor know who your partner is so that group accounts
can be created for you.
Last modified:
01 Aug 2014.
|