L4Ka Project

Build and Boot Instructions for PowerPC

page maintained by Joshua LeVasseur (jtl does-not-exist.ira uka de)

Preparation

Your first step should be to prepare the cross-compilation tool chain. The steps for building the tool chain, and the psim PowerPC simulator, are contained in the file ppc-build.txt in the L4Ka::Pistachio source release. Some FreeBSD source and binary packages are also available for download.

Once you have the appropriate build tools you can progress with the L4Ka::Pistachio build. You will have two build directories: pistachio-powerpc for the kernel, and pistachio-user-powerpc for user-level applications. The following instructions assume that the two directories share a common parent directory, and will refer to that directory as $MY_BUILDDIR.

Kernel Build

  1. Make sure that your kernel build directory, $MY_BUILDDIR/pistachio-powerpc, does not exist.
  2. Change into the kernel subdirectory of the L4Ka::Pistachio source release. Execute make BUILDDIR=$MY_BUILDDIR/pistachio-powerpc
  3. Change into the directory $MY_BUILDDIR/pistachio-powerpc and execute make menuconfig. Under the Hardware menu, change the Basic Architecture to PowerPC. Under the Kernel menu, enable the Fast IPC path option. From the Debugger menu, enable the kernel debugger, enable the option to enter the kernel debugger at startup, enable the disassembler, enable tracepoints, and enable tracing of kernel memory. Save the configuration file and quit (hit the 'x' key).
  4. Build the kernel by executing make -s

User Level Build

  1. Create your user-level application build directory: $MY_BUILDDIR/pistachio-user-powerpc
  2. Change into your user-level application build directory.
  3. Execute the configure script which lives in the user subdirectory of the L4Ka::Pistachio source release, using the appropriate command line arguments. The configure script prepares the current working directory as the build location. Relevant command line arguments:
    --host=powerpc
    Mandatory for enabling PowerPC support.
    --with-kerneldir=$MY_BUILDDIR/pistachio-powerpc
    Used by the bootloader to locate the kernel.
    --without-comport
    Will cause user-level input and output to use the kernel debugger exception interface. This requires a kernel debugger. Without a kernel debugger, user-level threads will throw unhandled exceptions while trying to perform I/O. Choose this if you plan to use Open Firmware for I/O. Explicitly use this command line option if you don't see I/O as expected, because the comport may be enabled by default.
    --with-comport
    Use the serial port for user-level input and output. It currently only supports the psim com port (when configured as suggested in the section below about executing psim).
  4. Build the user-level applications and PowerPC boot loader by executing make -s

Boot Loader

The boot loader source lives in user/util/piggybacker of the L4Ka::Pistachio source release. The boot loader is a simple elf file which coalesces the runtime modules as elf sections of itself, thus permitting other boot loaders (such as OpenFirmware) to load the entire L4 environment.

All components generated for the boot loader are relative to $MY_BUILDDIR/pistachio-user-powerpc. The generated boot loader binary is named util/piggybacker/ofppc/ofppc-loader

The piggybacker chooses modules based on the file util/piggybacker/ofppc/Makeconf.local. If it doesn't detect the file, it will generate the file with default values.

If you change the Makeconf.local file, you may need to delete by hand all .bin and .mod files in the directory util/piggybacker/ofppc due to broken dependency detection.

Executing psim

It is recommended that you patch psim, and use the psim device tree file (call it psim.tree), as described in the file ppc-build.txt of the L4Ka::Pistachio source release.

An example psim invocation: powerpc-unknown-eabi-run -e chirp -m 604 -f psim.tree \
$MY_BUILDDIR/pistachio-user-powerpc/util/piggybacker/ofppc/ofppc-loader

Hints

While running the pingpong and l4test applications, you can enter the kernel debugger by hitting the escape key while at the root menus.