Full Emulation
Full emulation means running the entire Mamona image with help of QEMU. Running with full emulation can be useful if you want to try Mamona or just to test your application on it.
Dependencies
- QEMU at least from revision 4980 (qemu-svn)
- TUN/TAP enabled kernel if you want network inside QEMU
- Diablo's FIASCO image to extract the kernel and initfs
- Mamona rootfs image that you can create by the SDK or just grab from our pre-builted images
Setting up your environment
QEMU
Basically the first thing to do is to build the correct version of QEMU.
You can choose to build it by hand or build it with Mamona BitBake/OE environment.
Manually building QEMU
To access the QEMU emulation display you need SDL support, so the first thing to do is to install libsdl at your machine. Also remember that to build QEMU you need gcc-3.x, as it can't compile with >= gcc-4.x.
- Get the code from SVN repository:
$ svn co -r 4980 svn://svn.savannah.nongnu.org/qemu/trunk qemu
- Patching QEMU so you can use DIABLO's image:
- Get the patch.
- Apply it
$ cd qemu $ patch -p0 < 01_diablo_partition_fix.patch
- Compiling QEMU:
$ ./configure --prefix=<path/your/qemu> --enable-system $ make $ make install
Building QEMU with Mamona
If you already have Mamona dev environment, you can just build qemu-native to compile QEMU.
- Compiling QEMU:
$ bitbake qemu-native
After compiling QEMU you can find it's binaries at ${MAMONA_HOME}/tmp/${MAMONA_BRANCH}/${MAMONA_MACHINE}/staging/i686-linux/bin/qemu-system-arm.
Getting Diablo's FIASCO image
As Mamona provides only the rootfs for the tablets devices (basically because some proprietary parts, see FAQ for more info), you have to get both kernel and initfs from Diablo's FIASCO image.
- Download the latest Nokia N800 Maemo's FIASCO image from http://tablets-dev.nokia.com/nokia_N800.php
- Note that you need a valid Nokia N800 serial number to be able to download the image.
- Download Nokia's flasher version 3 (we're unable to extract the files from Diablo FIASCO image with 0xFFFF, until there you need to use Nokia proprietary flasher tool)
- Unpack Diablo's FIASCO image:
$ ./flasher-3.0-static -u -F RX-34_DIABLO_4.2008.23-14_PR_COMBINED_MR0_ARM.bin flasher v0.9.0 (Jan 19 2007) SW version in image: RX-34_DIABLO_4.2008.23-14_PR_MR0 Image 'kernel', size 1536512 bytes Version 2.6.21-200823maemo3 Image 'initfs', size 2286848 bytes Version 0.95.16-200823maemo2 Image 'rootfs', size 137756672 bytes Version RX-34+RX-44+RX-48_DIABLO_4.2008.23-14_PR_MR0 Image '2nd', size 8192 bytes Valid for RX-34: 1301, 1302, 1501, 1502, 1503, 1504, 1601, 1602 Version 1.1.16-200823maemo1 Image 'xloader', size 9088 bytes Valid for RX-34: 1301, 1302, 1501, 1502, 1503, 1504, 1601, 1602 Version 1.1.16-200823maemo1 Image 'secondary', size 99072 bytes Valid for RX-34: 1301, 1302, 1501, 1502, 1503, 1504, 1601, 1602 Version 1.1.16-200823maemo1 Unpacking kernel image to file 'zImage'... Unpacking initfs image to file 'initfs.jffs2'... Unpacking rootfs image to file 'rootfs.jffs2'... Unpacking 2nd image to file '2nd.bin-RX-34:1301,1302,1501,1502,1503,1504,1601,1602'... Unpacking xloader image to file 'xloader.bin-RX-34:1301,1302,1501,1502,1503,1504,1601,1602'... Unpacking secondary image to file 'secondary.bin-RX-34:1301,1302,1501,1502,1503,1504,1601,1602'...
Copying config.mtd from your device
The first thing you need to do is to set the RD flag no-lifeguard-reset:
$ ./flasher-3.0-static --set-rd-flags=no-lifeguard-reset
After that you just need to login into your device and get the content of /dev/mtd1ro:
Nokia-N800-51-3:~# cat /dev/mtd1ro > config.mtd
Generating your NAND image
We provide some scripts to help you creating your final NAND image and booting QEMU with the correct parameters, use them to make your life easier :-).
- Cloning tools.git repository (you don't need this step if you installed Mamona's BitBake/OE environment):
$ git clone http://dev.openbossa.org/mamona/tools.git
- Creating your NAND image
tools.git/qemu $ ./mamona-qemu-flasher /tmp/diablo/initfs.jffs2 mamona.qemuflash initfs foo 0+0 records in 0+0 records out 0 bytes (0 B) copied, 1.3201e-05 s, 0.0 kB/s 1116+1 records in 1116+1 records out 2286848 bytes (2.3 MB) copied, 0.0167445 s, 137 MB/s tools.git/qemu $ ./mamona-qemu-flasher /tmp/config.mtd mamona.qemuflash config 192+0 records in 192+0 records out 393216 bytes (393 kB) copied, 0.00123046 s, 320 MB/s tools.git/qemu $ ./mamona-qemu-flasher /tmp/mamona-n800-rootfs.jffs2 mamona.qemuflash rootfs 19968+0 records in 19968+0 records out 40894464 bytes (41 MB) copied, 0.442141 s, 92.5 MB/s
Starting QEMU
- To start QEMU:
$ ./qemu-system-arm -kernel /tmp/diablo/zImage -M n800 -mtdblock mamona.qemuflash -m 130 -append "root=/dev/mtdblock3 rootfstype=jffs2"
- Starting QEMU with Mamona's qemu script (only if you have the dev environment):
(m:nokia800) tools.git/qemu $ ./mamona-qemu n800 /tmp/diablo/zImage mamona.qemuflash
Note: Full emulation is not fully working at the moment, as Qemu is not that stable. Feel free to try and experiment it, but probably we'll not be able to help you much. In any case, try to contact us at #mamona (freenode) if you have any problem.
Screenshots
- Qemu booting:
- Mamona with full emulation:
TODO
- Try to work with 0xFFFF
- Explain what need to be done with tun/tap before running qemu


