Openmoko under QEMU on Gentoo
Revision as of 08:05, 23 May 2008
This page is aimed at Gentoo users new to the OpenMoko project who're trying to get the QEMU emulator up and running and do some development for the project. The basic process to do this is described at OpenMoko_under_QEMU however there are a number of Gentoo specific steps, not all of which are immediately obvious. This page obviously draws heavily from the main OpenMoko_under_QEMU page and you should check that page for most of the details as it is more likely to be updated
The ultimate aim of this article is to get a good Gentoo process set out which can then be used as the basis for an ebuild. Ideally this would incorporate the Neo1973 qemu files into the normal Gentoo qemu build.
Using Manual Setup
Fetch the source from Subversion as described in the main article. Before performing the configure step we need to emerge a few dependencies.
emerge -va libsdl lynx netpbm
(more dependencies to be added here)
Unfortunately qemu won't compile with gcc4.x so we need to temporarily switch to a gcc3.4 compiler. You can check the available gcc installs by using gcc-config -l. If the output lists a valid gcc3.4 compiler then you can skip the next install, but most people will probably see output similar to this:
# gcc-config -l  x86_64-pc-linux-gnu-4.1.2 *
If you don't have an entry in the list for gcc3.4 then you'll have to emerge the compiler using:
# emerge -va =sys-devel/gcc-3.4.6-r2 ... ... # gcc-config -l  x86_64-pc-linux-gnu-3.4.6  x86_64-pc-linux-gnu-3.4.6-hardened  x86_64-pc-linux-gnu-3.4.6-hardenednopie  x86_64-pc-linux-gnu-3.4.6-hardenednopiessp  x86_64-pc-linux-gnu-3.4.6-hardenednossp  x86_64-pc-linux-gnu-4.1.2 *
Once you've got a valid install of gcc3.4 activate it with the following:
# gcc-config x86_64-pc-linux-gnu-3.4.6 # source /etc/profile
Your system will now be using the gcc 3.4.6 compiler. Its probably best if you don't emerge anything else until you're done compiling qemu and can set it back.
Now continue with the ./configure and make sections from the main article, then reset your system to the previous gcc compiler using the gcc-config command again.
# ./configure --target-list=arm-softmmu # GCC 3.x will be required, see --cc= # make # gcc-config x86_64-pc-linux-gnu-4.1.2 # source /etc/profile
Once you've completed the rest of the instructions set out in the main article you should have a qemu Neo1973 emulator which you can run with something similar to: arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor -snapshot -usbdevice keyboard