OKL4 for the HTC dream
Several ERTOS projects use or will use the HTC dream hardware. This page describes our port of OKL4 to that platform.
About the code
This is OKL 3.0, the latest public version from Open Kernel Labs. It has two new platforms added: goldfish and trout. Both of these are Google's code names for Android platforms: goldfish is the simulated platform that runs inside the Android emulator (qemu), and Trout is the HTC dream, also known as the G1.
Getting the source
Download the port here:
okl4-android-3.0.tar.bz2 (10M, updated March 15 2009)
Ensure you have a proper OKL4 toolchain for ARM (consult the OKL Wiki linked above for details), then test the system using a line like:
tools/build.py machine=trout project=examples example=hello PYFREEZE=False
... to build for real hardware, or
tools/build.py machine=androidsim project=examples example=hello PYFREEZE=False
... to build for the emulator.
VMWare imageAs an alternative to installing the toolchain manually, you can download a VMWare image (495 MiB) containing a Debian installation with appropriate toolchain and Python versions for building. You can log in as "root" or "dream" (neither of which have a password).
Running the code on the HTC Dream
You can boot the image using fastboot from the phone's engineering boot loader (of course, you will need a Fastboot-enabled boot loader for this, i.e. an ADP1 phone). Unfortunately the stock bootloader sets the entry point for the kernel to be 32K above the start of system memory. This is standard for Linux but not what L4 is expecting. You must create a custom version of Fastboot which requests the image be loaded at the start of memory. Apply this patch inside your mydroid/system/core/fastboot directory, and then rebuild fastboot by typing, from the mydroid directory: make out/host/your host platform name/bin/fastboot. The new fastboot supports an extra option, -l4. Boot the kernel from the engineering bootloader:
fastboot -l4 -p dream boot build/images/image.boot.bin
Running the code on the Android emulator
The emulator must also be patched to load images at the start of RAM. Apply this patch (thanks to Benno) to your emulator source code, or use our mirror of the pre-patched emulator, here: android-emulator-ok.tar.gz (5M).
Once the emulator is patched, you may load the image with a commandline like this:
emulator -os-type okl4 -console -kernel build/images/image.boot.bin
For questions about the port please send email to Nicholas FitzRoy-Dale.