Building OFW for ARM

From OpenBIOS
Revision as of 17:45, 11 August 2010 by Wmb (talk | contribs) (More information about finding qemu-arm)
Jump to navigation Jump to search

This page tells how to build Open Firmware for an ARM target system.

Host System Requirements

During the Open Firmware build process, the Forth system inside OFW is executed several times to extend itself. Those steps must run on the same CPU instruction set (in this case ARM) as the final target. So you must build OFW either on an ARM computer or by using an ARM instruction set emulator running on some other computer. [QEMU] works well for this purpose.

Compiler Setup for Native ARM Host

To compile on an ARM host, you need Linux on that host, along with the GNU toolchain (GCC and GNU make) plus the Subversion version control system.

Compiler Setup for x86 Host

To compile on an x86 host, you need everything listed for the native host (Linux, GNU toolchain, and Subversion), plus QEMU.

To install QEMU:

  • Debian: sudo apt-get install qemu
  • Ubuntu 8.04 (Hardy): sudo apt-get install qemu
  • Ubuntu 9.10 (Karmic): sudo apt-get install qemu qemu-kvm-extras
  • Fedora: sudo yum install qemu-user

In general, the file that you need is "qemu-arm". You can use commands like (Fedora) "yum whatprovides qemu-arm" or (Debian/Ubuntu) "apt-file search qemu-arm" to work out which top-level package to install.

For Fedora, you might also need to temporarily disable SELinux security before OFW compilation:

 sudo /usr/sbin/setenforce 0

Building Open Firmware

Get the Open Firmware source:

 svn co svn://openfirmware.info/openfirmware

Build OFW:

 cd openfirmware/cpu/arm/mmp2/build
 make

The last line of the compilation output should say something like:

 --- Saving as ofw.rom

That tells you the name of the output file.

There are some other build directories like "cpu/arm/versatilepb/build". At the time of this writing, they have not been fixed up to "do the right thing" with the emulated build environment. The Makefile in cpu/arm/mmp2/build is the current "gold standard" for the build automation.