Open Firmware is now free
[Posted November 15, 2006 by corbet]
A full twenty years ago, Mitch Bradley sat down to write the firmware
(BIOS) code for Sun's upcoming SPARCstation line. The resulting code, then
called OpenBoot, shipped on SPARC systems for years, and found its way into
other vendors' computers as well. Mr. Bradley eventually left Sun to
continue to work with this code, now called Open Firmware. It has proved
to be useful for system manufacturers who found it to be a quick way to get
their hardware going. Twenty years later, he is still at it at his company,
FirmWorks.
As of this week, however, one aspect of Mr. Bradley's job has changed: he
is now working with free software. Between code releases by Sun
Microsystems and FirmWorks, the entire Open Firmware system is now free.
Most of it is available under the BSD or MIT license; it can be browsed on the
net or obtained from the Subversion repository at
svn://openbios.org/openfirmware.
Open Firmware is an interesting system. At its core, it is an interpreter
for the Forth language; most of the higher-level functionality is
implemented in Forth and run on the interpreter. That will make the Open
Firmware source relatively opaque for those of us who are not accustomed to
working in stack-based languages; Open Firmware will certainly have the
only ext2 filesystem code which looks like this:
: ext2fsfread ( addr count 'fh -- #read )
drop
dup bsize > abort" Bad size for ext2fsfread"
file-size lblk# bsize * - ( addr count rem )
umin swap ( actual addr )
lblk# read-file-block ( actual )
dup 0> if lblk#++ then ( actual )
The use of Forth does help to keep the Open Firmware code compact and
quick, however. This system can work with several different filesystems,
perform TCP/IP networking (including functioning as an HTTP server or
client), work with USB devices, and drive a wide range of devices in
general. And it all fits in about 350KB of flash, with the ability
to shoehorn it into 256KB if need be.
Open Firmware can also be useful for debugging hardware issues. The Forth
interpreter is available at the system console, allowing a sufficiently
clued developer to poke at device registers directly and see what happens.
This feature is especially useful when trying to bring up new hardware
which is displaying unexpected behavior. As Mr. Bradley has been heard
to say:
I find that a certain amount of foot shooting is necessary,
especially when dealing with new, possibly-broken hardware with
dubious documentation. Interactivity at the lowest level lets you
get all the foot-shooting done quickly, and more importantly, lets
you examine the wounds in great detail.
Open Firmware is a foot-shooting tool of substantial power.
The Open Firmware code was widely used, even when it was a proprietary
product. This code will be even more widely distributed soon. Back in
October, the One Laptop Per Child project announced that it would be adopting Open
Firmware for its systems. LinuxBIOS will remain on those systems as the
low-level BIOS, but Open Firmware will be the code which performs boot
loading and presents the firmware-level interface to the user. The OLPC
decision was based on smaller size, greater speed, and greater flexibility
of the Open Firmware code. Once Open Firmware set on the path toward a
free release, OLPC's decision was relatively easy.
In the future, the now-free nature of Open Firmware may cause it to appear
on a number of new systems, in places where a proprietary BIOS would have
been found before. As a result, a part of our systems which has
traditionally been proprietary and closed might just become open and free.
So, while many of us may never work with this code directly, we'll likely
benefit from its freedom anyway.
(
Log in to post comments)