Column 7: The art of not locking yourself out. (2011-08-10)

When running Coreboot on QEMU, nothing bad could happen. If a particular version did not work, you could just try another ROM image file or you could fall back to an old version or even the original non-Coreboot BIOS of QEMU. This is all easy with emulated hardware, but on real machines this is very different.

The barrier of entry for Coreboot on real hardware is really much higher than that on QEMU. If you just flash a Coreboot image to your motherboard BIOS ROM and you make a mistake, you will not be able to use this board until you get the correct code in flash again. The motherboard is said to be "bricked" (a devices is bricked if it is as useless as a brick). It is absolutely essential that you prepare carefully, so you know how to get the bricked motherboard back to life.

How to proceed

these are the steps to become a successful Coreboot developer:

It is always best not to use the target machine (the one you are trying to run Coreboot on) for production work and use a separate PC as a build PC.

Programming strategies

There are several ways to program the BIOS flash chip in your motherboard. For more details see the hardware tools page on the Coreboot website

Ad disadvantage of the in-system strategies is that it is nearly impossible to prevent overwriting the "known good" original BIOS chip by accident. For the in-system programming strategies you will need (at least) three identical flash chips.

The flashrom utility

The flashrom utility is a separate program from Coreboot itself, yet it is maintained by the same people. The focus of flashrom is the ability to program a BIOS chip in-system, but some external programmers are also supported. Access to the BIOS flash chip is usually provided by the southbridge and there are several different hardware interfaces (FWH, LPC and SPI).

Read access to the flash chip is usually straightforward. For one thing this has to be working just after a hardware reset, otherwise the CPU could not run its ROM code. It may be less straightforward to enable access to all of the flash chip, which Coreboot will need to access its CBFS files.

Write access is harder still. Not only is this very dependent on the exact southbridge chip, but some motherboards have special write-protect circuits that have to be disabled first.

Flashrom supports a very large number of motherboards. Flashrom must be run under an operating system (e.g. Linux), so it does not depend on special boot diskettes. It is also possible to compile it as a payload under Coreboot.