Building LinuxBIOS: Difference between revisions
JordanCrouse (talk | contribs) (Remove the no-longer needed LinuxBIOS instructions) |
JordanCrouse (talk | contribs) m (LinuxBIOSHowto moved to Building LinuxBIOS: a better name, and fits with "Flashing LinuxBIOS") |
(No difference)
|
Revision as of 00:12, 10 August 2006
Warnings and Disclaimers
These instructions are new and subject to change. No assurance is made that this won't permanently harm your hardware. If you don't understand any of these steps, please stop and ask for clarification on the mailing lists or in IRC. You have now been officially warned.
Buildrom
During boot, LinuxBIOS loads a small payload that consists of a minimal kernel and an initramfs image. We refer to this payload as the "ROM image". The ROM image is responsible for bringing up the system enough to try to load a full kernel from the NAND flash, a USB mass storage device, or the network. Buildrom is a small set of build scripts that facilitiates building the bootloader and ROM image (including the kernel and all the different utilities and scripts that make up the initramfs image). If you understand buildroot (from the uclibc team), then buildrom will look familiar - it is based on the same concept.
Buildrom is a GNU Make based build system. Using a series of configuration files, the makefile will determine what packages need to be built. Each package is obtained from an upstream repository with wget and built locally on your machine. When all the packages have been built, the script pulls together all the binaries for the ROM image, and combines them into a .ELF file which is then used as the payload to build a LinuxBIOS ROM.
Getting buildrom
Buildrom is available from the OLPC GIT repository on http://dev.laptop.org. Follow these instructions, using this as the tree location:
git://dev.laptop.org/users/jcrouse/buildrom
From time to time, you will want to make sure you are synced with the upstream tree:
$ cd buildrom; git pull
Building the image
Buildrom requires the following tools on your development system to run:
- make
- gcc
- svn
- wget
- quilt
- perl
To build the default image, just type
$ make
You will notice that the system will start downloading packages from the web with wget, and compiling them. If you are behind a proxy, don't forget to set http_proxy before starting.
$ export http_proxy=<proxyurl>:<proxyport>
Note that there is also one package (LinuxBIOS) that will be pulled down with SVN. If you have proxy worries, make sure your local SVN environment is correctly setup.
Buildrom already sets all the important flags and other settings to build the tools and libraries so they can be included into the ROM. There are several configuration options you can play with once you are more familar with the system. Check Config.mk and read the comments.
Using the Image
When the system is done building, you will have three files in the deploy/ directory:
- bzImage - The minimal kernel that was built
- initrd - the gziped initramfs image
- olpc-payload.elf - ELF file that includes both the bzImage and the initrd. This is the payload that LinuxBIOS uses.
The most important deliverable is the 1MB ROM image:
- linuxbios.rom
What Next?
Currently there isn't any sane way to flash the ROM to the serial flash on the OLPC board without running a huge risk of bricking it. The only way to try out the ROM image right now is to write the image to a PLCC ROM chip and use that in the PLCC socket on the Rev A boards.
You will want to use 8Mbit ROM chips, like these.
Flash the image with your favorite method. The LinuxBIOS FAQ has much to say on the issue: http://linuxbios.org/index.php/FAQ.