vm-larix‎ > ‎Emulator‎ > ‎

Testing QEMU

The instructions on this page is intended to test whether the emulator is working as expected.

The following files and instructions are from the qemu-omap3 project hosted on Google Code. This project development has stalled and refers it's visitors to the active meeGo qemu project. If you have the meeGo copy of the QEMU, you do not need to download and build either libSDL or qemu-omap3. However, the qemu-omap3 download does have some good scripts that are useful to build SD card images for QEMU emulation of your OS. Links to these files are attached to this page for convenience.

bb_nandflash.sh (script)
This script builds a ROM image to boot the emulator. The link above is the version edited by Dr. Pyeatt to make the script more portable. If you are having trouble with the script, feel free to check out the older versions of the script. 

bb_nandflash_ecc (ELF32 | ELF64)
This is an executable file. It adds ECC to the emulator ROM image. This executable was compiled on a Slackware 64 bit and a Debian 32 bit. Should these not run on your machine out of the box, you may compile this file from the QEMU-OMAP3 project hosted on Google Code. After unzipping the source .bz2 file, run -

gcc -o bb_nanfflash_ecc bb_nanfflash_ecc.c

There is no need to run make.

Texas Tech specific tips

If you are attempting to run the QEMU on sponge, remember to SSH with the X11 forwarding option enabled as

ssh -X user@sponge.cs.ttu.edu

If your machine is running windows, you will need to have an X11 system such as Xming (it works!) or X11 on Cygwin running.

Once you have logged in to sponge, ssh -X to one of the internal nodes, and

source /usr/local/qemu/qemu-setup.sh

This shall set the required environment variables to run qemu. It is strongly recommended that you install the arm-elf-gcc- / arm-eabi-gcc- tool chain and the emulator on your local system. The steps to build the NAND flash image (mentioned below) are really slow. 

Now that most of the tools are in place, the binary images may be obtained -
wget http://qemu-omap3.googlecode.com/files/image-v0.01.tar.bz2
tar jxvf image
wget http
These binary images can now be converted into a single image file for QEMU emulation. The above files are pretty old, but never the less are good enough to validate a rev C3 board. xM is untested.

./bb_nandflash.sh x-load.bin.ift beagle-nand.bin x-loader ./bb_nandflash.sh u-boot.bin beagle-nand.bin u-boot ./bb_nandflash.sh uImage beagle-nand.bin kernel ./bb_nandflash.sh rd-ext2-8M.bin  beagle-nand.bin  rootfs ./bb_nandflash_ecc beagle-nand.bin 0x0 0xe80000

Now there should be a bootable (emulatable) image called beagle-nand.bin in the folder. This image shall start the stage I bootloader followed by the stage II bootloader and finally the linux kernel (not vmlarix). Test this image usign qemu by running the following commands

qemu-system-arm -M beagle -mtdblock beagle-nand.bin

This should pop up a window with the beagle board splash screen -

Splash Screen - Ctrl + Alt + 1

To access the qemu monitor, hit Ctrl + Alt + 2. The Serial terminal of the running program may be accessed by hitting Ctrl + Alt + 3. And the splash screen can be reverted back to by Ctrl + Alt + 1.

QEMU Monitor - Ctrl + Alt + 2

Serial Terminal - Ctrl + Alt + 3

If all the above, works, you can be reasonably sure that you have a same emulation environment. The steps mentioned so far and the screen shots shown above do not load the linux kernel. For more details about loading and emulating the linux kernel, see the qemu-omap3 wiki and the elinux wiki pages.

To execute the vmlarix kernel, one would have to attach a ramdisk containing the appropriate image. However, until the stage II boot loader is working, one can circumvent the problem by compiling the vmlarix kernel to have the text section and entry point at 0x80008000. Thus loading the vmlarix kernel as stage II instead of stage III.

Bharath Bhushan Lohray,
Sep 8, 2011, 7:31 PM
Bharath Bhushan Lohray,
Apr 1, 2011, 12:38 PM
Bharath Bhushan Lohray,
Sep 8, 2011, 7:39 PM