Gumstix emulation for QEMU

Gumstix emulation for QEMU allows for testing gumstix flash images and other software on a normal computer. QEMU is an open source processor emulator which can emulate several different CPU types, including the ARM on the gumstix boards. I've been pretty happy using it to test things before I go to the real hardware. Although it crashes on occasion, I have still found it very useful.

I've only ever used QEMU on Linux. It exists for Windows, so it should be possible to make it work, but I can't give any specific guidance.

Getting the sources
Gumstix verdex and connex support has found its way into the CVS version of QEMU. Update: It seems to also now be in the main trunk. The precompiled binaries I obtained had verdex support. Follow the instructions http://fabrice.bellard.free.fr/qemu/ to get and compile the CVS code for arm targets. It seems that the sources have made Note that the machine name has changed from gumstix to verdex or connex, respectively.

qemu-system-arm -M verdex -pflash flash -monitor null -nographic -m 289
 * Example usage is now (where "flash" is the file containing the flash filesystem):

Obsolete sources
Obsolete source code is available at http://www.bitmux.org/qemu.html, along with basic build and execution instructions which I won't repeat here.

./configure --target-list=arm-softmmu On a Debian linux box, I needed to do this: sudo apt-get install gcc-3.4 ./configure --target-list=arm-softmmu --cc=gcc-3.4 --disable-gfx-check
 * The download page lists the build command as

Tips and tricks

 * This seems to no longer be an issue: The default U-Boot boot command runs the  command, which as far as I can tell hangs the emulator.  The workaround is to hit a key before the default boot command runs, and either run a command by hand (  is usually enough), or set a new   and   it.

rm flash dd of=flash bs=1k count=16k if=/dev/zero dd of=flash bs=1k conv=notrunc if=u-boot.bin dd of=flash bs=1k conv=notrunc seek=256 if=rootfs.arm_nofpu.jffs2
 * If you've got a buildroot and want to build a new flash image for QEMU, execute these commands (these commands also work with the precompiled downloads on Gumstix's Sourceforge Page):


 * If the compiled version of u-boot.bin is version 1.2.0, also execute this command:

dd of=flash bs=1k conv=notrunc seek=15360 if=uImage


 * Then you can run the emulator with this new flash.

dd of=flash bs=1k conv=notrunc seek=31744 if=uImage
 * It seems that in newer models of Gumstix some things (including where uboot thinks the kernel is at) have changed. If when using QEMU to simulate a verdex (and using recent 1.20 or higher uImage), you keep getting u-boot errors about finding a "bad magic number" and are unable to boot into Linux then try this command instead:


 * 31744 is 0x01f00000 (you'll notice that number in your uboot error) divided by 1024 (bytes into kilobytes) and turned into a decimal number. It works for me (I can login as root, make and save a file, and view it after Qemu has shutdown or rebooted the machine. Previously, uboot could not even boot into Linux. I get many, many errors about unimplemented flash write commands but things seem to mostly work).


 * If you have bluetooth enabled, the  script will never complete (  will just print dots forever.)  However, Control-c will interrupt it and you can then log in.  This will cause all the following init.d scripts not to run, so I recommend removing this script.  If your gumstix doesn't have bluetooth, then you might as well just disable bluetooth completely from menuconfig.  If you do this, you'll probably also need to remove the file from   so it won't be in the next image you build.


 * http://www.cnpbagwell.com/QEMU/HomePage is the most concise description I've seen of how to set up networking.


 * Control-a h prints some magic keys you can use from inside the emulator. Control-a x to exit is the most useful one.