Building OFW for ARM

From OpenBIOS
Revision as of 08:52, 11 August 2010 by Wmb (talk | contribs) (Output file name is ofw.rom, not mmp2.rom)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 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.