Building and Simulating OKL4
Before you begin, ensure you have installed all of the Prerequisites.
Building: the build.py script
All build processes are controlled through a single script, tools/build.py, invoked with appropriate BuildOptions. There are two required arguments, machine and project, and several possible optional arguments (such as example, example_env, and wombat).
machine
The machine argument is required and is used to specify the target platform. Possible machine arguments are:
gumstix
gta01
kzm_arm11
ia32_pc99
project
The project argument is required and is used to specify the base application, or Rootserver, that will be built. There are two projects shipped with the latest distribution: L4 Test (argument l4test) and OKL4 (argument iguana).
Kernel Test Suite
L4Test, invoked with argument project=l4test, performs a number of unit tests for kernel functionality.
OKL4
The full OKL4 operating system stack is built with argument project=iguana. This option builds Iguana as the OKL4 rootserver, on top of which various example applications, VMs, and OK Linux can be built.
example & example_env
These arguments are used to build an OKL4 example application on top of the Iguana project (project=iguana must be specified). Example applications live in the iguana/example directory (see GettingAroundTheSource), and the example argument simply corresponds to the folder name of the example.
Additionally, a different BuildEnvironment in which the example application is to be built can be specified via argument example_env. The default build environment is iguana, which builds the example with the standard OKL4 libc. To enable POSIX functionality (presently, a subset of PSE51), specify example_env=posix.
OKL4 Test Suite
The OKL4 TestSuite performs a number of unit tests on OKL4 functionality. To build, simply append test_libs=all to the build line (project=iguana must also be specified).
wombat (OK Linux)
To build OKLinux, simply specify argument wombat=True. OKLinux should be unpacked or symlinked into a subdirectory named linux under the main OKL4 directory.
Building in a different directory
By default, all building occurs in a sub-directory named build. To force the build system to use a different directory, simply append argument build_dir=my_build_dir
Simulating: just add simulate
To simulate OKL4 following a successful build, simply append simulate to the build line. This will start the default simulator for the specified machine.
Making Clean
To perform the equivalent of a make clean, simply:
$ rm -rf build
where build is the name of your build directory (which, by default, is "build")
Example Builds
- L4 Kernel Test Suite on IA32/PC99:
$ ./tools/build.py machine=ia32_pc99 project=l4test
DiningPhilosophers example app (with Iguana) on Gumstix:
$ ./tools/build.py machine=gumstix project=iguana example=dining_philosophers
- POSIX example application (just a "hello world") in the POSIX environment on KZM:
$ ./tools/build.py machine=kzm_arm11 project=iguana example=posix example_env=posix
- OKL4 test suite on IA32/PC99, with simulate:
$ ./tools/build.py machine=ia32_pc99 project=iguana test_libs=all simulate