Using QEMU with MokoMakefile

From Openmoko

Revision as of 18:39, 17 September 2007 by BernhardKaindl (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MokoMakefile has support for automatically building, flashing, and running OpenMoko under QEMU using qemu-neo1973, a fork of qemu which adds simulation of almost all Neo1973 devices in order allow testing OpenMoko images in a virtual environment.

Note: The talk page of MokoMakefile may alsso contain some valuable hints regarding compiling and using QEMU for OpenMoko, including distribution specific issues and workarounds.

Contents

Installation of qemu build requisites

  • gcc 3.4 or 3.3: You need gcc-3.x for building qemu. If you have no precompiled gcc-3.x packages, you need to compile it. [1]
  • lynx
  • netpbm
  • SDL-devel
  • mkdosfs (from dosfstools)
Debian 4.0 and Ubuntu 7.04
 sudo apt-get install gcc-3.4 lynx netpbm libsdl1.2-dev dosfstools
SUSE Linux / openSUSE

get gcc33 and cpp33 for SUSE Linux 10.1, openSUSE 10.2 and openSUSE Factory and install both rpms at once using:

rpm -Uhv cpp33-*.rpm gcc33-*.rpm

Install the packages lynx, netbpm, SDL-devel and dosfstools e.g. using yast, apt, or smart.

On 10.1 and 10.2, apply the workaround for qemu-neu1973 USB compilation.

Compilation and use

Create a new directory and download the Moko Makefile to it:

 mkdir openmoko
 cd openmoko
 wget http://www.rwhitby.net/files/openmoko/Makefile

make qemu” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).

  • make run-qemu - restarts qemu with the currently flashed OpenMoko images and current virtual SD card.
  • make run-qemu-snapshot - does the same but starts qemu with -snapshot which causes QEMU to write all changes to temporary files instead of flash and disk image files.
    This has the benefit that the virtual neu1973 is not changed, but that also all changes make run-qemu-snapshot in parallel without creating incoherent flash and SD card state as it would occur when one (or even more) instances would update disk or flash images while other instances do not expect this to happen underneath. You can however force the write back by pressing C-a s in the QEMU window which may be useful to update the flash and disk images in the last qemu instance which is running to preserve the changes, after all other instances are terminated.

You may also use:

  • make download-images - to download the latest official images
  • make flash-qemu-official - to flash those images
  • make flash-qemu-local - to flash your latest locally built images, which can then be followed by
  • make qemu-copy-package-foo - copies foo.ipk to the virtual SD card, which allows you to use ipkg install /media/mmcblk0/file inside the running OpenMoko to install the package.

If you want to calibrate your screen, look at [2]

For detailed information on advanced usage of qemu-neo1973 see also: OpenMoko under QEMU

Personal tools

MokoMakefile has support for automatically building, flashing, and running OpenMoko under QEMU using qemu-neo1973, a fork of qemu which adds simulation of almost all Neo1973 devices in order allow testing OpenMoko images in a virtual environment.

Note: The talk page of MokoMakefile may alsso contain some valuable hints regarding compiling and using QEMU for OpenMoko, including distribution specific issues and workarounds.

Installation of qemu build requisites

  • gcc 3.4 or 3.3: You need gcc-3.x for building qemu. If you have no precompiled gcc-3.x packages, you need to compile it. [1]
  • lynx
  • netpbm
  • SDL-devel
  • mkdosfs (from dosfstools)
Debian 4.0 and Ubuntu 7.04
 sudo apt-get install gcc-3.4 lynx netpbm libsdl1.2-dev dosfstools
SUSE Linux / openSUSE

get gcc33 and cpp33 for SUSE Linux 10.1, openSUSE 10.2 and openSUSE Factory and install both rpms at once using:

rpm -Uhv cpp33-*.rpm gcc33-*.rpm

Install the packages lynx, netbpm, SDL-devel and dosfstools e.g. using yast, apt, or smart.

On 10.1 and 10.2, apply the workaround for qemu-neu1973 USB compilation.

Compilation and use

Create a new directory and download the Moko Makefile to it:

 mkdir openmoko
 cd openmoko
 wget http://www.rwhitby.net/files/openmoko/Makefile

make qemu” will build qemu-neo1973, download the latest official OpenMoko images, flash the images into the virtual NAND flash, create an empty virtual SD card, and run the emulator (you still need to install the makefile as mentioned above, however).

  • make run-qemu - restarts qemu with the currently flashed OpenMoko images and current virtual SD card.
  • make run-qemu-snapshot - does the same but starts qemu with -snapshot which causes QEMU to write all changes to temporary files instead of flash and disk image files.
    This has the benefit that the virtual neu1973 is not changed, but that also all changes make run-qemu-snapshot in parallel without creating incoherent flash and SD card state as it would occur when one (or even more) instances would update disk or flash images while other instances do not expect this to happen underneath. You can however force the write back by pressing C-a s in the QEMU window which may be useful to update the flash and disk images in the last qemu instance which is running to preserve the changes, after all other instances are terminated.

You may also use:

  • make download-images - to download the latest official images
  • make flash-qemu-official - to flash those images
  • make flash-qemu-local - to flash your latest locally built images, which can then be followed by
  • make qemu-copy-package-foo - copies foo.ipk to the virtual SD card, which allows you to use ipkg install /media/mmcblk0/file inside the running OpenMoko to install the package.

If you want to calibrate your screen, look at [2]

For detailed information on advanced usage of qemu-neo1973 see also: OpenMoko under QEMU