Recompiling the firmware

Mitch Bradley wmb at laptop.org
Sat Apr 4 09:47:03 EDT 2009


> Hello
>
> I couldn't find a lot of informations about firmware recompilation.
>
> >From what I've read, I think I can get it from
> http://openbios.org/viewvc/?root=OpenFirmware
>
> But how do I recompile it, to get a new .rom file ready to by flashed
> ? (the same question appears on Firmware_hobby_hacking on the wiki,
> without any reply)
> Do I need specific tools ?
>
> I have the developper key for the machine I would like to experiment on.
>
>   
The information you need is below.  Your mission, should you decide to 
accept it, is to create a wiki page with this information :-)

To recompile everything, you need subversion to get the source, gcc and 
iasl to perform the compilation.

gcc 4.1.1 and 4.2.1 are known to work, and other versions of gcc are 
very likely to work.

iasl is only needed for compiling the ACPI table, which is only used 
when you boot Windows on XO.  Since there is no legal way for you to 
obtain a license for the XO version of Windows, instructions for 
avoiding the need for iasl are included below.

The base recipe, assuming that you have iasl, is:

  svn checkout svn://openbios.org/openfirmware
  cd openfirmware/cpu/x86/pc/olpc/build
  <edit ../versions.fth, changing the value of FW_MINOR from e.g. 39 to 39a>
  make

That will create a file q2e39a.rom that is ready to flash.  Copy it to a 
USB key, put the USB key in the XO, and type:

  ok flash disk:\q2e39a.rom

The change to versions.fth distinguishes your build from an official 
release version.

To eliminate the need for iasl, edit ../olpc.bth and comment-out the two 
lines that contain the string "dsdt".  To comment-out a line, prepend "\ 
" (backslash-space).  That will break the dependency on the ACPI "DSDT" 
table that uses the iasl compiler.  ("olpc.bth" is the top-level build 
script that sequences the production of the firmware image.)

If your network connection is slow or disk space is tight, you can say 
"svn export" instead of "svn checkout". An "export" tree contains just 
the source files without Subversion metadata.  The "checkout" tree is 3 
times the size of the "export" tree - 53 MB vs. 17 MB.  The disadvantage 
of the "export" tree, of course, is that Subversion can't help you keep 
track of your changes or upstream changes.





More information about the Devel mailing list