Building OFW for ARM

From OpenBIOS
Revision as of 06:28, 11 August 2010 by Wmb (talk | contribs) (Compiling the ARM version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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: sudo apt-get install qemu
  • Fedora: sudo yum install qemu-user

For Fedora, you might also need to disable SELinux security during 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 mmp2.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.