Gentoo irssi session on an N800

Nokia N800 Internet Tablet

Bought used via in September 2009. As the academic year was beginning, I was looking for a light portable system for reading lecture notes and syncing a calendar. In fact I strongly considered a netbook or a Symbian S60 phone, but ended up winning this bid. As a Linux-based ARM device I find this much more technically interesting than an x86 netbook, and look forward to hacking it properly.

Initial Maemo experiences

I received the tablet on Monday, 2009-09-14, and found the system incredibly intuitive. This is somewhat strange, since I am a fairly old-school geek, and I usually find overly designed visual user interfaces frustrating. It felt like it was designed by engineers for themselves, while being careful with the limitations and special features of the touchscreen interface. I have no prior experience with keyboardless touchscreen devices, and I was surprised to notice how effortless it was to learn the logic.

In the same evening, during a theatre rehearsal at the university campus, I was already fluent with the machine, for example

It was somewhat disappointing that the SSH client was not there by default, in a device called the Internet Tablet. However, this was not a clean install, and the previous owner may have changed something. There is a default VOIP application, Gizmo, which seemed to handle my Saunalahti account mostly well, but it was far from perfect.

The mechanical buttons were not immediately obvious, but I soon came to appreciate them. For example MPlayer, available in the repository, uses them to a great extent for playback control. Not surprisingly, MPlayer turned out much better than the default media player. It also works as an Ogg Vorbis player on the command line, but for some reason its GUI only handles video files.

USB host mode

The N800 implements USB OTG, so it can act either as a device or a host. However, it has a device-only plug (mini-B). You need either a custom adapter or software signals to change the mode.

Detailed info

I built a custom cable by using the pinouts from Hardwarebook. The female A socket, with case, was obtained from a PS2-USB adapter. The cable and the mini-B plug came from the N800 stock accessory. The plug was sliced open to connect pins 4 and 5 together, which enables host mode without software.

So far my experiences have been quite flaky, though. Sometimes a USB keyboard works, and sometimes it does not. Using a powered hub has not solved these problems. It looks like a software problem, since I have double-checked the hardware side with another USB gender bender, and it seems to have worked just a few days ago :-/

[2009-09-20] I have reflashed the tablet with a clean firmware, and things are considerably smoother. For one thing, there were bits left from the previous owner when I got the machine. The bluetooth keyboard and USB devices are working much better; a keyboard and a 1-GB Kingston DataTraveler stick work even without a powered hub, though I have not tried writing on the stick.

Outside the box

Maemo feels like a solid and complete product, for better and for worse. For example, with USB devices connected to the N800 in host mode, there is a well documented error message "USB device not supported", even if the device will work. This smells like the bad old Windows world, where you are not supposed to do anything for which the system is not intended. In this case, you are supposed to have an Internet Tablet.

One annoying feature has been the lack of explicit mount/umount. I have managed to mess up the contents of the external SD card this way; I expected a need to fsck, but the entire partition map had been garbled.

Fortunately, this is an open Linux-based machine, and I am planning to install another distro. If I am going to compile stuff including a new kernel, I will be much more comfortable with Gentoo, for example. Even a binary distro like Ubuntu would be nice, as it would come with an up-to-date kernel and libraries.

Tips, tricks and quirks

Commandline vs. GUI in apt/dpkg

For some reason, the GUI does not know about lots of packages. For example e2fsprogs and screen were easily installed using apt-get on the commandline, though they were not visible in the GUI (neither listings, nor via search). Of course, using the commandline is useful in general, at least when working from another computer via ssh.

USB networking vs. WLAN

WLAN in Maemo is somewhat flaky, and while this is not surprising to anyone with general WLAN experience, this can be a problem if persistent connections are desired, such as with ssh and nfs.

Then there is also USB networking. I enabled it with maemo-control-usb, which after installation is available in the control panel. The IP address, netmask and gateway are set in /etc/network/interfaces, though of course you can ifconfig this on the command line as well.

USB networking is much faster than WLAN, at over 5 MB/s, and you might think it is also more stable. However, it seems to make the entire machine somewhat unstable, with occasional random reboots >.<

The above only applies to Maemo; under Gentoo the USB network is rock solid, coming up every time once it is configured. Of course, there are no useless, competing services running in the background.

An actual reason may be that Maemo uses aggressive power saving on the peripherals, so it takes a while for the network device to activate. This is especially apparent when running sshd on the tablet. On Maemo it takes some persistence to log in, as the machine is not visible in the network — after all, it was designed to be a client :-/ But with something like Skype using the network, ssh works much better. On Gentoo these power saving do not work, so ssh and nfs work well enough over the wireless as well.

Maemo applications found worthwhile

Hardware notes

The earphone socket has a very low signal, when used as a line-out. I had to crank my amplifier up to -30 dB, while I normally listen to music between -70 and -60 dB. This is a slight disappointment, as I was planning to use this occasionally with the theatre PA. A USB sound card is possible though, but with more hardware I would probably lug a laptop anyway.

Plans / TODO

3G modem

One of my main goals with USB is to get my 3G modem working, a Huawei E169. There do not seem to be drivers with the stock kernel, which is one reason why I plan to install a more up-to-date distro.

Some people warn that there may not be enough power for the modem, and it will only work with a powered bug, which of course negates the point of a mobile device. However, the same warning has been said about the Wippies Homebox, where I have used my Huawei succesfully.

[2009-10-12] While installing Gentoo, I came across this set of modules that also contains option.ko for this 3G dongle. Usb_modeswitch is also required, after which you have the /dev/ttyUSBx serial devices :) Unfortunately, this only seems to work with a powered hub, as per the common warning. Therefore I have not bothered to set up the 3G connection any further :-/


This is the Linux distro that I use with my other machines, since it lets you do whatever you want, your way. Available for the N8x0.

[2009-10-12] I currently have a basic installation on a SD card, and I am emerging packages in a chroot under Maemo. Cross-distcc works, just like in the rest of my machines. My shared Portage is mounted via NFS, as likewise usual.


[2009-10-12] As a first step towards alternative distros, I installed the 0.15 version of Mer. It is basically a community version of Maemo, with more potential for hacking, but naturally less smooth and stable. So far it has not turned out very useful or interesting, but the installer is an easy way of getting Bootmenu, which is necessary for booting other distros. Mer can also be flashed in place of Maemo, using the standard Maemo flasher.

Custom kernel

Currently, the default and recommended methods for running Gentoo and Mer involve the stock Maemo kernel. One likely reason is that the kernel is flashed on the device, so you cannot simply choose the kernel upon bootup, like you do with GRUB, yaboot or the like on bigger iron. Thus experimenting is harder, if you have to re-flash every time after a failed kernel. At the moment (2009-10-15) I have not even completed a Gentoo boot, and I plan to do so with the stock kernel before going any further.

There are many good reasons for using a more up-to-date kernel. One is that the stock Maemo one is heavily patched, while most of the drivers are in recent vanilla kernels. Security and functionality improvements are of course welcome, for example udev does not like older kernels.

It should be possible to experiment with other kernels via kexec, which is a way of booting one kernel from another. I am not sure where to begin with this, but there must be someone who has succeeded in it :-j

USB networking as a host

The usual, documented way of USB networking uses the g_ether driver, meaning the USB port is in the gadget mode. The host side of this network uses cdc_ether under Linux.

As discussed already, the N800 can also act as a USB host. The cdc_ether driver is actually built in the Maemo kernel, at least in the Diablo version. I have tried it with my OTG cable, as my ADSL box works as a USB gadget (as tested with my laptop). So far, it has not worked, so it probably requires some extra setup.

The main reason why this would be nice is the ability to use other USB devices. In the gadget mode, the USB port is bound to this single use, but as a host, it could use a hub with multiple devices. Of course, this requires a USB network gadget at the other end. In my case it would be convenient, as it could connect directly to my central switch, instead of bridging through my laptop.

Cloning Maemo to SD card

[2010-01-18] Maemo has turned out incredibly useful in daily work, and after some experimentation I have been looking for a root backup solution. Cloning the Maemo install to a bigger SD partition is rather well documented, but the use of preconfigured scripts is confusing for me.

The essential idea is simple: copy the contents of root to the other partition, and set up bootmenu accordingly. Despite the extensive scripts and documentation, I have not found a clear answer on what the bootmenu item should look like, but again the essentials are simple. This is how I cloned my system, after extracting the essential information from and /usr/share/bootmenu/bootmenu.conf.n8x0.example. This assumes the new root is an ext3 filesystem on the 4th partition of the internal SD.

Bootmenu item:

ITEM_NAME="Maemo clone on internal card, p4"
ITEM_MODULES="mbcache jbd ext3"

Cloning the root

mount -t jffs2 /dev/mtdblock4 /floppy -o rw,rpsize=1024,rpuid=0,rpuid=30000
mount -t ext3 /dev/mmcblk0p4 /opt
tar cpf - -C /floppy . | tar xpf - -C /opt
umount /opt
umount /floppy

The reason why uses 276 lines to do the same thing, is that it covers everything including the filesystem creation. However, that is too much handholding to my tastes. IMHO, if you are doing something like cloning the OS, you should already know what you are doing, instead of following a script.

One important idea I got from is the remounting of the original root partition, while the system is running. It is a simple way to avoid copying the contents of /dev and other dynamic stuff. For copying the contents, tar is a good way to ensure that special files and permissions are intact; I think the 'p' for permissions is pretty essential, though it was not there in the in the original script.

Enabling swap partition in Maemo


# workaround an issue with mounting swap partition at startup

# modified from
# using -a since the partition is defined in fstab

case "$1" in
   swapon -a
   swapoff -a
   swapoff -a
   swapon -a
   echo "$0: not implemented"

This is enabled on bootup/shutdown with

# ln -s /etc/init.d/ /etc/rc2.d/S19swap
and the swap partition is defined in /etc/fstab in the usual way, for example
/dev/mmcblk0p1  none    swap    sw      0 0

About the name

'Nokia' is the partitive plural of the old Finnish word 'nois', which probably refers to this animal. It is a fairly small and nimble one, and rhymes with 'table[t]'.

Risto A. Paju