Open Firmware use on OLPC.

Jim Gettys jg at laptop.org
Fri Oct 13 14:26:44 EDT 2006


When we say LinuxBIOS in the context of OLPC, we have generally meant
LinuxBIOS and some boot loader payload.  The boot loader is that program
that can load the system into memory; a boot loader needs to be able to
talk to the hardware, and implement file systems to be able to read the
kernel image into memory; at the end of this process, the boot loader
transfers control to the operating system. In OLPC's case, Linux itself
is being used as a boot loader right now.

Open Firmware has only been open only in the marketing sense of it being
licensable from Sun (similar to Digital/Compaq/HP's "Open VMS"). 
Jonathan Schwartz appears to be having a real affect on Sun's behavior:
before that, our LinuxBIOS/Linux as boot loader strategy was our only
rational strategy of having an open BIOS able to do all we needed. An
open BIOS is essential both for our power management work, and also so
that kids can see how computers really work inside.  

Sun *actually* opened "Open Firm Ware" a month or 6 weeks ago, to
everyone's surprise, under the 3 clause BSD license, hidden away as part
of the OpenSolaris release.  Mitch Bradley is in the process of doing
likewise with the Firmworks OFW additions and enhancements to that code
base.  Net result: a fully open/free boot loader.

Open Firmware has been in use on both Sun and PPC hardware for
approaching a decade, and has shipped in quantity millions.

LinuxBIOS itself has been working well; our biggest problems have had to
do with quirks of the Geode, which has made it much more of a challenge
than expected.  And we'll use LinuxBIOS in any case.

As you might imagine, having more than one path to a free BIOS and boot
loader came as a surprise, and it took a bit of analysis to weigh the
relative merits and demerits of our options given this surprising
change.  During this period, Mitch has implemented most of the necessary
drivers in OFW (drivers there are much easier than Linux drivers: you
don't have a high performance multi-tasking system to increase your
entertainment).  And Firmworks has implemented a brand new USB stack,
which is working well, but before its completion and testing would have
been an issue. This USB stack is working well and seems to be handling
almost everything thrown at it.

Linux as boot loader has worked, but it is also clear that, particularly
when we add both the Geode's VSA and firmware for the Marvell chip to
the BIOS load that things are very tight, one might say over tight, with
everything we'd like currently exceeding a 1MB flash.  But all in all
we've proved the point, if we squeezed hard enough, we'd get to the end
point we've been shooting for using Linux as bootloader.  Whether we'd
have to put some modules onto NAND flash or not in the end is less
clear; my guess is we would have had to do so to allow our Linux kernel
to remain "standard" enough for easy maintenance, and to have space for
diagnostics.  But much more of the machine has to be working to run out
of NAND flash (e.g. CAFE), so any diagnostics would be much less robust.

Some of the advantages of OFW include:
  1) space; OFW is much, much, much, smaller than Linux as boot loader. 
     Manufacturing diagnostics can also be used for field repair.
  2) a single BIOS image for both testing and deployment, so easier
     manufacturing flow.
  3) much more powerful firmware environment for debugging.
  4) faster boot due to smaller footprint to load.
  5) more "built in" device drivers possible, as we don't have the
     space constraints and drivers are much smaller than Linux drivers
  6) much faster to build, and somewhat less tool chain dependency
     problems (though LinuxBIOS itself can be a problem at times).
Downsides to OFW:
  1) work to do if we want to support IPv6; Mitch does not see this as
     very difficult, as the hard parts of IPv6 are stuff we don't need
     for boot or install.
  2) some work to do to support new hardware devices.  I note that
     drivers for OFW are much simpler than for Linux.  Mitch now has in
     hand all the OFW drivers and file system support we need (e.g.
     ext3, jffs2), though a few more of the common USB-1 ethernet
     devices would be nice to have, if anyone would like a little
     project.

Things that seem a wash to me:
    Lots of people know Linux kernels; lots of people know OFW on other 
    platforms.  They tend to be different sets of people, however.
    Forth is arguably a much more powerful environment than a busybox
    shell; but it is much easier to learn than a shell language.

Drum-rolls please.....

And at the end of the day, using Linux as bootloader, we end up without
space in SPI flash for much in the way of diagnostics, an issue both in
production, and in the field.  Manufacturability and field repair are
high in my mind, and proved a deciding factor.

The bottom line of this discussion is that we've decided to move to Open
FirmWare on OLPC as our bloot loader.  LinuxBIOS will remain as the BIOS
being used with OFW. The buildrom work done also was a also good
investment: it is making it much easier to build a ROM image, whether
Linux is the bootloader, OFW, or other existing boot loaders are used.

I do not yet know when we will convert to OFW.   We're figuring that out
now.  Have fun playing with OFW. Let us know of any problems you
encounter.  I only wish Sun had made their decision months sooner; it
would have been a much easier decision to make.  But my thanks to them
for opening OFW, in any case.

                               - Jim Gettys

-- 
Jim Gettys
One Laptop Per Child





More information about the Devel mailing list