Open Firmware

From OpenBIOS
Revision as of 09:27, 15 September 2008 by WikiSysop (talk | contribs)
Jump to navigation Jump to search

Introduction

In 2006 the company of Open Firmware inventor Mitch Bradley, Firmworks, Inc, released their Open Firmware implementation under a BSD license. This code shares some code with SUN's OpenBOOT implementation. It supports the x86 architecture and runs, amongst others, as a coreboot payload. It is the firmware implementation on the OLPC.

Download

You can browse the source code online.

The repository is available through Subversion:

You can check it out as follows:

 $ svn co svn://openfirmware.info/openfirmware/

if you want a specific revision:

 $ svn co svn://openfirmware.info/openfirmware -r 35

If your company installed a firewall that blocks the svn port (3690) you can also check out using the webdav frontend:

$ svn co https://www.openfirmware.info/openfirmware-svn/ openfirmware


coreboot

You should change openfirmware/cpu/x86/pc/biosload/config.fth:

Index: config.fth
===================================================================
--- config.fth  (revision 599)
+++ config.fth  (working copy)
@@ -2,14 +2,14 @@
purpose: Establish configuration definitions

create pc              \ Demo version for generic PC
-\ create pc-linux      \ Demo version for generic PC and Linux
+create pc-linux        \ Demo version for generic PC and Linux
\ create pc-serial     \ Demo version for generic PC

\ --- The environment that "boots" OFW ---
\ - Image Format - Example Media - previous stage bootloader

\ - (Syslinux) COM32 format - USB Key w/ FAT FS - Syslinux
-create syslinux-loaded
+\ create syslinux-loaded

\ - Linux kernel format - USB Key w/ FAT FS - LinuxBIOS w/ stripped Linux payload
\ create bzimage-loaded
@@ -19,10 +19,10 @@
\ create etherboot-variant  \ Enable additional tweaks for Etherboot

\ - ELF format (no pheader) - ROM - LinuxBIOS direct
-\ create linuxbios-loaded
+create linuxbios-loaded

\ Load and run in qemu
-\ create qemu-loaded 
+create qemu-loaded 

[ifdef] pc-serial
create serial-console
@@ -47,7 +47,7 @@
\ the point where Linux starts using the MMU.  It isn't strictly
\ necessary to use virtual mode if you just want to boot Linux
\ and then have OFW disappear.
-create virtual-mode
+\ create virtual-mode
create pc
create linux-support
[then]


Building

Software Requirements:

   qemu-0.9.0 + ROMSIZE-patch
   Open Firmware rev. >= 500
   coreboot >= v2

Patch and build qemu

Get the patch from http://www.freimann.org/qemu_biossize.patch and apply it against qemu-0.9.0.

       tar xvfz qemu-0.9.0.tar.gz
       cd qemu-0.9.0
       wget http://www.freimann.org/qemu_biossize.patch
       patch -p1 < qemu_biossize.patch

Make sure that you have gcc-3.x installed, then

       ./config && make && make install


Build Open Firmware

Get Open Firmware from Subversion

       svn co svn://openfirmware.info/openfirmware

Change to the build directory of the biosload build.

       cd cpu/x86/pc/biosload/

To change the config file of Open Firmware you can either use the above patch, or you can edit config.fth with your favorite editor (vi!!1!). Uncomment the lines

       create linuxbios-loaded
       create qemu-loaded

Comment out the line with

       create syslinux-loaded

Now change to the build directory and type "make"

       cd build
       make

After make is finished there should be a file "ofwlb.elf" in the same directory. Copy this to your coreboot-v[x] directory.

Build coreboot

Follow the instructions in the coreboot documentation. Make sure that you use the ofwlb.elf file as your payload. It is also very imortant that the ROMSIZE for coreboot and qemu correspond with each other.


Run it

   qemu  -L coreboot-v3/build -hda path/to/disk.img -serial `tty` -nographic                 


Mailing List

There's an Open Firmware mailing list at:

The mailing list archive is also available: