L4Re Operating System Framework
Interface and Usage Documentation
Loading...
Searching...
No Matches
Tutorial

This tutorial assumes that the reader is familiar with the basic L4 concepts that were discussed in the Introduction section.

Here you can find the first steps to boot a very simple setup. The setup consists of the following components:

  • L4Re Microkernel
  • Sigma0 — Root Pager
  • Moe — Root Task
  • Ned — Init Process
  • hello — The classical 'Hello World' Application

The guide assumes that you already compiled the base components and describes how to generate an ISO image, with GRUB as a boot loader, that can for example be booted within QEMU.

First you need a modules.list file that contains an entry for the scenario.

modaddr 0x002000000
entry hello
kernel fiasco -serial_esc
roottask moe rom/hello.cfg
module l4re
module ned
module hello.cfg
module hello

This file describes all the binaries and scripts to put into the ISO image, and also describes the GRUB menu.lst contents. What you need to do is to set the make variable MODULE_SEARCH_PATH to contain the path to your L4Re Microkernel's build directory and the directory containing your hello.cfg script.

The hello.cfg script should look like the following. A ready to use version can be found in l4/conf/examples.

local L4 = require("L4");
L4.default_loader:start({}, "rom/hello");
L4 low-level kernel interface.
Definition io_regblock.h:19

The first line of this script ensures that the L4 package is available for the script. The second line uses the default loader object defined in that package and starts the binary rom/hello.

Note
All modules defined in modules.list are available as data spaces (L4Re::Dataspace) and registered in a name space (L4Re::Namespace). This name space is in turn available as 'rom' to the init process (Ned).

Now you can go to your L4Re build directory and run the following command.

Note
The example assumes that you have created the modules.list and hello.cfg files in the /tmp directory. Adapt if you created them somewhere else.
make grub2iso E=hello MODULES_LIST=/tmp/modules.list MODULE_SEARCH_PATH=/tmp:<path_to_fiasco_builddir>

Now you should be able to boot the image in QEMU by running:

qemu-system-x86_64 -m 1024 -cdrom images/hello.iso -serial stdio

If you press <ESC> in the terminal that shows you the serial output you enter the microkernel's debugger... Have fun.

Customizations

A basic set of bootable entries can be found in l4/conf/modules.list. This file is the default for any image creation as shown above. It is recommended that local modification regarding image creation are done in conf/Makeconf.boot. Initially you may copy Makeconf.boot.example to Makeconf.boot. You can overwrite MODULES_LIST to set your own modules-list file. Set MODULE_SEARCH_PATH to your setup according to the examples given in the file. When configured a make call is reduced to:

make grub2iso E=hello

All other local configuration can be done in a Makeconf.local file located in the l4 directory.