jump to navigation

Adventures in “A…” September 29, 2006

Posted by Florian in GPE, Source, World.

I always wondered why cellphone manufacturers using Linux for their devices do not release the kernel sources like they are expected to do. Yes there are actually quite some of them – just check linuxdevices.com. Now i found a good reason for this strange (and not really legal) behaviour:

The story began with the idea to find a device to start developing cellphone specific applications on. Of course it needs to be one running Linux. I have several smartphones laying around, but it turned out that it seems to be impossible to get the kernel sources for the Linux running ones and Linux support for the non-native Linux ones is not yet ready for cellphone use. After spending hours searching for a device that is acually available including kernel sources i end up in getting a Motorola A780. There is a quite active community around this device and even better: There is a project to create a complete free software stack for this device including an up to date Linux 2.6 already. (see http://www.openezx.org).

Because the port of the new kernel is in a quite early stage i decided to start with the original Motorola 2.4.20 one released at opensource.motorola.com. The idea was just to build a kernel image that uses a partition on the SD card as root filesystem and run this via boot_usb. In this way you can have a development filesystem without installing anything to the internal flash. Sounds easy, eh?

I knew the this kernel was a Montavista hacked one… these are known to be ugly, but it can’t be that bad, i thought…. they are a big and successful company. It didn’t take long to find out that the sources were incomplete. I applied a small patch… created a missing link to a header file, removed some drivers from the configuration and wondered what had happened to all the documentation that can be usually found in a kernel source tree. The resulting kernel image crashed instantly… did you read ‘Snow Crash’? – Then you know how it looked like.

A pile of slightly differen kernel images with the same result and several (successful!) tests by other developers i gave up on boot_usb and flashed the kernel to the device. It started – before that i couldn’t imagine that i would be happy to see the Montavista logo on a screen. ;-) Well the fun was over when i noticed that the kernel just freezed after initializing the RTC. Five compilers and some hacking around i found out the reason for this odd behaviour: I had disabled the camera driver because of some lacking files… after i found these in the older 2.4.17 source tree i enabled the camera again and the kernel booted until mounting of the root filesystem should happen.

Of course this didn’t work… same like NFS root using the USBD driver. The USBD sources didn’t offer a way to switch away from cdc_acm to cdc_ethernet but when i tried to get rid of USBD at all and use the upstream cdc_ethernet driver it turned out that some functions of it were used in a completely different place in the kernel. Yes, some developer must have loved “extern” :-( The module using these functions was used to change the USB mode – i felt lucky and so did the kernel – networking started to work after using the correct command line switch.

Unluckily “init” did not like the kernel and died very fast. After i managed to convince the kernel to wait for the SD card appear i was able to reproduce the same behaviour with the root filesystem on SD. Note that the filesystem is fine – with 2.6 it starts up and even X works fine. I’m not sure how this story continues… oh right, one more nice thing: In both published original kernels ‘menuconfig’ is broken. It starts with an error message and the menu is not updated if Config.in fils are changed. I really love to see things like

Preparing scripts: functions, parsing../MCmenu0: line 133: syntax error near unexpected token `}’

… not speaking about the ugly warnings during build.

Maybe they should have asked someone who knows about Linux?


1. Chris - September 29, 2006

Neat, The openezx pages don’t seem to describe what’s working and what isn’t — do you know of any phones at all that support an entirely free stack yet? I know the Treo 650 got tantalizingly close, but the GSM modem stil seems to be unsupported..

– Chris.

2. Eugenia - September 29, 2006

The only phone that is 100% open is Trolltech’s phone for developers which they released just this month.

3. Chris - September 30, 2006

Eugenia: That doesn’t match my understanding at all; the Greenphone looks to have plenty of proprietary software in.

I’ve found the handhelds.org page for the iPaq 6315 (a phone with gsm/gprs/bluetooth/wifi) and it looks like everything is working except the wifi, but with plenty of polish needed. The phone’s sadly discontinued, which probably maens finding one on eBay..

The page is:


4. fl0rian - September 30, 2006

I can imagine that there are developers out there who just don’t like this green colour ;)

Apart from the fact that the kernel for the greenphone is likely to be the same crap like for the A780 and it contains closed software as well it is really expensive. I don’t think this is an option for an verage open source developer…

5. Jim - October 16, 2006

The HTC Universal (O2 Exec and a lot of other names…) port is pretty close to completion and has a lot of active developers:


#htc-linux irc channel on freenode

They can be purchased fairly cheaply with a contract at least in England

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: