Wednesday, October 20, 2010

compile coreboot and flash BIOS

I successfully compiled coreboot on centos 5.5.
Below are the details.

First of all, you need to install subversion, make, gcc, g++.
If you cannot find package by using: yum install, you can do: yum search

Below are the problems I had:

1. need ncurses-dev for make menuconfig
The error messasge is: curses.h no such file
solutions is:  $ yum install ncurses-devel ncurses

2. need to update ld in binutils
The error message is: /usr/bin/ld: unrecgonized option '--build-id=none'
It is because the version of binutils is not the lastest version. ld cannot recgonize "build-id" option. Even if you tried:
yum update binutils
It is still the old version on centos. I think it is because the repository of centos 5.5 haven't update the binutils.
You can find the latest version of binutils from:
http://ftp.gnu.org/gnu/binutils/
I just downloaded the last version is:
[   ] binutils-2.20.1.tar.gz            03-Mar-2010 10:21   22M 
 
 After download the binutils, you need to build it. Read the README file. and install it.

3. you also need to install following package from coreboot howto website
  • doxygen (for generating/viewing documentation)
  • iasl (for targets with ACPI support)
  • gdb (for better debugging facilities on some targets)
  • flex and bison (for regenerating parsers)

 you could install them by using:
yum install
but package iasl you cannot find it.
you need to download it from
http://www.acpica.org/downloads/
you need to download first file, untar it, and build the iasl in compile folder.
From the Readme file, we know the makfile doesn't have "make install" function. So we need to copy the binary file iasl manually to /usr/bin directory.

Now, I think you have successful build coreboot.

In addition, for the make meneconfig, there are something you need to know:
you need to specify the motherboard factory, motherboard model, and the size of BIOS(some of them is 512kb, some of them are 1024kb).
you also need to specify the payload, the payload I am using the seabios. You could compile your own seabios, or you could download binary seabios from coreboot website.
I also have another post about linking the vagbios.bin in the configuration file.

For FlashBIOS, you need to download flashrom tool from coreboot.org
and run:
$ flashrom -w coreboot.rom // write coreboot.rom file to BIOS

No comments: