|
|
Subscribe / Log in / New account

UDS from an embedded hacker's perspective

This article brought to you by LWN subscribers

Subscribers to LWN.net made this article — and everything that surrounds it — possible. If you appreciate our content, please buy a subscription and make the next set of articles possible.

December 2, 2009

This article was contributed by Grant Likely

The Ubuntu Developers Summit (UDS), held November 16-20 in Dallas, while kicking off the development cycle for the next Ubuntu release, "Lucid Lynx", had a surprising amount to interest a kernel hacker with embedded tendencies. The Summit covered a wide range of topics from low level kernel details, to best community practices, but the ARM netbook support sessions were particularly interesting. At this UDS, the Ubuntu ARM developers set out to enable support for many ARM machines in a single distribution, a difficult task due to the lack of a standard firmware interface on ARM systems; a familiar problem to embedded developers. This report covers the solutions debated at UDS — including Kexec bootloaders and the flattened device tree — and the choices made for the next Ubuntu release.

Ubuntu has supported the ARM architecture since the 2008 Intrepid Ibex (8.10) release, but the relative lack of consumer hardware has effectively made it interesting only to developers. During the Lucid cycle we can expect that to change as Canonical is working with ARM netbook OEMs to provide full support for the new devices that are widely anticipated to appear on the market in the new year.

However, support for a wide range of ARM devices is complicated by the absence of any form of a firmware interface standard for ARM systems. The vast majority of ARM designs are embedded systems with no expectation that the end user will install their own software. General purpose ARM computers are historical rarities; the notable exceptions being the original Archimedes, and the Corel Netwinder. As such, unlike the x86 architecture where an IBM PC-type BIOS is mostly a given, device manufactures can (and do!) implement whatever firmware interface best meets their needs. Every device has a different method for booting the OS. Additionally, since firmware provides little if any information about the hardware, the kernel must be hard coded with device addresses and configuration information.

The current situation requires a different method for each system to boot an installer and multiple kernel images, each hard coded for a specific machine. For a device vendor who only maintains software loads for a handful of devices this situation is not particularly onerous. For general purpose distributions like Ubuntu it is problematic. The maintenance load of both installer and kernel images for every single hardware platform from every single vendor is completely unmanageable. As such, a number of the sessions in the mobile track at UDS this year were devoted to solving the ARM boot problem.

Bootloaders and Firmware

Getting firmware to behave was the theme behind two sessions on Tuesday. The first covered Oliver Grawert's script for creating a bootable image for a Freescale Babbage i.MX51 board with RedBoot firmware. From a purely pragmatic viewpoint, the script is absolutely necessary to create a usable install image but it certainly is not portable. Every board requires a different script for convincing the firmware to boot from the right place. So while it is a current necessity, it is not a viable solution in the long term.

The ARM Soft Bootloader session led by Michael Casadevall on Tuesday afternoon proposed a more complete solution. Rather than depend on the capabilities of firmware executed by the device at power up, he suggested using a second stage boot loader that is built around the kernel and uses Kexec to boot the real OS image in the manner of Petitboot for the PS3. The idea is that the kernel can be used to sidestep firmware differences and provide a consistent boot interface to the installer. It also eliminates the current need to write device drivers twice; once for the kernel, and a second time for the firmware.

For most developers the firmware is not actually interesting, it is just a necessary hoop to jump through to boot an operating system. By adopting the kernel as the boot loader, it eliminates all the (arguably wasted) effort spent developing drivers for firmware, freeing up time for other development. However, there are concerns about the soft bootloader approach. The most significant of these is how much time booting a second kernel will add to the boot process.

Discussion in the Soft Bootloader session was interesting, and is well summarized in the blueprint. It is worth a read for anyone doing firmware work. At the end of the session it was decided that Soft Bootloader is the preferred approach but it still requires some investigation and engineering. Most likely it will not be ready for the Lucid release but is a Lucid+1 candidate.

Flattened Device Tree

Several sessions discussed the problem of hard coded machine information in the kernel which requires the kernel to be modified for each new device. I was asked to lead two sessions on the Flattened Device Tree (FDT). The first was an overview of the FDT approach — how it is implemented in PowerPC and how it can be used to solve several of Ubuntu's ARM problems. The Flattened Device Tree has been discussed elsewhere with more eloquence, but in brief it is a data structure that is passed to the kernel at boot time which describes the hardware. Instead of relying on hard coded platform device tables, the kernel reads the data structure to determine what devices to register and how they are configured.

While no firm decisions were made in the first session, it was generally agreed that device trees solve the problem at hand and should be pursued. Proof of concept work is proceeding which should demonstrate the device tree on an ARM platform in mid-January.

The overview sparked the scheduling of a second Flattened Device Tree session quite unrelated to ARM platforms. Fixing Hardware Quirks in Device Trees discussed the idea of using the same FDT data structure to capture machine specific quirks that are currently hard coded in the kernel. For example, ALSA codec routing information is wildly different from board to board but changing it (for instance when trying to uncover why sound does not work on a user's brand new machine) requires a kernel recompile. If a binding could be written for the device tree that encodes the codec configuration, then it may be possible to fix non-working audio by dropping a new device tree blob into sysfs somewhere instead of asking the user to replace the kernel. Research is needed to decide if this is a viable approach, but it seems promising. Jeremy Kerr has volunteered to investigate it further during the Lucid cycle.

Other Topics

Other interesting discussions for ARM and kernel developers included Colin Watson's Cross Building Ubuntu session, the decision to drop ARMv6 support to take advantage of the performance gains in ARMv7, and the decision to use the 2.6.32 kernel version with Ext4 remaining as the default filesystem (the exception being the ARM kernels which will be allowed to lag if the vendor supplied trees are not yet at the 2.6.32 baseline).

On the other end of the spectrum, the work going into the Quickly application framework was presented during Monday's plenary session. It is intriguing and appears to be a promising approach to simplify Linux application development.

Summit Organization

Sessions at UDS were limited to small groups and the focus was on discussion and making decisions about the next release. Only a handful of 15 minute time slots per day were devoted to formal presentations during the plenary sessions in the ballroom. Participation was open; and to provide for those who were unable to attend, audio from all the meeting rooms was Icecast to the Internet. One of the two projectors in each room was dedicated to showing an IRC channel, allowing anyone in the world to listen in and participate. The IRC channel worked well for those offsite, but also had advantages for those who were onsite. It was often used as a "back channel" for making comments without interrupting the conversation at hand.

With 12 sessions going at any one time, far more was happening at UDS than any one person could track. This report gives a taste from the embedded Linux perspective, and is not intended to be a complete review. Anyone interested in knowing more about what was discussed at UDS is strongly encouraged to browse through the posted schedule for notes on most sessions' discussion and decisions. In addition video that was taken at the conference has been posted for public access.


Index entries for this article
GuestArticlesLikely, Grant


(Log in to post comments)

UDS from an embedded hacker's perspective

Posted Dec 2, 2009 19:58 UTC (Wed) by crimsun (guest, #13750) [Link]

For HDA codecs, it is unnecessary to recompile the kernel (module). snd-hda-intel accepts a patch parameter. The patch is a plain text file whose format is described in the Early Patching section here.

UDS from an embedded hacker's perspective

Posted Dec 3, 2009 2:03 UTC (Thu) by fagan (subscriber, #60302) [Link]

The UDS was awesome even though I couldnt get to any of the mobile sessions
I made sure to grab the head of the mobile team for a chat because I was
interested in ARM. Its very interesting though but the main problem people
(and me) are having is getting a working ARM device to test/develop on. Its
the main Achilles heal of new technologies. I think the manufacturers need
to give out more samples. On the UDS in general terms its such a great
experience.

UDS from an embedded hacker's perspective

Posted Dec 3, 2009 9:37 UTC (Thu) by tbm (subscriber, #7049) [Link]

Take a look at the SheevaPlug - 1.2 GHz ARM CPU at 99 USD. If you want
something with VGA, look for the OpenRD-Client.

UDS from an embedded hacker's perspective

Posted Dec 3, 2009 9:42 UTC (Thu) by tbm (subscriber, #7049) [Link]

Ah sorry, forgot to say that the SheevaPlug won't run the current version of
Ubuntu because it uses an ARMv5 CPU whereas Ubuntu requires ARMv6/v7. Most
other major distros are supported though (Debian, Fedora, Gentoo,
Slackware).

And there's plenty of other affordable ARM hardware.

UDS from an embedded hacker's perspective

Posted Dec 3, 2009 14:28 UTC (Thu) by glikely (subscriber, #39601) [Link]

Probably the easiest to get your hands on is the BeagleBoard. I got mine from Mouser for about $150.

UDS from an embedded hacker's perspective

Posted Dec 3, 2009 14:38 UTC (Thu) by glikely (subscriber, #39601) [Link]

Gumstix Overo also is easy to order.

UDS from an embedded hacker's perspective

Posted Dec 3, 2009 18:58 UTC (Thu) by nlucas (subscriber, #33793) [Link]

And the Smart Q5/7, which already comes pre-installed with Ubuntu MID, from $150 (I bought one Q5 online for 117€, including transport).

I'm just starting playing with it. One thing is certain: the OS that comes with it (Ubuntu MID, based on a development branch of Karmik/9.10) sucks, but I heard there is a Mer version that works reasonably well (meaning not slow as hell), although the wlan card needs some non-distributable firmware.

UDS from an embedded hacker's perspective

Posted Dec 6, 2009 4:23 UTC (Sun) by laf0rge (subscriber, #6469) [Link]

AFAIR the SmartQ5/SmartQ7 use a Marvell 8686 chip which should very well work with the mainline libertas driver (GSPI variant). http://wireless.kernel.org/en/users/Drivers/libertas

The firmware has been made available under a redistributable license, it _used_ to be non-redistributable. Though currently I cannot find the exact pointer to that newly-licensed firmware right now.

UDS from an embedded hacker's perspective

Posted Dec 6, 2009 4:24 UTC (Sun) by laf0rge (subscriber, #6469) [Link]

it's in the linux-firmware.git tree by now.

UDS from an embedded hacker's perspective

Posted Dec 3, 2009 14:36 UTC (Thu) by glikely (subscriber, #39601) [Link]

Indeed, getting hardware is a problem. Of the two officially supported ARM boards, only the Freescale i.MX51 evaluation kit is available to the public, and that was only announced on Nov 4, 2009. I can find no way to purchase a Marvell Dove board.

However, the BeagleBoard (OMAP3) works and there are instructions for installing Ubuntu on it. Also, the Netwalker (i.MX51) is available in Japan.


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds