Emulating the XO/Limitations of XO disk images: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Move the screen limitations to the limitations page.)
(Consistency and text cleanup here and there)
Line 1: Line 1:
{{emulation-nav}}
{{emulation-nav}}
This page needs some terms defined:


The OLPC environment is designed specifically to run on a piece of hardware called the OLPC-XO. Some of the components are unlike any off the shelf product (for example, the screen) so you won't be able to get 100% emulation of the OLPC. Normally you don't need 100%, and can happily use your emulated XO. This page is for the times when emulation doesn't quite work.
A) the hardware (I think XO)
B) the software
C) the whole thing (OLPC?)


= Background =
The OLPC system is designed specifically to run on a piece of hardware called the XO. Some of the components are unlike any off the shelf product (example, the camera) so you won't be able to get 100% emulation of the OLPC.


Most VMs ([[Qemu]], [[VMWare]], [[VirtualPC]]) emulate specific but common processors, video cards, network chips, IDE controllers and peripherals. They then map that virtual hardware to the host's real hardware via API calls on the host operating system.
To put things in perspective: most VMs (qemu, vmware, VPC) emulate specific but common video, network, ide and such hardware. It then maps the virtual hardware to the hosts real hardware via the drivers on the host. This means as long as the guest OS can work with the common hardware, it can work with the virtual hardware. The OS's we typically use are designed to run on a verity of hardware, but the XO software is only designed to run on XO hardware, and the XO hardware was not designed to be used for anything other than running XO software. This is fine for the XO, but puts a kink in the ability to run 100% of the XO software on anything but an XO's hardware.


= Emulator Hardware =
You can run the OLPC 'distro' and get more of the OLPC experience by reconfiguring it to work with your native (or virtual) hardware. This is of course more hassle than grabbing an image and running it, which is what this page is about. (will someone add a link to the topic that talks about using non XO hardware)


This means as long as the guest OS can work with the common hardware, it can work with the virtual hardware. The OS's we typically use are designed to run on a variety of hardware, but the official OLPC operating system images have been stripped to just run on the OLPC-XO hardware, in order to save space on the limited flash storage device.
This page will help define the line between what can and can't be emulated. (and perhaps what needs to be done to remove a limitation.)


This stripped image is ideally suited for an XO, but it can be difficult to run the OLPC operating system images under emulation. This situation has been improving as the OLPC images have added drivers for the common emulation systems.
XO Specifications
[http://www.laptop.org/laptop/hardware/specs.shtml]


If you are using one of [[Qemu]], [[VMWare]] or [[VirtualBox]] and discover a missing needed driver, please [http://dev.laptop.org file a bug-report], it may not go into the base image due to space constraints, but it is possible to make packages that can be easily installed to provide the support.
== Screen ==


= XO Hardware =
The emulators currently don't deal very gracefully with the XO's unusual 1200x900 screen size. So what you see is not quite what you would on a real XO, unless you are running a remote X server (as described elsewhere). Running emulation in 1280x1024 is pretty close, but most emulation defaults to 1024x780 to better fit on more people's monitors. See


For the most part, an OLPC-XO is a standard i586 computer, but there are a few pieces of custom [[Hardware|hardware]] which are not normally going to be present in an emulator.
== Touch Pad ==
Mercury: The GS is a capacitive sensor, the PT is a resistive sensor.
CarlFK: is that anything that can be emulated if we are not running on an xo?
Mercury: Maybe.
Mercury: They are really just two absolute coordinate devices, we turn the absolute coordinate data of the GS into relative coordinate data, so it can be used as any laptop's touchpad.
Mercury: However given that qemu runs under X already, there's not a _lot_ to be gained by that over simply providing a mouse.


== Camera ==
== Display ==
Mitch_Bradley: the image sensor is Omnivision OM7670. I'm not sure if Omnivision has released the data sheet yet. The DMA interface between the sensor and the system memory is custom.
CarlFK: so no chance in hell of it working with off the shelf web cam?
Mitch_Bradley: the XO drivers will not work directly with an off-the-shelf web cam.
Mitch_Bradley: off the shelf web cams are mostly USB-connected. Ours isn't. That in itself seals the deal.


Most emulators currently don't deal very gracefully with the OLPC-XO's unusual 1200x900 screen size. So what you see is not quite what you would on a real XO.
bricode: Mitch_Bradley: Huh? I think I'd disagree. Since the Camera Activity uses the V4L2 interface, couldn't you just find V4L2 webcam?
Mitch_Bradley: bricode: he specifically asked if one could use the XO drivers on an ordinary laptop. He did not ask about higher levels of abstraction.


* [[Qemu]] is reported to have support for the 1200x900 screen size in an upcoming release
== Mesh Emulation ==
* Running emulation in 1280x1024 is pretty close
* [[Emulating_the_XO/Help_and_tips#Get_1200x900_resolution|Work arounds exist]], but are reasonably involved and clumsy


If you find that a particular activity or Sugar itself is not dealing with a reasonably sized desktop, please consider [http://dev.laptop.org filing a bug report], OLPC software should be able to deal with most reasonably sized desktops.
We recently did some work at http://olpcaustria.org/mediawiki/index.php/Devserver .. we got virtual mesh networking .. working :) can ping other qemu instances, we can see them on layer 2.
So this should give a nice start to people who want to develop activities in a virtual mesh. --[[User:AaronKaplan|AaronKaplan]] 16:21, 29 June 2007 (EDT)


Features of the screen for which we do not currently have an emulation work-around or solution:
Jcfrench: I've been playing with XO images in emulators like QEMU. But my network management is always a bit touchy. I can manually restart the dhclient, but I only see myself on the mesh. Can the internet emulate some kind of neighborhood mesh?


* dual mode display
Noen: Someone should try hamachi(www.hamachi.cc) with this. We could set up a olpc test network, which would be sweet(if it works).
** black and white mode -- emulating this seems like it should be straight-forward, possibly by changing the display-mode of your X server
** bit-swizzling in color mode -- not likely something you can easily emulate, though potentially a GIMP filter or the like could be written that would let you capture a screenshot and manipulate it to see the result (tends to be an issue with graphics production and the like)
* display controller -- ability to independently refresh the screen without the main processor's input
** any reasonable emulated video card is just going to "blank" the screen when the machine goes to sleep, the XO's sleeping-with-the-dcon-active mode just doesn't exist elsewhere

= Tablet =

The pressure-sensitive tablet on the XO provides two distinct modes of operation, a resistive glide-sensor and a pressure-sensitive table mode. A mouse tends to work fine for most simulation tasks, but there is currently no work-around that allows for accessing the "special" characteristics of the device (such as jumps when the tablet switches mode).

= Camera =

The XO's camera is a custom device with a custom DMA channel into memory. It is not generally compatible with Linux or particularly common. Trying to emulate that ''particular'' camera is probably a non-starter project.

However, all of the software on the OLPC to date uses the Video For Linux 2 interface to the camera. This is the common interface used by most Linux web cams. That means that it ''should'' be possible to connect a normal Linux USB web-cam to an OLPC image (though to date we do not know of anyone who has actually done it).

The steps required should be:

* compile the USB camera's [[Kernel Building|linux kernel driver]] and install into the image
* get your emulator to connect your USB camera to your emulated image

= Mesh Network =

General networking tends to work reasonably well from emulated images. That is, you can browse, collaborate and generally interact with TCP/IP services on whatever networks you can see. For most developers this is sufficient to do most development work.

To emulate the actual mesh network topologies, however, will require considerably more work:

* [[User:AaronKaplan|Aaron Kaplan]] [http://olpcaustria.org/mediawiki/index.php/Devserver reported success] emulating a virtual mesh at network level 2 under Qemu in June 2007


[[Category:OS]]
[[Category:OS]]

Revision as of 03:24, 16 December 2007

modify 

The OLPC environment is designed specifically to run on a piece of hardware called the OLPC-XO. Some of the components are unlike any off the shelf product (for example, the screen) so you won't be able to get 100% emulation of the OLPC. Normally you don't need 100%, and can happily use your emulated XO. This page is for the times when emulation doesn't quite work.

Background

Most VMs (Qemu, VMWare, VirtualPC) emulate specific but common processors, video cards, network chips, IDE controllers and peripherals. They then map that virtual hardware to the host's real hardware via API calls on the host operating system.

Emulator Hardware

This means as long as the guest OS can work with the common hardware, it can work with the virtual hardware. The OS's we typically use are designed to run on a variety of hardware, but the official OLPC operating system images have been stripped to just run on the OLPC-XO hardware, in order to save space on the limited flash storage device.

This stripped image is ideally suited for an XO, but it can be difficult to run the OLPC operating system images under emulation. This situation has been improving as the OLPC images have added drivers for the common emulation systems.

If you are using one of Qemu, VMWare or VirtualBox and discover a missing needed driver, please file a bug-report, it may not go into the base image due to space constraints, but it is possible to make packages that can be easily installed to provide the support.

XO Hardware

For the most part, an OLPC-XO is a standard i586 computer, but there are a few pieces of custom hardware which are not normally going to be present in an emulator.

Display

Most emulators currently don't deal very gracefully with the OLPC-XO's unusual 1200x900 screen size. So what you see is not quite what you would on a real XO.

  • Qemu is reported to have support for the 1200x900 screen size in an upcoming release
  • Running emulation in 1280x1024 is pretty close
  • Work arounds exist, but are reasonably involved and clumsy

If you find that a particular activity or Sugar itself is not dealing with a reasonably sized desktop, please consider filing a bug report, OLPC software should be able to deal with most reasonably sized desktops.

Features of the screen for which we do not currently have an emulation work-around or solution:

  • dual mode display
    • black and white mode -- emulating this seems like it should be straight-forward, possibly by changing the display-mode of your X server
    • bit-swizzling in color mode -- not likely something you can easily emulate, though potentially a GIMP filter or the like could be written that would let you capture a screenshot and manipulate it to see the result (tends to be an issue with graphics production and the like)
  • display controller -- ability to independently refresh the screen without the main processor's input
    • any reasonable emulated video card is just going to "blank" the screen when the machine goes to sleep, the XO's sleeping-with-the-dcon-active mode just doesn't exist elsewhere

Tablet

The pressure-sensitive tablet on the XO provides two distinct modes of operation, a resistive glide-sensor and a pressure-sensitive table mode. A mouse tends to work fine for most simulation tasks, but there is currently no work-around that allows for accessing the "special" characteristics of the device (such as jumps when the tablet switches mode).

Camera

The XO's camera is a custom device with a custom DMA channel into memory. It is not generally compatible with Linux or particularly common. Trying to emulate that particular camera is probably a non-starter project.

However, all of the software on the OLPC to date uses the Video For Linux 2 interface to the camera. This is the common interface used by most Linux web cams. That means that it should be possible to connect a normal Linux USB web-cam to an OLPC image (though to date we do not know of anyone who has actually done it).

The steps required should be:

  • compile the USB camera's linux kernel driver and install into the image
  • get your emulator to connect your USB camera to your emulated image

Mesh Network

General networking tends to work reasonably well from emulated images. That is, you can browse, collaborate and generally interact with TCP/IP services on whatever networks you can see. For most developers this is sufficient to do most development work.

To emulate the actual mesh network topologies, however, will require considerably more work: