July 12, 2008
Playing around with the OLPC / XOan OLPC / XO laptop that he got through the Give one Get One program. I'm excited about the XO project because I think it is a good project: essentially bringing laptops (or ebooks, primarily) to children around the world to help improve education. I think that is a nice goal to concentrate on. There are lots of interesting very small laptops available now, primarily the Asus Eee PC laptop, but I really like the OLPC because it has some very interesting hardware. I actually think the EeePC has better hardware for more traditional laptop use - particularly the keyboard is easier for me to type on, and the machines have better specs - but the OLPC has an amazingly interesting display, and I really like the sturdy build of the hardware. The most interesting thing about the display is that if you bring down the backlight on the display it has a really great, 200dpi black and white reflective display that is readable in sunlight. You just can't get that one a normal laptop. I also like how the color works (just turn on the backlight) and you get color, albeit at a lower apparent resolution. This reminds me of the Apple //e that I grew up using. I want to play with some of the drawing programs to see if by placing individual dots you can change the color like in the old double hires Apple //e display. The next two sections talk about getting Japanese support working under the Sugar interface that ships on the OLPC by default, and installing XFCE as an alternative to Sugar that makes the laptop seem like a more traditional linux desktop. The way I have mostly using the OLPC though is with an install of Xubuntu on an SD card, which is the second main section of this post. The remainder of this post is mostly raw notes about the install process, and probably very boring unless you are into this kind of stuff. You might be more interested in reading about using FBReader to read ebooks on the OLPC, or using Anki to study Japanese. If this looks interesting, click the "read more" link.
Installing Japanese Input SupportThe first thing I wanted to do was see if I could get Japanese input working. That turned out to be pretty easy: following these instructions and Japanese input worked without and trouble. Input did not survive a reboot though. According to this page on SCIM-anthy, SCIM only supports en_US.UTF-8 LC_CTYPE setting by default. I added
/SupportedUnicodeLocales = en_US.UTF-8,ja_JP.UTF-8so that maybe SCIM would pop up in Japanese after a reboot. By the way, it looks like your locale setting is stored in
/home/olpc/.i18l. I also added scim-input-pad and scim-tomoe. scim-tomoe allows you to draw Kanji on a pad to input the character in case you don't know the reading. This topic tells you how to disable some global Sugar keybindings, like Control-O or Control-S that make working in emacs difficult. Bill Clementson has a post on working with Emacs on the XO that is also useful.
Installing XFCEI followed these directions to install XFCE, but also checked out the more complete directions. I followed the directions to install Firefox, and also the xbindkeys / olpc-keybind package to allow for the special olpc controls. I don't know why but when I boot the machine after setting up XFCE as the default environment I need to boot twice: the boot process gets stuck after the animated XO logo. Holding down the power key until it shuts off, and then restarting has worked every time though (very, very strangely.) I have not been able to get SCIM-anthy to start up by default. If I boot up the text editor, there is a right-menu "Input Methods" selection that will let me select "X Input Method" (instead of Default) and then SCIM-anthy pops up. According to this page on getting SCIM-anthy working on various Unix flavors I should put
into my .bash_profile. Right now I have some of those in .xsession. I thought maybe I had a problem because I don't have QT modules installed. So I did aexport XMODIFIERS='@im=SCIM' export GTK_IM_MODULE="scim" export QT_IM_MODULE="scim" export LC_CTYPE=ja_JP.utf8 scim -d
yum install scim-qtimm. According to I need to add a bunch of stuff to /etc/sysconfig/i18n:
I also checked and it looks like when I do aGTK_IM_MODULE=scim QT_IM_MODULE=scim XIM_PROGRAM="scim -d" XMODIFIERS=@im=SCIM
env | grep IM_MODULEthat GTK_IM_MODULE is set to xim: this might be because I'm missing scim-gtk. So I did a
yum install scim-gtkThat fixed it! So now XFCE will boot up with Japanese support running. Great!
Installing Ubuntu on the SDHC cardI applied for a developer key as noted on the instructions for how to install Ubuntu using a compressed file method onto a SD card. (Also see this post on a blog.) Following those directions seemed to work well enough. I had to copy the /boot/olpc.fth script from the forum (modified to boot from the SD card) into the NAND's /boot/olpc.fth. I also modified the /etc/fstab on the CD card to mount the SD card and internal NAND. The problem is that after I switched out the boot script, I get the following error:
Boot device: /sd/disk:\boot\vmlinuz Arguments: ro root=/dev/mmcblk0p1 rootdelay=1 console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22That wasn't the right thing to do though because by default the OLPC will look for a olpc.fth on the USB stick port, the SD card port, and then the NAND port, so I restored the original file that was there. It was really hard to boot into the laptop again because I had to issue the commands at the open firmware prompt to set everything up myself:
SDHCI: Card didn't power up after 1 second
Can't open boot devive
setenv boot-file ro root=mtd0 console=ttyS0,115200 console=tty0 fbcon=font:SUN12x22 setenv boot-device nand:\boot\vmlinuz setenv ramdisk nand:\boot\olpcrd.imgVery annoying because I had to do that twice since my machine is still freezing on the first boor for inexplicable reasons! (The inexplicable reason was the missing unfreeze command to unfreeze the display: the boot was working fine, but didn't always turn the screen back on so I could see it!) The boot problem seems to be a known problem that can be fixed by upgrading to a newer firmware. This thread documents problems with booting from SDHC cards. It recommends upgrading to the newest version of the OLPC firmware, q2d16 at the time of this writing. After upgrading the firmware, the OLPC booted off of the SD card! Unfortunately, it seems to freeze at the "Loading ramdisk image from sd:\boot\olpcrd.img" line. I think the problem is that the /etc/fstab in the flash card had a line split over two lines because I made the file with copy and pasting. Oops! Perhaps also Xbuntu needs the other entries that I commented out in the fstab also. It looks like other people have had the problem of the boot process freezing at the ramdisk loading stage. Adding the "unfreeze" and "drop" calls let the display show up at boot time! The mouse is crazy - it will tap click and open like 50 terminals in short order. this post details a way to turn off the tap-click behavior. The Xubuntu version that loaded up didn't have a way to change font DPI from the User Interface setting panel as the fedora version has, so I did some searching and tried this approach to set the DPI to 150, which worked well for me before. Upon reboot the mouse was working (no crazy tap clicking) and the DPI looked good. Now to get Japanese input working, followed the directions here. I had some trouble with Japanese, because I couldn't find out where to put the environmental variable settings, and couldn't get scim -d to start. So I wrote a script (startup) that is:
which works great. I'll have to look into getting that to start automatically upon boot-up. I also installed FBreader with synaptic, which works great, but I can't get it to recognize the face-panel keys. So I have to look into getting the face panel game keys recognized by the Xserver somehow. This thread has information about getting the gamepad directional keys and rotation key recognized by X. I installed xubuntu-desktop which picks up a whole bunch of stuff (including gdm) and zsafe which is a password manager. Those are useful to have around. After that big install, the nm-applet disappeared and I couldn't connect to the network. So I did some command line stuff:export XMODIFIERS='@im=SCIM' export GTK_IM_MODULE="scim" export QT_IM_MODULE="scim" export LC_CTYPE=ja_JP.utf8 startxfce4
$ iwconfig eth3 essid "Disco2007" $ dhclient eth3Then I had a problem where HAL wasn't coming up with the system. What what what? this bug report has information about people whose DBUS isn't coming up on boot. I put in a symbolic link in /etc/rc2.d/S12dbus ../init.d/dbus since that wasn't in my install. On reboot HAL came up fine (it had been failing before due to the lack of a DBUS.) When the UI came up again, there were FOUR instances of nm-applet. That is like, three too many. This thread has information on how to remove extra nm-applet instances. I also had to go into the autostarted applications (Settings / Autostarted applications) and not have it start up "Network Manager" since that is being saved in the session. Now I need to start working on the keys. See this post about adding XO keys which references this article, but this blog entry gives you all you need to know. After following the key installation directions, I had trouble with the screen rotation. My problem is that xrandr does not seem to support rotation on my screen. For example,
xrandr -o leftgives me:
X Erorr of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 154 (RANDR) Minor opcode of failed request: 2 (RRSetScreenConfig) Serial number of failed request: 12 Current serial number in output stream: 12A sudo rpm -q libXrandr said that it was not installed, but maybe XrandR2 is? I don't know. I added
Option "XRandRRotation" "On"to the Geode device section in xorg.conf and restarted the Xserver. It looks like this is the easiest way to install drivers that support XRandRRotation. That totally worked. So, to continue with the previous installation. It looks like ~/.xfce_startup contains a few lines that are called to set up the XFCE environment here, and in fact has
xmodmap -e 'keycode 147 = F11'in it already, so I think I want to add other definitions to get the face keys recognized. In particular, here are the codes that my keyboard outputs (with GP_ my prefix for GamePad)
Key Keycode XKeysymToKeycode SuggestedMapping GP_Up 139 98 KP_Up GP_Down 210 104 KP_Down GP_Left 209 100 KP_Left GP_Right 134 102 KP_Right GP_Circle 229 circle GP_Square 231 emopenrectangle GP_Check 232 checkmark GP_Cross 230 multiplyThe above Up, Down, Left, and Right are already mapped by the screen rotation script to Up, Down, Left, and Right using the ~/.olpckeys file, but I think I want to change them to something else so they don't duplicate the keyboard arrow key values as they do now. The above mapping seemed to work flawlessly, so I changed the ~/.olpckeys to pick up the new arrow definitions, and I also added the xmodmap calls to the ~/.xfce_startup script (xmodmap -e 'Keycode = SuggestedMapping') for all eight buttons (since the rotate_screen.py script is only called on the rotate button press, not initially.) I also made a run_anki.sh script that sets up different keybindings for Anki, mapping the buttons to 0-5 for the card scoring, space to show the next card, and also one escape key because sometimes the CTRL or ALT buttons get pressed down mysteriously and pop up a menu, so I need to ESC out of them. The end of the run_anki.sh script sets the keys back to a default (but potentially incorrect for the arrow button orientation) setting. As long as I'm talking about keys, after two weeks or playing with this setup, I found out that I had a sticking left alt key, something that others have seen before. So I followed the directions on the wiki entry to just remove the ALT key from the xmodmap and replace it with the left hand key (the keycode for my left hand button was 115 instead of 133, but otherwise everything was the same.)
Installing softwareI started up Synaptic (had to do it from a terminal as root though - the graphical interface error'd out with a permissions error) and installed lots of software. Notably Emacs, Edict, and GJiten for Japanese dictionary lookup. xfce4-netload-plugin, xfce4-cpugraph-plugin, xfce4-weather-plugin
Installing FBReaderFBReader is a nice text file / ebook (html, palm format, etc) reader that I have heard good things about. It is included in the Fedora Updates repository, so I was able to install it by getting root access in a terminal, and using:
yum --enablerepo=updates install fbreader
Installing AnkiOnce I had installed Ubuntu, I did some searching and found that someone had packed up anki, a Japanese vocabulary learning system. It says that I need to add
deb http://fr.archive.ubuntu.com/ubuntu intrepid main universeto my
/etc/apt/sources.listto download the package, so I did. Anki is an absolutely amazing package for learning Japanese. After checking through the discussion list for Anki, I found another OLPC user who wrote a small script that he calls to start Anki. All it does is re-map some of the face buttons so they can be used in Anki. I wrote about it up in the keybind section. I've been using Anki for the past few weeks, and really like it. It is a great way to learn vocabulary, and there are lots of pre-made decks for it. I haven't spent much time looking for new decks to study yet, but I'll probably start looking into that in the next few weeks.
CommentsProvide your email address when commenting and Gravatar will provide general portable avatars, and if you haven't signed up with them, a cute procedural avatar with their implementation of Shamus Young's Wavatars.
Comments have now been turned off for this post