Changes to Emulating a Nokia N800 with QEMU between r3 and r38

'''Safe Testing Platform for the Nokia N800'''

The OpenHanded Project [http://www.o-hand.com/] has created patches against [QEMU] to emulate a [Nokia N800] on your desktop PC.  Their instructions are geared towards using their platform ("Poky") on the emulated system, but with some work it should be possible to use the Nokia N800 software on the emulated system.  Here's how to do it:
OpenedHand's [http://www.o-hand.com/] "Poky Linux" [http://www.pokylinux.org/] Project  has created patches against [QEMU] to emulate a [Nokia N800] and [Nokia N810] on your desktop PC.  These patches are now part of [QEMU].  Their instructions are geared towards using their platform ("Poky") on the emulated system, but with some work it should be possible to use the [Nokia N800]/[Nokia N810] software on the emulated system.  Here's how to do it:
   1. Create a scratch area to work in
   11. `$ mkdir ~/tmp/qemu-n800`
   1. Download the QEMU CVS tree from 2008-03-07 into the scratch area
   1. Download the QEMU Subversion repository from 2009-03-03 (revision 6679) into the scratch area
   11. `$ cd ~/tmp/qemu-n800/`
   11. `$ cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/qemu checkout -D 2008-03-07 qemu`
   11. `$ mv qemu/ qemu-20080307`
   1. Download the OpenHanded Project's patches against QEMU CVS 2008-03-07
   11. `$ svn co -r 6679 http://svn.savannah.gnu.org/svn/qemu/trunk qemu-svnr6679`
   1. Compile QEMU
   11. `$ cd ~/tmp/qemu-n800/` -->    11. `$ cd ~/tmp/qemu-n800/qemu-svnr6679/`
   11. `$ svn checkout 'http://svn.o-hand.com/repos/poky/trunk/meta/packages/qemu/qemu-0.9.1+cvs20080307/' qemu-20080307-patches-poky`
   1. Apply the patches to the QEMU source tree
   11. `$ cd ~/tmp/qemu-n800/qemu-20080307-patches/poky/`
   11. `$ cat series | while read patchcmd; do patch -d ~/tmp/qemu-n800/qemu-20080307 ${patchcmd}; done`
   1. Compile QEMU
   11. `$ cd ~/tmp/qemu-n800/qemu-20080307/`
   11. `$ ./configure --prefix=${HOME}/tmp/qemu-n800/instroot --disable-linux-user --enable-system --disable-darwin-user --disable-werror --static`
   11. `$ ./configure --prefix=${HOME}/tmp/qemu-n800/instroot --disable-linux-user --enable-system --disable-darwin-user --disable-kqemu --target-list=arm-softmmu`
   11. `$ make`
   11. `$ make install`
   1. Download the Nokia N800 Maemo Firmware
   11. Go to http://maemo.org/community/wiki/HOWTO_FlashLatestNokiaImageWithLinux/
   11. Download the OS for the Nokia N800 by clicking on the appropriate link, probably something like "IT OS Software Edition 2008 (version 2.2007.51-3)"
   111. Note that you may need a Nokia N800 serial number for this -- if you don't have a Nokia N800, now might be a good time to get one.
   11. Save the file to `~/tmp/qemu-n800/`
   11. I will assume that the file is called "`RX-34_2008SE_2.2007.51-3_PR_COMBINED_MR0_ARM.bin`"
   1. Download the Nokia Nseries Firmware Flashing Tool version 3
   11. Download the appropriate version for your operating system from: http://tablets-dev.nokia.com/d3.php
   11. Save the file to `~/tmp/qemu-n800/`
   11. I will assume that the file is called "`flasher-3.0-static`"
   1. Make the Firmware Flashing Tool executable
   11. `$ chmod +x ~/tmp/qemu-n800/flasher-3.0-static`
   1. Unpack the Nokia N800 OS2008 Firmware
   11. `$ cd ~/tmp/qemu-n800/`
   11. `$ mkdir os2008`
   11. `$ cd os2008/`
   11. `$ ../flasher-3.0-static -u -F ../RX-34_2008SE_2.2007.51-3_PR_COMBINED_MR0_ARM.bin`
   1. Download the "Poky Linux" Project's Flash Filesystem Tool
   11. `$ cd ~/tmp/qemu-n800/`
   11. `$ svn cat http://svn.o-hand.com/repos/poky/trunk/scripts/poky-nokia800-flashutil > poky-nokia800-flashutil`
   11. `$ chmod +x poky-nokia800-flashutil`
   1. Extract the "config" partition from your Nokia N800
   11. `$ cd ~/tmp/qemu-n800/`
   11. `$ ssh root@nokia-n800 cat /dev/mtd1ro > config.mtd`
   1. Use the "Poky Linux" Project's Flash Filesystem Tool to create a filesytem for the emulated system (these directions adapted from Marcin Juszkiewicz's instructions [http://blog.haerwu.biz/2008/04/11/nokia-n800-emulation/])
   11. `$ cd ~/tmp/qemu-n800/`
   11. `$ ./poky-nokia800-flashutil os2008/initfs.jffs2 qemu-n800.img initfs`
   11. `$ ./poky-nokia800-flashutil config.mtd qemu-n800.img config`
   11. `$ ./poky-nokia800-flashutil os2008/rootfs.jffs2 qemu-n800.img rootfs`
   1. Start QEMU with the appropriate options
   11. `$ cd ~/tmp/qemu-n800/`
   11. `$ ./instroot/bin/qemu-system-arm -kernel os2008/zImage -M n800 -mtdblock qemu-n800.img -m 130 -append "root=/dev/mtdblock3 rootfstype=jffs2"`
   1. Victory !  Well, not quite -- these directions don't actually seem to yield a working system, yet.
(blank line)
[http://www.rkeene.org/projects/info/resources/projects/nokian800/qemu/qemu-nokian800-small.png]
(blank line)
Bigger: http://www.rkeene.org/projects/info/resources/projects/nokian800/qemu/qemu-nokian800.png
----
'''Where Can I Learn More About the "Poky Linux" Project ?'''
(blank line)
The Poky Linux Project's various pages:
   * Their Webpage: http://www.pokylinux.org/
   * ViewCVS (well, really ViewSVN): http://svn.o-hand.com/view/poky/trunk/
   * Subversion: http://svn.o-hand.com/repos/poky/trunk/
(blank line)
They are apparently operated by the OpenedHand Company, whose webpage is:
   * http://www.o-hand.com/
----
'''What about Windows Users ?'''
(blank line)
QEMU compiles under [MinGW32]
----
'''No, Really, What about Windows Users ?'''
(blank line)
Here is a patched QEMU with [Nokia N800] and [Nokia N810] support for Win32: http://www.rkeene.org/projects/info/resources/projects/nokian800/qemu/qemu-svnr6679-win32-nokian8x0.zip .
(blank line)
Here's how I compiled it (cross-compiled under Linux using [MinGW32]):
   1. Apply the following patch to the "`configure`" script: [http://www.rkeene.org/projects/info/resources/projects/nokian800/qemu/qemu-svnr6679-configure.patch]
   1. Apply the following patch to the file "`qemu-sockets.c`": [http://www.rkeene.org/projects/info/resources/projects/nokian800/qemu/qemu-svnr6679-qemu-sockets.patch]
   1. `$ sdl_config='/home/rkeene/root/windows-i386/bin/sdl-config' CFLAGS='-I/home/rkeene/root/windows-i386/include' LDFLAGS='-L/home/rkeene/root/windows-i386/lib' ./configure --prefix=${HOME}/tmp/qemu-n800/qemu-svnr6679-win32-nokian800 --disable-linux-user --enable-system --disable-darwin-user --disable-kqemu --disable-vnc-tls --cpu=i386 --cross-prefix=i586-mingw32msvc- --disable-aio --target-list=arm-softmmu`
   1. `$ make`
   1. `$ make install`
You will still need to figure out to extract the Nokia N800 firmware, and create the MTD block device contents.  Good luck!
(blank line)
Here it is working under Windows XP Service Pack 2 running in QEMU on Linux:
(blank line)
[http://www.rkeene.org/projects/info/resources/projects/nokian800/qemu/qemu-win32-qemu-nokian800-2-small.png]
(blank line)
Bigger: http://www.rkeene.org/projects/info/resources/projects/nokian800/qemu/qemu-win32-qemu-nokian800-2.png

Legend

     Only in r3
     Only in r38
     -->      Modified slightly between r3 and r38