This section shows how to setup a simple ARM development and testing environment in your PC, using Qemu and the GNU toolchain. Qemu is a machine emulator capable of emulating various machines including ARM based machines. You can write ARM assembly programs, compile them using the GNU toolchain and execute and test them in Qemu.
Qemu will be used to emulate a PXA255 based connex board from Gumstix. You should have at least version 0.9.1 of Qemu to work with this tutorial.
The PXA255 has an ARM core with a ARMv5TE compliant instruction set. The PXA255 also has several on-chip peripherals. Some peripherals will be introduced in the course of the tutorial.
Debian Etch has a qemu package, but the version is 0.8.2, which does
not have the connex board emulation. Debian Etch backports has version
0.9.1 of qemu. To install from backports:
Add the following line to /etc/apt/source.list
deb http://www.backports.org/debian etch-backports main contrib non-free
Add the archive’s key to apt.
$ wget -O - http://backports.org/debian/archive.key | apt-key add -apt-get update.
Install qemu from backports
$ apt-get -t etch-backports install qemu
Extract the tar archive, to ~/toolchains.
$ mkdir ~/toolchains
$ cd ~/toolchains
$ tar -jxf ~/downloads/arm-2008q1-126-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
Add the toolchain to your PATH.
$ PATH=$HOME/toolchains/arm-2008q1/bin:$PATH.bashrc.