Enabling XO features on other distributions: Difference between revisions

From OLPC
Jump to navigation Jump to search
(→‎Predefined function key actions: add section heading, mention Keysyms)
(add "OLPC orphaned features" section with a guess at a list)
 
(One intermediate revision by the same user not shown)
Line 27: Line 27:
* See http://dev.laptop.org/~pgf/brightness.sh.txt for an example script to control the brightness and switch the mode appropriatly.
* See http://dev.laptop.org/~pgf/brightness.sh.txt for an example script to control the brightness and switch the mode appropriatly.


=== Gamepad keys ===
=== Gamepad buttons ===


The XO has additional buttons around its screen, separate from its keyboard.
You can see what the kernel receives with "showkey --scancodes", see

what it translates them to with "showkey", and see what X thinks about
You can see what the kernel receives from these by running <tt>showkey --scancodes</tt> in a [[Console]] terminal, see what it translates them to with <tt>showkey</tt>, and see what [[X]] events the buttons generate by running <tt>xev</tt> from the [[Terminal Activity]].
it with "xev".


On a traditional PC keyboard, the keypad area to the right
On a traditional PC keyboard, the keypad area to the right
Line 44: Line 44:
to support XO's multi-media keyboard keys.
to support XO's multi-media keyboard keys.
if there's not already a packaged way of doing it.
if there's not already a packaged way of doing it.



==== Scan codes ====
==== Scan codes ====
Line 131: Line 130:


== Camera details ==
== Camera details ==

== OLPC orphaned features ==
There are some OLPC developments that may not be applicable to conventional Linux distributions without a lot of work and customization.

A ''possible'' list

* [[Rainbow]]
* [[Bitfrost]]
* [[olpc-update]]
* the [[Software update]] Sugar control panel
* "press O to revert to previous image" during boot


== See also ==
== See also ==

Latest revision as of 01:13, 24 February 2009

It is fairly straightforward to get Linux distributions to boot and run on the XO, since it is a "just" an X86 computer. The XO has several unique features that require additional steps to enable.

This work is present in the Fedora adaptation that is the normal operating system for OLPC OS images (presumably the changes are either in olpc-specific packages or modifications to Fedora packages, see a recent build log). This page documents the changes that other Linux distributions require.

Input controls

Controlling the backlight

The XO display has two controls

1. The backlight brightness (range 0-15)

control or read the brightness through the sysfs file (as of 2.6.25) /sys/class/backlight/dcon-bl/brightness

2. Display mode (high-res vs simulated RGB)

Control or read the mode through the sysfs file (as of 2.6.25) /sys/devices/platform/dcon/output

The high-res mode is 1200x900, the blurred mode is ~800x600.

A 'normal' display has three color pixels for each display pixel, the XO display has one color for each display pixel, and the color is always on when the backlight is on, so to display a color display (or even a white point). this means that if the mode is not in simulated RGB mode and the backlight is on the display will look very strange as different pixels will have different colors.

the standard software for the XO switches to high-res mode when the backlight turns off completely, and simulated RGB mode when the backlight is on.

Gamepad buttons

The XO has additional buttons around its screen, separate from its keyboard.

You can see what the kernel receives from these by running showkey --scancodes in a Console terminal, see what it translates them to with showkey, and see what X events the buttons generate by running xev from the Terminal Activity.

On a traditional PC keyboard, the keypad area to the right contains duplicate arrow, pgup/down and home/end keys that are operational when numlock is not in effect. The gamepad produces the same keycodes that those keypad keys do, thus the dpad produces keypad up/down/left/right, and the circle/cross/square/check keys produce the traditional keypad page up/down and home/end.

To act on the keys, you could run a very simple daemon that eavesdrops on an /dev/input/eventNN node in order to support XO's multi-media keyboard keys. if there's not already a packaged way of doing it.

Scan codes

See Ec specification#KeyCodes for Buttons for the direction pad, gamepad, and screen rotate keys around the XO-1 display.

Some other keys on the keyboard:

key press release
Search key (to Journal), 2nd key from the left on the top row of keys press e0 79 release e0 f9
2nd key from the right on the top row of keys press e0 6e release e0 ee
frame (right key on top row) press e0 5d release e0 dd
x/ (below keyboard) press 73 release f3
left hand press e0 5b release e0 db
right hand press e0 5c release e0 dc
right alt press e0 38 release e0 b8
view source key (fn + space) 59 (fn key) followed by e0 56 release is e0 d6 (the d9 release of the fn key may come before or after the release of the view source key)

See https://bugzilla.redhat.com/show_bug.cgi?id=468744 for a possible keymap to use

Special keyboard keys

The XO keyboard has both

  • keys in common with regular keyboards but with different printed graphics
  • additional special keys that regular keyboards lack

Predefined function key actions

The XO keyboard's function keys have predefined meanings printed on them, e.g. F11 is volume down.

The Sugar code that implements some of these meanings is view/keyhandler.py, see source in git.

xbindkeys

A Linux distribution could use xbindkeys to bind the special XO keys. In .xbindkeysrc, you would add an entry for the screen rotate keys that invokes /usr/bin/rotate_screen.py.

Keysyms for XO keyboard keys

The X Window System keyboard maps for the olpc keys in /usr/share/X11/xkb/ assign several of the XO-1's dedicated keys to X11 keysyms. For example, they assign Frame key which shows/hides the Frame in Sugar to XF86TaskPane , which may trigger useful behavior in other desktop environments. xmodmap -pk displays such mappings.

Stylus pad

The extended stylus pad either side of the track pad. Note this feature may be removed from future hardware.

Lid sensors

These need to trigger screen off or enter e-book mode.

Suspend/resume

Should work if you use the official OLPC kernel and install the OHM packages.

EC interface

The embedded controller can provide battery info and charge status. This may show up under the power interfaces, may not have stable API.

Mesh mode

XO uses special firmware to implement a early draft of 802.11s mesh networking (??)

Hardware encryption engine

Camera details

OLPC orphaned features

There are some OLPC developments that may not be applicable to conventional Linux distributions without a lot of work and customization.

A possible list

See also

Distro version migration nastiness records some of the changes to Fedora packages that the OLPC OS images require.