Welcome to the dark corner of BIOS reverse engineering, code injection and various modification techniques only deemed by those immensely curious about BIOS

Sunday, May 11, 2014

(Cross) Compiling My Sample PCI Expansion ROM Code

My sample PCI Expansion ROM code over at Low Cost Embedded x86 Teaching Tool is no longer compile-able on recent x64 Linux distributions. This is due to the fact that the default GCC toolchain in those Linux distros doesn't support output in the form of the particular ELF32 i386 required by the source code. Other possible problem is the GCC toolchain doesn't support 16-bit code output anymore, as required by the linker script.

For trouble free source code compilation, you're advised to download and build Coreboot cross compiler, see: http://www.coreboot.org/Build_HOWTO#Known_issues. Just invoke:

make crossgcc

in the directory where you download Coreboot (Coreboot root directory) to build the cross compiler. You'll also need to alter the Makefile of the PCI Expansion ROM code to use the newly built cross compiler. The toolchain components that you need to change in the Makefile is pretty much everyone of them, i.e: CC, LD, AS and OBJCOPY. The cross compiler should be located in the /util/crossgcc/xgcc/bin directory, once you have completed building the cross compiler. If you are still unsure about the path of the cross compiler toolchain, open the .xcompile file in Coreboot root directory.

Gentle Introduction to Coreboot

I've just stumbled upon this series of articles by  Lennart Benschop about Coreboot. It's a very smooth introduction to Coreboot that explains Coreboot components from a high level view and proceed toward more specific parts of it. You can read it over here. Note that Coreboot specific stuff starts at "Column" no.4. Have a nice reading :-)