Automatic emulation in Ubuntu

From Openmoko

(Difference between revisions)
Jump to: navigation, search
 
(9 intermediate revisions by 5 users not shown)
Line 152: Line 152:
 
--[[User:Cweise|moerkby]] 11:00, 9 October 2008 (UTC)
 
--[[User:Cweise|moerkby]] 11:00, 9 October 2008 (UTC)
  
== Problems ==
 
If you have any problems, just add it here<br>
 
--[[User:Twistedclone|Twistedclone]]
 
  
OS: Ubuntu 8.04
+
=== Ubuntu Karmic (9.10) with gcc 4.4.1 ===
I run the following sequence of commands to run my QEMU
+
Thanks for this page, I could bring up qemu on Ubuntu. I had to do the following changes however:
 +
* Apply the qemu-cvs.patch from http://bugs.gentoo.org/show_bug.cgi?id=160627 on qemu-neo1973 dir (in openmoko/trunk/src/host)
 +
* Remove the check for GCC 3.x in the moko makefile (i.e, add --disable-gcc-check as suggested)
 +
* The values of wildcards in openmoko/trunk/src/host/qemu-neo1973/openmoko/env didn't work for me, I changed the following variables:
 
<pre>
 
<pre>
$ svn checkout https://svn.openmoko.org/trunk/src/host/qemu-neo1973
+
##; kernel_wildcard="testing-om-gta01-*.uImage.bin"
$ cd qemu-neo1973
+
##; rootfs_wildcard="testing-om-gta01-*.rootfs.jffs2"
$ sudo aptitude install gcc-3.4 libsdl1.2-dev lynx netpbm
+
##; uboot_wildcard="gta01bv4-u-boot.bin"
$ ./configure --target-list=arm-softmmu --cc=/usr/bin/gcc-3.4
+
$ make
+
$ openmoko/download.sh
+
$ openmoko/flash.sh
+
$ arm-softmmu/qemu-system-arm -M gta01 -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor<br>
+
</pre>
+
Emulator appears with Boot menu.<br/>
+
While Booting it get hanged out with the following errors
+
<pre>
+
_______________________Errors or Emulator Screen_______________
+
sc32410-sdi sc32410-sdi : CMD[FAIL(-100)] #2 op:CMD8
+
error: command timeout
+
...
+
...
+
...
+
Freeing init memory: 128kb
+
/bin/sh: can't access tty; Job Control Tunned off
+
/ #JFFS2 notice: (227) check_node_data: wrong data CRC in data node at 0x00899b4c: read d5ebdb50 calculated 0x880615c2
+
JFFS2 warning: (227) jffs2_do_read_inode_internal: Truncating into #1111 to 71415
+
56 bytes failed because it only had 2510848 bytes to start with <br>
+
  
_______________Errors on Terminal_______________
+
kernel_wildcard="uImage-2.6.24+git20080424-r0-om-gta01.bin"
qasim@qasim-desktop:~/openmoko/qemu-neo1973$ arm-softmmu/qemu-system-arm -M gta01 -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor
+
rootfs_wildcard="Openmoko-scaredycat-openmoko-devel-image-glibc-ipk-P1-Snapshot-20080710-om-gta01.rootfs.jffs2"
neo_gsm_switch: GSM disabled.
+
uboot_wildcard="u-boot-gta01bv3-1.3.1+svnr4297+gitb29661fc1151077776454288051bc9a488351ce8-r3.bin"
pcf_write: charging in Qualification Mode.
+
pcf_write: charge voltage 4.20V.
+
neo_lcd_rst_switch: LCD reset.
+
jbt6k74_command: Display on.
+
neo_vib_switch: Buzz, buzz.
+
neo_vib_switch: Vibrator stopped.
+
neo_bl_switch: LCD Backlight now on.
+
s3c_timers_write: Bad register 0x40
+
neo_bl_intensity: LCD Backlight now at 20/64.
+
s3c_adc_write: Bad register 0x8
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
s3c_mmci_writew: Bad register 0x38
+
neo_bl_intensity: LCD Backlight now at 0/64.
+
_____________________________________________
+
 
</pre>
 
</pre>
Does anyone has any idea how to fix this up?
 
  
 
+
I got the values by manually browsing the site: http://buildhost.automated.it/OM2007.2 and choosing the seemingly recent ones..
 
+
   
After issuing the command 'make qemu' in Gutsy, the installation eventually borks with
+
--[[User:Karthickgururaj|Karthickgururaj]] 13:55, 15 January 2010 (UTC)
<pre>
+
make[2]: Leaving directory `/usr/local/src/openmoko/build/qemu/arm-softmmu'
+
make[1]: Leaving directory `/usr/local/src/openmoko/build/qemu'
+
[ -e images/openmoko ] || mkdir -p images/openmoko
+
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
+
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
+
Retrieving available builds list...
+
Kernel is... not found
+
make: *** [download-images] Error 255
+
</pre>
+
[[User:BioGeek|BioGeek]] 02:03, 27 March 2008 (CET)
+
 
+
Do you still have the problem?
+
 
+
[[User:Dolfje|Dolfje]] 20:54, 9 April 2008 (CEST)
+
 
+
I tested this today (uImage-2.6.24+svnr4301-r4251-r5-om-gta01.bin) on '''hardy'''. Qemu doesn't compile with gcc4 you need:
+
sudo aptitude install gcc-3.4
+
After the init process started, became the emulation extremely slow. It takes more than 15 minutes
+
to boot the GUI on 2GHz CPU and you have to klick & hold the mouse several seconds to see
+
any visual response. It would be great if there was a easy way to get a shell,
+
i.e. why the serial port (ctrl+shift-3) doesn't have a getty & co attached?<br />
+
Can anybody confirm this?
+
--[[User:Captn|Captn]] 12:29, 18 April 2008 (CEST)
+
 
+
 
+
Hi, just to tell that the ''Install ipkg package'' part is not effective since there is no room to install the .ipk on the QEmu (say ROM image) device.
+
 
+
Have any idea on how to get over it or to enable the automatic memory allocation on QEmu if allowed?
+
 
+
--[[User:VdeGrandpré|VdeGrandpré]] 17:37, 12 mai 2008 (EST)
+
 
+
I have compiled the Qemu source just fine on Ubuntu Hardy, but when the emulator started it showed up with an unusual QT theme. After the nice picture with the two boots there appeared a message line "No network" in the middle of the screen and 4 icons (cellphone, Q, star and lock). The buttons below the icons are unresponsive. They show a change in the background color when I click them with the mouse, but then nothing happens. Even if I press them for several seconds as noted above. Has the Openmoko theme been accidentally replaced by a non-working QT theme or did I configure something wrong on my end?
+
 
+
Thomas
+
 
+
--[[User:Xaos|Xaos]] 15:06, July 7th, 2008 (CST)
+
 
+
Thomas, I got the same thing when I tried.  On the #openmoko IRC channel, lindi and I (with help) got this to work:
+
 
+
1. After building qemu with "make qemu", close the emulator and:
+
 
+
2. modify the file: build/qemu/openmoko/env as follows (you may need to adjust these values as time goes by for different images):
+
kernel_wildcard="testing-om-gta01-20081008.uImage.bin"
+
# rootfs_wildcard="Open?oko-openmoko-*image*-om-gta01.rootfs.jffs2"
+
rootfs_wildcard="testing-om-gta01-20081008.rootfs.jffs2"
+
uboot_wildcard="gta01bv4-u-boot.bin"
+
#download_dir="http://buildhost.openmoko.org/distro/unstable/Neo1973/deploy/glibc/images/neo1973/"
+
download_dir="http://downloads.openmoko.org/distro/"
+
 
+
3. Download the above .jffs2 file (build the URL with the download_dir and the rootfs_wildcard values) to images/openmoko/
+
 
+
4. run "make flash-qemu-official"
+
 
+
5. run "make run-qemu-snapshot"  or "make run-qemu"
+
 
+
 
+
--[[User:Schafdog|schafdog]] 15:10, July 1th 2008 (CST)
+
 
+
Built succesfully on a Fedora Linux 9. Trying to run on the linux box but with the XServer on OS X. It doesn't react to any keypress. Now tried it locally. The keypress works, but stil having some issues to get openmoko up.
+
 
+
 
+
 
+
Ubuntu 8.04 Hardy Heron, it was also necessary to "apt-get install libgnutls-dev".
+
--[[User:Newkirk|Newkirk]] 20:37, 20 July 2008 (UTC)
+
 
+
When I try to download .jffs2 file, it's write "404. File is not found"
+
 
+
This is not look like as Openmoko on screens:
+
 
+
[[Image:Openmoko2.png|thumb|Wrong image?|left]]
+
<br style="clear:both"/>
+
[[User:Robotex|Robotex]] 02:43, 7 August 2008 (UTC)
+
 
+
 
+
--[[User:David]] 12:57, 28 August 2008
+
I have problems with the step no. 3:
+
3. Download the above .jffs2 file (build the URL with the download_dir and the rootfs_wildcard values) to images/openmoko/
+
the webpages:
+
-http://downloads.openmoko.org/distro/releases/
+
-[http://buildhost.openmoko.org/daily/]
+
doesn't exist anymore..
+
 
+
ditto, still. can I just make all or sumpin and make it locally from source?
+
 
+
 
+
--[[User:Wolfsolver]]
+
Hi all,
+
I found the file on http://buildhost.automated.it/OM2007.2/, so use following lines in file build/qemu/openmoko/env
+
rootfs_wildcard="Openmoko-openmoko-devel-image-glibc-ipk-P1-Snapshot-20080721-om-gta01.rootfs.jffs2"
+
download_dir="http://buildhost.automated.it/OM2007.2/"
+
and all works....
+
 
+
 
+
--[[User:Joe]]
+
Allso tried to run the makefile. After fixing the problem with the download_dir (by setting it to http://downloads.openmoko.org/distro/testing/) and removing the _dev parameter from the calls to "most_recent" and "download" methods the make script finishes successfully.
+
However, there seems to be no working kernel installed on the nand. Every time I select boot from the menu, it says
+
<pre>
+
## Booting kernel from Legacy Image at 30100000 ...
+
  Image Name:  openmoko/2.6.28-oe1+gitr34240a1c
+
  Created:      2009-02-08 19:37:42 UTC
+
  Image Type:  ARM Linux Kernel Image (uncompressed)
+
  Data Size:    1980124 Bytes =  1.9 MB
+
  Load Address: 30008000
+
  Entry Point:  30008000
+
  Verifying Checksum ... OK
+
  Loading Kernel Image ... OK
+
OK
+
ERROR: image overwritten - must RESET the board to recover.
+
</pre>
+
before it reboots my virtual phone.
+
I also tried to nand write.e different kernel images. None of them worked. Any help apprechiated.
+
-- 14:51, 21 February 2009 (UTC)
+
 
+
--[[User:bimo]] 15 April 2009
+
I have similar problem with Twistedclone, after I run "make qemu"
+
 
+
<pre>
+
make[2]: Leaving directory `/home/bhe/openmoko/build/qemu/arm-softmmu'
+
make[1]: Leaving directory `/home/bhe/openmoko/build/qemu'
+
[ -e images/openmoko ] || mkdir -p images/openmoko
+
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
+
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
+
    Retrieving available builds list...
+
    Trying alternative sources
+
    Kernel is... not found
+
make: *** [download-images] Error 255
+
</pre>
+
 
+
Does anyone has any idea how to fix this up?
+
FYI, I'm running Ubuntu 8.10 as a guest OS on my virtualbox, Mac OS X as the host.
+
 
+
--[[User:Hackedd]] 15 June 2009
+
I have excactly the same problem as bimo reported 15 April 2009, except I'm running Ubuntu directly, not in a VM.
+
Any thoughts on how to fix this?
+
 
+
--[[User:bjneuman]] 1 July 2009 Problem still exists. Ubuntu 9.04
+
 
+
<pre>
+
make[2]: Leaving directory `/home/ben/projects/openmoko/build/qemu/arm-softmmu'
+
make[1]: Leaving directory `/home/ben/projects/openmoko/build/qemu'
+
[ -e images/openmoko ] || mkdir -p images/openmoko
+
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
+
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
+
    Retrieving available builds list...
+
    Trying alternative sources
+
    Kernel is... not found
+
make: *** [download-images] Error 255
+
</pre>
+
 
+
--[[User:sriranjan]] 6 July 2009 Problem still exists. Ubuntu 8.10
+
 
+
<pre>
+
make[2]: Leaving directory `/home/ben/projects/openmoko/build/qemu/arm-softmmu'
+
make[1]: Leaving directory `/home/ben/projects/openmoko/build/qemu'
+
[ -e images/openmoko ] || mkdir -p images/openmoko
+
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
+
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
+
    Retrieving available builds list...
+
    Trying alternative sources
+
    Kernel is... not found
+
make: *** [download-images] Error 255
+
</pre>
+
 
+
Could some one please suggest how to solve this?
+
 
+
--[[User:Yewang|Yewang]] 13:09, 21 July 2009 (UTC) I'm having the same problem as the above four users. Is it because the online resource that is trying to download is not available any more?
+
<pre>
+
make[2]: Leaving directory `/home/ye21867/openmoko/build/qemu/arm-softmmu'
+
make[1]: Leaving directory `/home/ye21867/openmoko/build/qemu'
+
[ -e images/openmoko ] || mkdir -p images/openmoko
+
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
+
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
+
    Retrieving available builds list...
+
    Trying alternative sources
+
    Kernel is... not found
+
make: *** [download-images] Error 255
+
</pre>
+
 
+
--[[User:Roelant]] 17:52, 28 July 2009 (UTC) I' m having the same problems as many more of you. It is again the error that is posted by Yewang.
+
 
+
<pre>
+
make[2]: Leaving directory `/home/roelant/openmoko/build/qemu/arm-softmmu'
+
make[1]: Leaving directory `/home/roelant/openmoko/build/qemu'
+
[ -e images/openmoko ] || mkdir -p images/openmoko
+
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
+
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
+
    Retrieving available builds list...
+
    Trying alternative sources
+
    Kernel is... not found
+
make: *** [download-images] Error 255
+
</pre>
+
 
+
-- [[User:Oringo]] Thu Jul 30 20:51:54 UTC 20009 For all users that get the [download-images] Errors. This is what you have to do. Edit build/qemu/openmoko/env (it's a symbolic link to the svn trunk's env file), and make change these lines to the following:
+
 
+
<pre>
+
kernel_wildcard="uImage-*-om-gta01.bin"
+
rootfs_wildcard="*-om-gta01.rootfs.jffs2"
+
uboot_wildcard="u-boot-gta01bv4-*.bin"
+
</pre>
+
  
 
[[Category:Emulation]]
 
[[Category:Emulation]]

Latest revision as of 21:42, 4 March 2010

emulation of Openmoko running on Ubuntu

This is a tutorial for getting an emulation environment on an Ubuntu system.

Contents

[edit] Installation

You have to know that there is a great tool to get it running on a linux system, namely the MokoMakefile. This is a sort of wrapper round several instructions, so it is easy to set up and maintain a development environment. If you build the whole MokoMakefile, you will need approximately 12GB, a swap+ram memory of about 1GB and minimum 5 hours time. But we will only build it for Qemu (the emulator that I will use) and that needs (on my system) only 890mb and a 15 min of your time.

To get it running, you will have to tweak your ubuntu a little bit (This will not damage other programs, everything will work as before).

  • Configure your sources (System -> Administration -> Software Sources) to include:
    • Canonical-supported Open Source software (main)
    • Community-maintained Open Source software (universe)
  • Open your terminal (Applications -> Accessories -> Terminal).
  • Enter following command and select NO when it asks to install dash as /bin/sh (You will have to enter your password)
sudo dpkg-reconfigure dash
  • Install the needed programs on Hardy Heron 8.04 (You will have to enter your password):
sudo apt-get install monotone git-core git-svn git-email \
git-cvs git-arch gitk python-dev ccache m4 sed bison make cvs gawk \
libc6-dev g++ subversion sharutils docbook openjade quilt libmpfr-dev \
libpcre3-dev texinfo texi2html libboost-date-time-dev libboost-filesystem-dev \
libboost-regex-dev libboost-test-dev libboost-dev zlib1g-dev build-essential \
dh-make debhelper devscripts gcc-3.4 lynx netpbm libsdl1.2-dev dosfstools \
help2man python-psyco lynx
  • Looks like for 8.10 libgnutls-dev also needs to be added, when you see vnc compile errors. sudo apt-get install libgnutls-dev
  • For older versions (git-svn git-email git-cvs git-arch gitk are replaced by cogito)
sudo apt-get install monotone git-core cogito python-dev ccache m4 sed bison \
make cvs gawk libc6-dev g++ subversion sharutils docbook openjade quilt \
libmpfr-dev libpcre3-dev texinfo texi2html libboost-date-time-dev \
libboost-filesystem-dev libboost-regex-dev libboost-test-dev libboost-dev \
zlib1g-dev build-essential dh-make debhelper devscripts gcc-3.4 netpbm \
libsdl1.2-dev dosfstools help2man python-psyco lynx


Voila your system is ready to get the install Openmoko.

Now we will install Openmoko in a directory by downloading the MokoMakefile in it and build it.

  • Create a directory and go into the directory:
mkdir openmoko
cd openmoko
  • Get the MokoMakefile (Currently down due to fires in California. Use the link below instead):
wget http://www.rwhitby.net/files/openmoko/Makefile

If that doesn't work, try

wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile
  • Make the MokoMakefile and tell it, you want to install it for qemu:
make qemu

This will download the necessary files of the latest release and build them following the MokoMakefile. After that it will start into the emulator for the first time. Voila you have now successfully installed openmoko onto your ubuntu system.

[edit] Creating a menu item for Openmoko (optional)

You can create a menu item for starting Openmoko by doing the following:

  • Open the terminal (Applications->Accessories->Terminal)
  • Go to the openmoko directory:
cd ~/openmoko
  • open the file moko.sh with gedit:
gedit moko.sh
  • insert the following text into the file:
#!/bin/bash
cd ~/openmoko
make run-qemu
  • Press "save" and close gedit
  • then run the following commands:
chmod +x moko.sh
alacarte
  • and add a menu item with these values:
    • Name: Openmoko
    • Command: ~/openmoko/moko.sh

[edit] Help with running Openmoko in Qemu

If you have created a menu item you can start Openmoko through the applications menu of Ubuntu. If you have not, you can start it by:

  • Open your terminal (Applications->Accessories->Terminal).
  • Go to the directory:
cd openmoko
  • starting with the MokoMakefile
make run-qemu

The first screen of Openmoko will show a nice picture of the Openmoko logo which will be followed almost immediately by the BOOT MENU, this is done by the bootloader.

In the BOOT MENU you can choose different options. To select an option you have to press enter (=aux) and to execute it, hit space (=power). The default selection will boot Openmoko. Thus if the BOOT MENU shows, you just have to hit the space bar and the phone software will load.

While booting Openmoko the progress will be shown in text mode. Depending on your computer's performance it might take a while (some minutes even) to complete the boot. When complete you will see the graphical interface as will be shown on the phone itself (but slightly larger due to the larger pixelsize of your screen).

A few pointers on using Openmoko:

  • You can select the icon that looks like "+" for a list of applications you can run.
  • You can select the icon that looks like "three gears" for a list of applications that are running now. Here you can also terminate unwanted applications when you are unable to do so from within the application itself.
  • You can select the icon that looks like a "house" to get back to the first home screen.
  • The statusbar at the top is always shown and by clicking on the top-left corner you can switch to another application that is already running. The "Home" application is always running and clicking on it will bring you back to the home screen.

See Qemu for more advanced information on running Openmoko in Qemu.

[edit] Installing ipk packages

First you need a xxx.ipk package, see toolchain on how to compile an application for the ARM CPU and create the package.

Note that if at this point you have the Openmoko Qemu running, it is probably wise to terminate it first. Then you can install the xxx.ipk package for access by the Qemu emulator with:

cd openmoko
mkdir -p build/tmp/deploy/glibc/ipk/a
cp xxx.ipk build/tmp/deploy/glibc/ipk/a/xxx_a.ipk
make qemu-copy-package-xxx

Note: for some reason qemu-copy-package-xxx looks for above source file. Maybe this part can be improved, or a different command can overcome the problem of creating this directory.

When above make command was succesful the next time you start Openmoko Qemu, you still need to make the installed application available in the application list. For this you can select from within Openmoko the terminal application (Select icon that looks like "+" for the list of available applicaitons, select "Applications" and select the "Terminal"). In this terminal double-click, so you can type in the commands:

opkg install /media/mmcblk0/xxx_a.ipk
exit

After the "exit" command you should return to the Task list, in which the newly added application should be listed under a name which was choosen when building the ipk package.

[edit] Updating Openmoko

  • Open your terminal (Applications->Accessories->Terminal).
  • Go to the directory:
cd openmoko
  • Update with the MokoMakefile
make qemu

[edit] Configurations/OS

[edit] OS X/Kubuntu

I'm running the Neo-Qemu in the Qtopia-Image in VMWare Fusion on a MacBook Pro (2x2.6GHz, 4GB), so it's an emulator in an emulator. Speed is acceptable. Be sure to look at the end of this page for the right filesystem image to flash. A main point in compiling Neo-Qemu is the gcc 3.x. For some reason it did not install on my Mac, but I think I can live with the emu-in-emu solution for a while.

--moerkby 11:00, 9 October 2008 (UTC)


[edit] Ubuntu Karmic (9.10) with gcc 4.4.1

Thanks for this page, I could bring up qemu on Ubuntu. I had to do the following changes however:

  • Apply the qemu-cvs.patch from http://bugs.gentoo.org/show_bug.cgi?id=160627 on qemu-neo1973 dir (in openmoko/trunk/src/host)
  • Remove the check for GCC 3.x in the moko makefile (i.e, add --disable-gcc-check as suggested)
  • The values of wildcards in openmoko/trunk/src/host/qemu-neo1973/openmoko/env didn't work for me, I changed the following variables:
##; kernel_wildcard="testing-om-gta01-*.uImage.bin"
##; rootfs_wildcard="testing-om-gta01-*.rootfs.jffs2"
##; uboot_wildcard="gta01bv4-u-boot.bin"

kernel_wildcard="uImage-2.6.24+git20080424-r0-om-gta01.bin"
rootfs_wildcard="Openmoko-scaredycat-openmoko-devel-image-glibc-ipk-P1-Snapshot-20080710-om-gta01.rootfs.jffs2"
uboot_wildcard="u-boot-gta01bv3-1.3.1+svnr4297+gitb29661fc1151077776454288051bc9a488351ce8-r3.bin"

I got the values by manually browsing the site: http://buildhost.automated.it/OM2007.2 and choosing the seemingly recent ones..

--Karthickgururaj 13:55, 15 January 2010 (UTC)

Personal tools
emulation of Openmoko running on Ubuntu

This is a tutorial for getting an emulation environment on an Ubuntu system.

Installation

You have to know that there is a great tool to get it running on a linux system, namely the MokoMakefile. This is a sort of wrapper round several instructions, so it is easy to set up and maintain a development environment. If you build the whole MokoMakefile, you will need approximately 12GB, a swap+ram memory of about 1GB and minimum 5 hours time. But we will only build it for Qemu (the emulator that I will use) and that needs (on my system) only 890mb and a 15 min of your time.

To get it running, you will have to tweak your ubuntu a little bit (This will not damage other programs, everything will work as before).

  • Configure your sources (System -> Administration -> Software Sources) to include:
    • Canonical-supported Open Source software (main)
    • Community-maintained Open Source software (universe)
  • Open your terminal (Applications -> Accessories -> Terminal).
  • Enter following command and select NO when it asks to install dash as /bin/sh (You will have to enter your password)
sudo dpkg-reconfigure dash
  • Install the needed programs on Hardy Heron 8.04 (You will have to enter your password):
sudo apt-get install monotone git-core git-svn git-email \
git-cvs git-arch gitk python-dev ccache m4 sed bison make cvs gawk \
libc6-dev g++ subversion sharutils docbook openjade quilt libmpfr-dev \
libpcre3-dev texinfo texi2html libboost-date-time-dev libboost-filesystem-dev \
libboost-regex-dev libboost-test-dev libboost-dev zlib1g-dev build-essential \
dh-make debhelper devscripts gcc-3.4 lynx netpbm libsdl1.2-dev dosfstools \
help2man python-psyco lynx
  • Looks like for 8.10 libgnutls-dev also needs to be added, when you see vnc compile errors. sudo apt-get install libgnutls-dev
  • For older versions (git-svn git-email git-cvs git-arch gitk are replaced by cogito)
sudo apt-get install monotone git-core cogito python-dev ccache m4 sed bison \
make cvs gawk libc6-dev g++ subversion sharutils docbook openjade quilt \
libmpfr-dev libpcre3-dev texinfo texi2html libboost-date-time-dev \
libboost-filesystem-dev libboost-regex-dev libboost-test-dev libboost-dev \
zlib1g-dev build-essential dh-make debhelper devscripts gcc-3.4 netpbm \
libsdl1.2-dev dosfstools help2man python-psyco lynx


Voila your system is ready to get the install Openmoko.

Now we will install Openmoko in a directory by downloading the MokoMakefile in it and build it.

  • Create a directory and go into the directory:
mkdir openmoko
cd openmoko
  • Get the MokoMakefile (Currently down due to fires in California. Use the link below instead):
wget http://www.rwhitby.net/files/openmoko/Makefile

If that doesn't work, try

wget http://svn.projects.openmoko.org/svnroot/mokomakefile/trunk/Makefile
  • Make the MokoMakefile and tell it, you want to install it for qemu:
make qemu

This will download the necessary files of the latest release and build them following the MokoMakefile. After that it will start into the emulator for the first time. Voila you have now successfully installed openmoko onto your ubuntu system.

Creating a menu item for Openmoko (optional)

You can create a menu item for starting Openmoko by doing the following:

  • Open the terminal (Applications->Accessories->Terminal)
  • Go to the openmoko directory:
cd ~/openmoko
  • open the file moko.sh with gedit:
gedit moko.sh
  • insert the following text into the file:
#!/bin/bash
cd ~/openmoko
make run-qemu
  • Press "save" and close gedit
  • then run the following commands:
chmod +x moko.sh
alacarte
  • and add a menu item with these values:
    • Name: Openmoko
    • Command: ~/openmoko/moko.sh

Help with running Openmoko in Qemu

If you have created a menu item you can start Openmoko through the applications menu of Ubuntu. If you have not, you can start it by:

  • Open your terminal (Applications->Accessories->Terminal).
  • Go to the directory:
cd openmoko
  • starting with the MokoMakefile
make run-qemu

The first screen of Openmoko will show a nice picture of the Openmoko logo which will be followed almost immediately by the BOOT MENU, this is done by the bootloader.

In the BOOT MENU you can choose different options. To select an option you have to press enter (=aux) and to execute it, hit space (=power). The default selection will boot Openmoko. Thus if the BOOT MENU shows, you just have to hit the space bar and the phone software will load.

While booting Openmoko the progress will be shown in text mode. Depending on your computer's performance it might take a while (some minutes even) to complete the boot. When complete you will see the graphical interface as will be shown on the phone itself (but slightly larger due to the larger pixelsize of your screen).

A few pointers on using Openmoko:

  • You can select the icon that looks like "+" for a list of applications you can run.
  • You can select the icon that looks like "three gears" for a list of applications that are running now. Here you can also terminate unwanted applications when you are unable to do so from within the application itself.
  • You can select the icon that looks like a "house" to get back to the first home screen.
  • The statusbar at the top is always shown and by clicking on the top-left corner you can switch to another application that is already running. The "Home" application is always running and clicking on it will bring you back to the home screen.

See Qemu for more advanced information on running Openmoko in Qemu.

Installing ipk packages

First you need a xxx.ipk package, see toolchain on how to compile an application for the ARM CPU and create the package.

Note that if at this point you have the Openmoko Qemu running, it is probably wise to terminate it first. Then you can install the xxx.ipk package for access by the Qemu emulator with:

cd openmoko
mkdir -p build/tmp/deploy/glibc/ipk/a
cp xxx.ipk build/tmp/deploy/glibc/ipk/a/xxx_a.ipk
make qemu-copy-package-xxx

Note: for some reason qemu-copy-package-xxx looks for above source file. Maybe this part can be improved, or a different command can overcome the problem of creating this directory.

When above make command was succesful the next time you start Openmoko Qemu, you still need to make the installed application available in the application list. For this you can select from within Openmoko the terminal application (Select icon that looks like "+" for the list of available applicaitons, select "Applications" and select the "Terminal"). In this terminal double-click, so you can type in the commands:

opkg install /media/mmcblk0/xxx_a.ipk
exit

After the "exit" command you should return to the Task list, in which the newly added application should be listed under a name which was choosen when building the ipk package.

Updating Openmoko

  • Open your terminal (Applications->Accessories->Terminal).
  • Go to the directory:
cd openmoko
  • Update with the MokoMakefile
make qemu

Configurations/OS

OS X/Kubuntu

I'm running the Neo-Qemu in the Qtopia-Image in VMWare Fusion on a MacBook Pro (2x2.6GHz, 4GB), so it's an emulator in an emulator. Speed is acceptable. Be sure to look at the end of this page for the right filesystem image to flash. A main point in compiling Neo-Qemu is the gcc 3.x. For some reason it did not install on my Mac, but I think I can live with the emu-in-emu solution for a while.

--moerkby 11:00, 9 October 2008 (UTC)

Problems

If you have any problems, just add it here
--Twistedclone

OS: Ubuntu 8.04 I run the following sequence of commands to run my QEMU

$ svn checkout https://svn.openmoko.org/trunk/src/host/qemu-neo1973
$ cd qemu-neo1973
$ sudo aptitude install gcc-3.4 libsdl1.2-dev lynx netpbm
$ ./configure --target-list=arm-softmmu --cc=/usr/bin/gcc-3.4
$ make
$ openmoko/download.sh
$ openmoko/flash.sh
$ arm-softmmu/qemu-system-arm -M gta01 -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor<br>

Emulator appears with Boot menu.
While Booting it get hanged out with the following errors

_______________________Errors or Emulator Screen_______________
sc32410-sdi sc32410-sdi : CMD[FAIL(-100)] #2 op:CMD8
error: command timeout
...
...
...
Freeing init memory: 128kb
/bin/sh: can't access tty; Job Control Tunned off
/ #JFFS2 notice: (227) check_node_data: wrong data CRC in data node at 0x00899b4c: read d5ebdb50 calculated 0x880615c2
JFFS2 warning: (227) jffs2_do_read_inode_internal: Truncating into #1111 to 71415
56 bytes failed because it only had 2510848 bytes to start with <br>

_______________Errors on Terminal_______________
qasim@qasim-desktop:~/openmoko/qemu-neo1973$ arm-softmmu/qemu-system-arm -M gta01 -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor
neo_gsm_switch: GSM disabled.
pcf_write: charging in Qualification Mode.
pcf_write: charge voltage 4.20V.
neo_lcd_rst_switch: LCD reset.
jbt6k74_command: Display on.
neo_vib_switch: Buzz, buzz.
neo_vib_switch: Vibrator stopped.
neo_bl_switch: LCD Backlight now on.
s3c_timers_write: Bad register 0x40
neo_bl_intensity: LCD Backlight now at 20/64.
s3c_adc_write: Bad register 0x8
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
s3c_mmci_writew: Bad register 0x38
neo_bl_intensity: LCD Backlight now at 0/64.
_____________________________________________

Does anyone has any idea how to fix this up?


After issuing the command 'make qemu' in Gutsy, the installation eventually borks with

make[2]: Leaving directory `/usr/local/src/openmoko/build/qemu/arm-softmmu'
make[1]: Leaving directory `/usr/local/src/openmoko/build/qemu'
[ -e images/openmoko ] || mkdir -p images/openmoko
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
Retrieving available builds list...
Kernel is... not found
make: *** [download-images] Error 255

BioGeek 02:03, 27 March 2008 (CET)

Do you still have the problem?

Dolfje 20:54, 9 April 2008 (CEST)

I tested this today (uImage-2.6.24+svnr4301-r4251-r5-om-gta01.bin) on hardy. Qemu doesn't compile with gcc4 you need: sudo aptitude install gcc-3.4 After the init process started, became the emulation extremely slow. It takes more than 15 minutes to boot the GUI on 2GHz CPU and you have to klick & hold the mouse several seconds to see any visual response. It would be great if there was a easy way to get a shell, i.e. why the serial port (ctrl+shift-3) doesn't have a getty & co attached?
Can anybody confirm this? --Captn 12:29, 18 April 2008 (CEST)


Hi, just to tell that the Install ipkg package part is not effective since there is no room to install the .ipk on the QEmu (say ROM image) device.

Have any idea on how to get over it or to enable the automatic memory allocation on QEmu if allowed?

--VdeGrandpré 17:37, 12 mai 2008 (EST)

I have compiled the Qemu source just fine on Ubuntu Hardy, but when the emulator started it showed up with an unusual QT theme. After the nice picture with the two boots there appeared a message line "No network" in the middle of the screen and 4 icons (cellphone, Q, star and lock). The buttons below the icons are unresponsive. They show a change in the background color when I click them with the mouse, but then nothing happens. Even if I press them for several seconds as noted above. Has the Openmoko theme been accidentally replaced by a non-working QT theme or did I configure something wrong on my end?

Thomas

--Xaos 15:06, July 7th, 2008 (CST)

Thomas, I got the same thing when I tried. On the #openmoko IRC channel, lindi and I (with help) got this to work:

1. After building qemu with "make qemu", close the emulator and:

2. modify the file: build/qemu/openmoko/env as follows (you may need to adjust these values as time goes by for different images): kernel_wildcard="testing-om-gta01-20081008.uImage.bin"

  1. rootfs_wildcard="Open?oko-openmoko-*image*-om-gta01.rootfs.jffs2"

rootfs_wildcard="testing-om-gta01-20081008.rootfs.jffs2" uboot_wildcard="gta01bv4-u-boot.bin"

  1. download_dir="http://buildhost.openmoko.org/distro/unstable/Neo1973/deploy/glibc/images/neo1973/"

download_dir="http://downloads.openmoko.org/distro/"

3. Download the above .jffs2 file (build the URL with the download_dir and the rootfs_wildcard values) to images/openmoko/

4. run "make flash-qemu-official"

5. run "make run-qemu-snapshot" or "make run-qemu"


--schafdog 15:10, July 1th 2008 (CST)

Built succesfully on a Fedora Linux 9. Trying to run on the linux box but with the XServer on OS X. It doesn't react to any keypress. Now tried it locally. The keypress works, but stil having some issues to get openmoko up.


Ubuntu 8.04 Hardy Heron, it was also necessary to "apt-get install libgnutls-dev". --Newkirk 20:37, 20 July 2008 (UTC)

When I try to download .jffs2 file, it's write "404. File is not found"

This is not look like as Openmoko on screens:

Wrong image?


Robotex 02:43, 7 August 2008 (UTC)


--User:David 12:57, 28 August 2008 I have problems with the step no. 3: 3. Download the above .jffs2 file (build the URL with the download_dir and the rootfs_wildcard values) to images/openmoko/ the webpages: -http://downloads.openmoko.org/distro/releases/ -[1] doesn't exist anymore..

ditto, still. can I just make all or sumpin and make it locally from source?


--User:Wolfsolver Hi all, I found the file on http://buildhost.automated.it/OM2007.2/, so use following lines in file build/qemu/openmoko/env rootfs_wildcard="Openmoko-openmoko-devel-image-glibc-ipk-P1-Snapshot-20080721-om-gta01.rootfs.jffs2" download_dir="http://buildhost.automated.it/OM2007.2/" and all works....


--User:Joe Allso tried to run the makefile. After fixing the problem with the download_dir (by setting it to http://downloads.openmoko.org/distro/testing/) and removing the _dev parameter from the calls to "most_recent" and "download" methods the make script finishes successfully. However, there seems to be no working kernel installed on the nand. Every time I select boot from the menu, it says

## Booting kernel from Legacy Image at 30100000 ...
   Image Name:   openmoko/2.6.28-oe1+gitr34240a1c
   Created:      2009-02-08  19:37:42 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1980124 Bytes =  1.9 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK
ERROR: image overwritten - must RESET the board to recover.

before it reboots my virtual phone. I also tried to nand write.e different kernel images. None of them worked. Any help apprechiated. -- 14:51, 21 February 2009 (UTC)

--User:bimo 15 April 2009 I have similar problem with Twistedclone, after I run "make qemu"

make[2]: Leaving directory `/home/bhe/openmoko/build/qemu/arm-softmmu'
make[1]: Leaving directory `/home/bhe/openmoko/build/qemu'
[ -e images/openmoko ] || mkdir -p images/openmoko
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
    Retrieving available builds list...
    Trying alternative sources
    Kernel is... not found
make: *** [download-images] Error 255

Does anyone has any idea how to fix this up? FYI, I'm running Ubuntu 8.10 as a guest OS on my virtualbox, Mac OS X as the host.

--User:Hackedd 15 June 2009 I have excactly the same problem as bimo reported 15 April 2009, except I'm running Ubuntu directly, not in a VM. Any thoughts on how to fix this?

--User:bjneuman 1 July 2009 Problem still exists. Ubuntu 9.04

make[2]: Leaving directory `/home/ben/projects/openmoko/build/qemu/arm-softmmu'
make[1]: Leaving directory `/home/ben/projects/openmoko/build/qemu'
[ -e images/openmoko ] || mkdir -p images/openmoko
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
    Retrieving available builds list...
    Trying alternative sources
    Kernel is... not found
make: *** [download-images] Error 255

--User:sriranjan 6 July 2009 Problem still exists. Ubuntu 8.10

make[2]: Leaving directory `/home/ben/projects/openmoko/build/qemu/arm-softmmu'
make[1]: Leaving directory `/home/ben/projects/openmoko/build/qemu'
[ -e images/openmoko ] || mkdir -p images/openmoko
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
    Retrieving available builds list...
    Trying alternative sources
    Kernel is... not found
make: *** [download-images] Error 255

Could some one please suggest how to solve this?

--Yewang 13:09, 21 July 2009 (UTC) I'm having the same problem as the above four users. Is it because the online resource that is trying to download is not available any more?

make[2]: Leaving directory `/home/ye21867/openmoko/build/qemu/arm-softmmu' 
make[1]: Leaving directory `/home/ye21867/openmoko/build/qemu' 
[ -e images/openmoko ] || mkdir -p images/openmoko 
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env 
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh ) 
    Retrieving available builds list... 
    Trying alternative sources 
    Kernel is... not found 
make: *** [download-images] Error 255 

--User:Roelant 17:52, 28 July 2009 (UTC) I' m having the same problems as many more of you. It is again the error that is posted by Yewang.

make[2]: Leaving directory `/home/roelant/openmoko/build/qemu/arm-softmmu'
make[1]: Leaving directory `/home/roelant/openmoko/build/qemu'
[ -e images/openmoko ] || mkdir -p images/openmoko
ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env
( cd images && ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh )
    Retrieving available builds list...
    Trying alternative sources
    Kernel is... not found
make: *** [download-images] Error 255

-- User:Oringo Thu Jul 30 20:51:54 UTC 20009 For all users that get the [download-images] Errors. This is what you have to do. Edit build/qemu/openmoko/env (it's a symbolic link to the svn trunk's env file), and make change these lines to the following:

kernel_wildcard="uImage-*-om-gta01.bin"
rootfs_wildcard="*-om-gta01.rootfs.jffs2"
uboot_wildcard="u-boot-gta01bv4-*.bin"