L4/Darwin (aka Darbat)
The L4/Darwin project is an experimental port of Darwin to the L4 microkernel to study the characteristics of a large-scale microkernel-based system. It includes a port of IOKit to L4, a modified libc to communicate with the Darbat Server, and of course XNU with many of the machine-dependent parts heavily modified (pmap, thread/task creation, etc) but much left unchanged (most of BSD, and large parts of OSFMK work without modification).
Current Plans
The aim is for Darbat to be fully binary compatible with existing userlevel Darwin binaries. There are also plans to integrate L4 Linux (Wombat) to run side-by-side with Darbat on the same machine and allow them to communicate via L4 IPC.
Given the amount of existing OS X code that depends on Mach, we are currently not aiming at completely removing Mach from Darwin. Instead we are modifying Darwin to make better use of L4 and profit from its performance. This includes:
- Translating current MIG-based RPC calls to make direct L4-IPC calls, bypassing much of the Mach IPC infrastructure
- Modifying launchd's launch_msg primitive, and other services, to use L4 IPC directly
- Providing a user-level library for optimising certain types of mach_msg calls to go directly via L4 IPC (without indirecting through the L4/Darwin kernel server)
- Modifying the Mach scheduler to move the higher-frequency scheduling decisions into L4
Driver support
Driver support is provided by the IOKit. A range of drivers are supported, including PIIX ATA, USB (keyboard and mouse, USB stick), Intel 8255x ethernet, and generic serial. There is almost complete support for binary-loading of existing drivers.
Status
Supported Hardware
The following systems are supported through a FireWire based bootloader and debug console. Support for the builtin display and USB keyboard is available to use the shell.
- Intel Mac Mini (Core Solo)
- Intel iMac (17", 1.83GHz Core Duo)
- Intel iMac (20", 2GHz Core Duo)
- MacBook (White, 1.83GHz Core Duo)
- MacBook Pro (15.4", 1.83GHz Core Duo)
While other systems may work, we haven't tested them yet.
Software support
Darbat boots into single user mode (launchd -s) and is able to run a range of commands including (but in no way limited to):
- ps
- cat
- vim (although display is slightly buggy)
- emacs (requires 10.4.7 on the host machine)
- make
- gcc/as (some programs generated by gcc can also be run)
- python
- perl
Things that still need to be implemented are:
- support for more advanced commands (eg top, gdb)
- BSD signals (currently only very specific cases of signal delivery are supported)
- Kernel preemption
- Timer interrupts and clock support
There is full read/write support for the internal HD, and for testing purposes it is best to mount this drive and run commands directly from it. Currently 10.4.6 binaries found on release hardware will load successfully in Darbat.
Downloads
Darbat is available as both source and binaries. We are currently at Release 0.2. For more details and downloads, see the release page.
People
Conference Publications
![]() |
![]() |
Geoffrey Lee and Charles Gray L4/Darwin: Evolving UNIX Conference for Unix, Linux and Open Source Professionals (AUUG), Melbourne, Vic, Australia, October, 2006 Slides |
Theses
![]() |
![]() |
Jonathan Sokolowski Darbat resource management, BE Thesis, School of Computer Science and Engineering, University of NSW, Sydney 2052, Australia, 2007 |
![]() |
![]() |
Joshua Root Virtualising Darwin on L4, BE Thesis, School of Computer Science and Engineering, University of NSW, Sydney 2052, Australia, 2007 |
![]() |
![]() |
Tom Birch Performance limits of Darwin on L4, BE Thesis, School of Computer Science and Engineering, University of NSW, Sydney 2052, Australia, 2006 |
![]() |
![]() |
Geoffrey Lee I/O kit drivers for L4, BE Thesis, School of Computer Science and Engineering, University of NSW, Sydney 2052, Australia, 2005 |
![]() |
![]() |
Ka-shu Wong MacOS X on L4, BE Thesis, School of Computer Science and Engineering, University of NSW, Sydney 2052, Australia, 2003 |