Host-based development with Xoo and Xephyr

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(revert and delete spam)
(Format like Xephyr Instructions & Grammar Errors)
Line 1: Line 1:
One of good ways to get started developing is getting rootfs working on host machine, since most of us doesn't have real hardware.
 
 
Xoo is a graphical wrapper around Xnest, the nested X server. You can make Xnest look like a particular device's display and set up buttons on that device. This is useful for embedded developers who want to simulate a target device on their desktop machine.
 
 
 
Please see [[Getting OpenMoko working on host with Xephyr]] which might contain more up-to-date information.
 
Please see [[Getting OpenMoko working on host with Xephyr]] which might contain more up-to-date information.
  
== Getting rootfs ==
+
== What is Xoo ==
Use the [[MokoMakefile|Building OpenMoko using the MokoMakefile]] to get rootfs, just before make openmoko-devel-image run
+
[http://projects.o-hand.com/xoo/ Xoo] is a GTK2 based graphical wrapper around a ‘Windowed’ X Server. The X server is typically '''Xnest''', the nested X server, or [http://projects.o-hand.com/xephyr Xephyr]. It is intended for embedded developers that want to simulate a target device (with an accurate display size, working hardware buttons, etc) on a desktop machine.  
# sed -i 's/fic-gta01/x86/' build/conf/local.conf
+
than just run make openmoko-devel-image. After a while(half of day) you should have in build/tmp/image/ file openmoko-devel-image-x86-$(DATE).rootfs.tar.gz mine is here [http://www.ms.mff.cuni.cz/~kupem6am/openmoko-devel-image-x86-20070227064250.rootfs.tar.gz].
+
  
=== Build issues ===
+
Currently only getting Xoo working with '''Xnest''' is discussed here. Instructions for running Xoo with [http://projects.o-hand.com/xephyr Xephyr] are planned.
  
[http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=264 Please see this bug tracker issues] if you have problems getting libelf compiled (do_stage fails).
+
''Xoo is not required to simulate OpenMoko hardware - it just improves the presentation''
  
 
== Install Xoo on your host ==
 
== Install Xoo on your host ==
Line 24: Line 18:
 
for any other find a way how to do it in your distro.
 
for any other find a way how to do it in your distro.
  
== Making X cooperate ==
+
==  Build an OpenMoko Image (Getting rootfs) ==
 +
First, you'll need to build an openmoko-devel-image and get rootfs. One good way to get started developing is getting rootfs working on host machine, since most of us don't have real hardware.
 +
 
 +
You should use [[MokoMakefile|Building OpenMoko using the MokoMakefile]] to build an openmoko-devel-image for your host architecture.
 +
 
 +
Prior to running make openmoko-devel-image to get rootfs (before step 5) run :
 +
# sed -i 's/fic-gta01/x86/' build/conf/local.conf
 +
then just run make openmoko-devel-image. After a while (half a day) the build should complete.
 +
 
 +
=== Build issues ===
 +
 
 +
[http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=264 Please see this bug tracker issues] if you have problems getting libelf compiled (do_stage fails).
 +
 
 +
== Setup the Image Filesystem ==
 +
The filesystem of the image can be found at build/tmp/rootfs . It is that image that we want to run in a chrooted environment.
 +
 
 +
This image should also be packed/compressed as the file openmoko-devel-image-x86-$(DATE).rootfs.tar.gz in build/tmp/image/ - mine is here [http://www.ms.mff.cuni.cz/~kupem6am/openmoko-devel-image-x86-20070227064250.rootfs.tar.gz].
 +
 
 +
=== Making X cooperate ===
 
* Make sure your iptables do not prevent you from connecting to port 6000(x11) on localhost
 
* Make sure your iptables do not prevent you from connecting to port 6000(x11) on localhost
  
Line 31: Line 43:
 
* Enable conection from localhost
 
* Enable conection from localhost
 
  # xhost localhost
 
  # xhost localhost
== Preparing rootfs ==
 
* Unpack rootfs file in any directory and cd to that dir.
 
  
* Get dev files in rootfs
+
===  Preparing rootfs ===
 +
Unpack the rootfs file into a directory called rootfs. This will be our chrooted environment.
 +
 
 +
make sure /dev of the host machine are visible from within rootfs
 
  # sudo mount --bind /dev/ rootfs/dev/
 
  # sudo mount --bind /dev/ rootfs/dev/
  
* Chroot to rootfs
+
Start/Move into the protected rootfs environment
 
  # sudo chroot rootfs /bin/sh
 
  # sudo chroot rootfs /bin/sh
== Getting it up ==
+
 
In another term start xoo, good idea is to download [http://www.datenfreihafen.org/~stefan/OpenMoko/neo1973-xoo-device.tar.bz2] and run
+
== Starting the nested X server ==
 +
In another terminal start xoo, good idea is to download [http://www.datenfreihafen.org/~stefan/OpenMoko/neo1973-xoo-device.tar.bz2] and run
 
  # xoo --device neo1973.xml
 
  # xoo --device neo1973.xml
In chrooted enviroment export display to connect to started xoo
+
 
 +
=== In chroot'ed enviroment ===
 +
Export display to connect to started xoo
 
  # export DISPLAY=localhost:1.0
 
  # export DISPLAY=localhost:1.0
and start window manager.
+
Start window manager.
 
  # x-window-manager
 
  # x-window-manager
 
By this time you should have matchbox running in Xoo window.
 
By this time you should have matchbox running in Xoo window.

Revision as of 09:54, 25 June 2007

Please see Getting OpenMoko working on host with Xephyr which might contain more up-to-date information.

Contents

What is Xoo

Xoo is a GTK2 based graphical wrapper around a ‘Windowed’ X Server. The X server is typically Xnest, the nested X server, or Xephyr. It is intended for embedded developers that want to simulate a target device (with an accurate display size, working hardware buttons, etc) on a desktop machine.

Currently only getting Xoo working with Xnest is discussed here. Instructions for running Xoo with Xephyr are planned.

Xoo is not required to simulate OpenMoko hardware - it just improves the presentation

Install Xoo on your host

For gentoo users run just

# emerge xoo

Debian/Ubuntu

# sudo apt-get install xoo xnest

For Fedora (package has been submitted to Fedora for approval, see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=236297):

# ftp://ftp.xelerance.com/xoo/

for any other find a way how to do it in your distro.

Build an OpenMoko Image (Getting rootfs)

First, you'll need to build an openmoko-devel-image and get rootfs. One good way to get started developing is getting rootfs working on host machine, since most of us don't have real hardware.

You should use Building OpenMoko using the MokoMakefile to build an openmoko-devel-image for your host architecture.

Prior to running make openmoko-devel-image to get rootfs (before step 5) run :

# sed -i 's/fic-gta01/x86/' build/conf/local.conf

then just run make openmoko-devel-image. After a while (half a day) the build should complete.

Build issues

Please see this bug tracker issues if you have problems getting libelf compiled (do_stage fails).

Setup the Image Filesystem

The filesystem of the image can be found at build/tmp/rootfs . It is that image that we want to run in a chrooted environment.

This image should also be packed/compressed as the file openmoko-devel-image-x86-$(DATE).rootfs.tar.gz in build/tmp/image/ - mine is here [1].

Making X cooperate

  • Make sure your iptables do not prevent you from connecting to port 6000(x11) on localhost
  • Make sure your X is listening on port 6000(X11) on localhost (netstat is friend)
  • Enable conection from localhost
# xhost localhost

Preparing rootfs

Unpack the rootfs file into a directory called rootfs. This will be our chrooted environment.

make sure /dev of the host machine are visible from within rootfs

# sudo mount --bind /dev/ rootfs/dev/

Start/Move into the protected rootfs environment

# sudo chroot rootfs /bin/sh

Starting the nested X server

In another terminal start xoo, good idea is to download [2] and run

# xoo --device neo1973.xml

In chroot'ed enviroment

Export display to connect to started xoo

# export DISPLAY=localhost:1.0

Start window manager.

# x-window-manager

By this time you should have matchbox running in Xoo window.

Personal tools

Please see Getting OpenMoko working on host with Xephyr which might contain more up-to-date information.

What is Xoo

Xoo is a GTK2 based graphical wrapper around a ‘Windowed’ X Server. The X server is typically Xnest, the nested X server, or Xephyr. It is intended for embedded developers that want to simulate a target device (with an accurate display size, working hardware buttons, etc) on a desktop machine.

Currently only getting Xoo working with Xnest is discussed here. Instructions for running Xoo with Xephyr are planned.

Xoo is not required to simulate OpenMoko hardware - it just improves the presentation

Install Xoo on your host

For gentoo users run just

# emerge xoo

Debian/Ubuntu

# sudo apt-get install xoo xnest

For Fedora (package has been submitted to Fedora for approval, see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=236297):

# ftp://ftp.xelerance.com/xoo/

for any other find a way how to do it in your distro.

Build an OpenMoko Image (Getting rootfs)

First, you'll need to build an openmoko-devel-image and get rootfs. One good way to get started developing is getting rootfs working on host machine, since most of us don't have real hardware.

You should use Building OpenMoko using the MokoMakefile to build an openmoko-devel-image for your host architecture.

Prior to running make openmoko-devel-image to get rootfs (before step 5) run :

# sed -i 's/fic-gta01/x86/' build/conf/local.conf

then just run make openmoko-devel-image. After a while (half a day) the build should complete.

Build issues

Please see this bug tracker issues if you have problems getting libelf compiled (do_stage fails).

Setup the Image Filesystem

The filesystem of the image can be found at build/tmp/rootfs . It is that image that we want to run in a chrooted environment.

This image should also be packed/compressed as the file openmoko-devel-image-x86-$(DATE).rootfs.tar.gz in build/tmp/image/ - mine is here [1].

Making X cooperate

  • Make sure your iptables do not prevent you from connecting to port 6000(x11) on localhost
  • Make sure your X is listening on port 6000(X11) on localhost (netstat is friend)
  • Enable conection from localhost
# xhost localhost

Preparing rootfs

Unpack the rootfs file into a directory called rootfs. This will be our chrooted environment.

make sure /dev of the host machine are visible from within rootfs

# sudo mount --bind /dev/ rootfs/dev/

Start/Move into the protected rootfs environment

# sudo chroot rootfs /bin/sh

Starting the nested X server

In another terminal start xoo, good idea is to download [2] and run

# xoo --device neo1973.xml

In chroot'ed enviroment

Export display to connect to started xoo

# export DISPLAY=localhost:1.0

Start window manager.

# x-window-manager

By this time you should have matchbox running in Xoo window.