This documentation describes the process of building and booting the Fiasco version of Genode. It assumes that you are familiar with basic concepts described in the introductory documentation of Genode, namely the "How to start exploring Genode" document.
Preconditions
The Fiasco version of Genode relies on the following components from the source tree of the Fiasco microkernel and the L4 environment (which also need additional tools).
Tools
- Gawk
- Bison
- Python
The Fiasco microkernel
Information about Fiasco are provided at its official website:
http://os.inf.tu-dresden.de/fiasco/
The L4 environment
The L4 environment is a compilation of user-level components and libraries to build software on top of Fiasco. It is organized as a number of packages. These packages provide two types of components. There are low-level components for booting up and interfacing to Fiasco and there are higher-level components that compose a basic OS infrastructure. For Genode, we only rely on the low-level packages.
The Genode release includes all necessary sources from the L4 environment in the 3rd/fiasco/snapshot subdirectory:
| tool: | contains the tools that are used by the build processes of the L4 environment and Fiasco. For example, the build process of Fiasco relies on the preprocess tool. |
|---|---|
| kernel: | contains the Fiasco microkernel. |
| l4: | contains the L4-environment source tree. The single packages are located at l4/pkg. |
From all the packages of the L4 environment, the following three are of interest for using Genode:
| pkg/l4sys: | contains the Fiasco system-call bindings. The system-call bindings are a set of C-header files that define the application-programming interface for invoking the system calls of Fiasco. |
|---|---|
| pkg/sigma0: | Sigma0 is the initial memory manager required to use Fiasco. |
| pkg/bootstrap: | Bootstrap is the program that is started by the boot loader. After being started, Bootstrap prepares the bare machine to accommodate Fiasco. On many embedded architectures, bootstrap is used to create a single binary image containing all boot-time OS components. |
To build all components under 3rd/fiasco, issue the following commands in the top-level directory of the Genode release:
mkdir <compound-builddir> make -C 3rd BUILD_DIR=<compound-builddir> build
The specified <compound-builddir> is directory, which will contain the build directories for the third party software and the genode build directory. After the build, your compound build directory contains the following subdirectories:
| 3rd/fiasco_x86: | All generated files and the final binary of Fiasco reside here. |
|---|---|
| 3rd/l4env: | L4 environment binaries and header files. |
Building the Fiasco version of Genode
To build the Fiasco version of Genode, we need to tell the Genode build system the location of the Fiasco system-call bindings and the location of Genode's Fiasco-specific source-code repository.
For your convenience, the tool directory contains an appropriate Makefile. You just need to issue the following command in the top-level directory of the Genode release:
make GENODE_DIR=`pwd` BUILD_DIR=<compound-builddir> -f tool/genode.mk fiasco
The build process should create all targets that are compatible with Fiasco. You can find them in the genode_fiasco subdirectory of your compound build directory, which corresponds to the genode build directory as described in http://genode.org/documentation/developer-resources/getting_started.
During the typical development-compile-test cycle, you may prefer building the Genode binaries directly from the genode build directory to leverage the convenience of Genode's build system. In this case, please revisit the etc/build.conf file and make sure to point the variable GENODE_DIR to the top-level directory of the Genode release.
Device Drivers
There exist several (experimental) device drivers in the src/drivers directory of the os repository such drivers for PS/2 mouse and keyboard and the VESA frame buffer. These are automatically build.
Building Genode for Fiasco/ARM
By default, Genode searches for any configuration data in the etc/ subdirectories of each specified repository. For building the default variant of the Fiasco-version of Genode, the specifics for the build process are taken from base-fiasco/etc/specs.conf. If you want to build the ARM version of Genode, you need to override the default specifics by creating a customized specs.conf file in the etc/ directory of your build directory. Your customized file should contain:
SPECS = genode fiasco_arm
Furthermore, we need to tell Genode to use a cross compiler instead of the default host compiler. This can be achieved by overriding the default etc/tools.conf by using a custom etc/tools.conf file in your build directory. For using an ARM tool chain, this file may contain:
CROSS_DEV_PREFIX = arm-softfloat-linux-gnu-
Booting Genode on Fiasco-UX
You may take a look at the template Genode configuration file at os/config/fiasco_ux_demo. When starting Fiasco-UX, you need to specify Core as roottask and all other components as plain modules.
Example command line:
fiasco -m 64 -G 640x480@16 \
-R <compound-builddir>/genode_fiasco/bin/core \
-S <compound-builddir>/3rd/l4env/bin/x86_586/l4v2/sigma0 \
-l config \
-l <compound-builddir>/genode_fiasco/bin/init \
-l <compound-builddir>/genode_fiasco/bin/hello_cxx \
-l <compound-builddir>/genode_fiasco/bin/input_ux_drv \
-l <compound-builddir>/genode_fiasco/bin/framebuffer_ux_drv \
-l <compound-builddir>/genode_fiasco/bin/timer \
-l <compound-builddir>/genode_fiasco/bin/nitpicker \
-l <compound-builddir>/genode_fiasco/bin/scout \
-l <compound-builddir>/genode_fiasco/bin/launchpad \
-l <compound-builddir>/genode_fiasco/bin/testnit \
-l <compound-builddir>/genode_fiasco/bin/nitlog \
-l <compound-builddir>/genode_fiasco/bin/liquid_fb
Booting Genode on PC hardware
Example GRUB configuration entry:
title Genode Demo kernel /bootstrap -modaddr=0x03000000 module /fiasco nowait -nokdb -tbuf_entries=16384 -serial_esc module /sigma0 module /core module /init module /config module /ps2_drv module /framebuffer_drv module /nitpicker module /timer module /launchpad module /testnit module /scout module /nitlog module /liquid_fb
For an example of a matching Genode config file, please take a look at os/config/demo.
Quirks and Issues
Exception support on Fiasco/x86
The Genode environment supports the use of C++ exceptions in your applications. Technically, this means that the support libraries of gcc (libsupc++ and libgcc_eh) are linked against the target. Unfortunately, with the host gcc-4, these support libraries depend on the implementation of thread-local storage (tls) via the gs register. On Fiasco/x86 however, we do not provide this mechanism and thus, the compiled binaries fail. There are two possible solutions for this issue:
- We could provide the same thread-local storage mechanism as Linux does.
- We use a custom gcc that we configure to not use tls via the gs register. This approach is supported by our tool chain http://genode.org/download/tool-chain/. After the compiler installation, add an additional configuration file 'etc/tools.conf' to your '<compound-builddir>/genode_fiasco' directory containing:
CROSS_DEV_PREFIX = /usr/local/crosstool/gcc-4.1.1-glibc-2.3.6/i686-unknown-linux-gnu/bin/i686-unknown-linux-gnu-
Alternatively, you may include /usr/local/crosstool/gcc-4.1.1-glibc-2.3.6/i686-unknown-linux-gnu/bin/ in your PATH variable and set CROSS_DEV_PREFIX to just i686-unknown-linux-gnu-.

