[okl4-developer] Platform recommendations

Josh Matthews jmatthews at ok-labs.com
Thu Sep 18 13:00:54 EST 2008


Hi David,

> Okay, I'm afraid I'm totally failing to get to grips with the build
> system. I can't even figure out how to create a project --- there appear
> to be bits all over the place.
>
> What I'd really like is a simple set of C files and headers that I can
> pull out and drop into the build system for the rest of my project; I've
> actually tried, and got a lot of it building, but link stage beat me.
>
> Are there any blow-by-blow instructions on how to set up a new project
> that does as little as possible ('Hello world', or even less)?

Ok, so there's two ways to create projects:

a) As an Iguana application, in which Iguana runs as the L4 root server
and handles resource allocation etc. There's a great user manual for
Iguana up at http://wiki.ok-labs.com/GetEducated that will introduce you
to it.

If you're writing an Iguana project, configuring the build system is a
little easier, and there is a step-by-step example for a HelloWorld up at
http://wiki.ok-labs.com/DevelopAServer.

It's definitely worthwhile for you to run through that. From your previous
email, though, it sounds like what you want to do is:

b) As a direct L4 application, using none of the services provided by
Iguana; in this case YOUR application runs as the root server, and there's
a fair bit that you need to handle yourself. First and foremost, you'll
need to create a thread that acts as the "pager" for your applications,
fulfilling mapping requests (the L4 manual at the same link as above
provides a good introduction to the concept). As mentioned, the l4test
project is an example of an OKL4 app that runs without Iguana. Have a look
at l4test/src/l4test.c, main(), to see the initial setup that it does; in
particular, each test case calls initThreads() in l4test/src/utility.c,
which on its first invocation sets up the pager thread.

In terms of the build system itself, there are three files of interest
(you'll see references to "Kenge", which is a codename for the build
system):

1) projects/{project-name}/SConstruct: the SCons file that constructs the
entire build (the kernel, your rootserver, the image, etc.) In it you
specify your build environments for each part of your build (eg:
rootserver_env = build.KengeEnvironment("l4_rootserver"), and package up
your libraries and your application into those environments (eg:
rootserver_env.Package("libs/c")).

2) {project-name}/SConscript: the SCons script for your particular app
(each project, library, the kernel itself has one of these). This is
parsed when the library, project etc is packaged into a build environment,
and returns an object (a KengeLibrary or KengeProgram) that specifies the
name, libraries, link flags, location of the source files etc. for the
program/library to be built.

3) tools/build.py: a wrapper script which parses and executes a command
line invocation of the build system. There's a good introduction to using
that at http://wiki.ok-labs.com/BuildingAndSimulating.

Additionally, a good way to get introduced to the concept of root servers
and the associated things you need to handle is the teaching slides
published by Dr Gernot Heiser for his Advanced OS Course at UNSW (it uses
OKL4). You can find those at http://www.cse.unsw.edu.au/~cs9242. The
project that students develop in that course (also on the site) may also
be of interest to you - they build a simple operating system (SOS) that
runs as the root server on top of the OKL4 microkernel - at the very
least, the skeleton code provided will show you the initial setup that
needs to be done to get up and running.

I hope that has given you enough to get started with; I'm sure you'll have
more questions as you progress, as always, feel free to post here.

Cheers,

Josh





More information about the Developer mailing list