Jolicloud

The Quest for Implementing Support for the GMA500 Chipset

November 17th, 2009 at 11:18 pm, by Adam McDaniel

42 comments

Hello! My name is Adam McDaniel and I will write this inaugural Jolicloud Developers blog post. With the Jolicloud team we decided that this first post should be about how we implemented support for the GMA500 chipset, infamously codenamed as “Poulsbo”, in the upcoming Jolicloud Pre-Beta release.

But first, some background. I started the Array.org Netbook Kernel project in July of 2008 as an effort to provide a set of kernel packages optimized for the Asus EeePC. In January 2009 I joined the Jolicloud team as their lead OS architect. My role is to provide Jolicloud with support for as many netbook architectures as possible, and to fix the other little quirks that other Linux distributions have not yet solved. This is one of the things that makes Jolicloud unique. Our team has spent a lot of time optimizing netbook performances. One huge quirk for us was to find a way to support the new netbook hardware using the GMA500 chipset.

How New Hardware is Supported on Linux

When a new hardware component is released, the company that developed the technology has a choice in terms of how to release its drivers. Often, official drivers are released using various license agreements. In order to support the hardware on Linux, either the company needs to donate resources to the Linux kernel, and create a driver for the community to share, or, someone working on behalf of the Linux kernel will attempt to port the existing drivers, but only if the technical hardware documentation is available.

When this happens, the hardware is supported by the kernel, ensuring support on as many distributions as possible.

The main issue with the GMA500 chipset, which was originally launched in mid 2007, is that its source code was never released publicly. This resulted in poor levels of support amongst Linux users and developers.

The Problem with GMA500 in Netbooks

Since mid-2008 the GMA500 video chipset has be used in all netbooks that run the Intel Atom z500-series processor. Some examples include the Dell Mini 10Mini 12, the Acer Aspire One 751, the Asus EeePC 1101, and many more.

By the end of 2008, when the Dell Mini 10 and 12 models were released, they had GMA500 support, thanks to the collaboration between Ubuntu and Dell on a customized build of Ubuntu v8.04 (Hardy Heron). The company that owns the GMA500 chipset’s IP, Imagination Technologies, licensed the Linux drivers to Ubuntu for their Dell-specific “remix” of v8.04. Ubuntu released the pre-compiled GMA500 binaries, that were linked againsted other open-sourced libraries on their distribution. One such dependency was the open-sourced OpenGL implementation called Direct Rendering Infrastructure, or DRI. Ubuntu v8.04 used DRI v2.3.0, so that was the only version that the GMA500 binaries were linked against.

This was great. Users could now support 720p video, 1000+ frames per second in glxgears, no issues!

Work soon started to implement GMA500 into other Linux distributions, however they couldn’t implement a complete solution. The problem was there was no source code to the driver, and the original binaries had to be manually re-implemented for future libraries, like the DRI.

How is GMA500 supported today?

Without specific consideration for GMA500, the only way to display graphics on these netbooks was to fall back to 640×480 resolution through the vesa driver. This is what users would be met with when they first booted a Linux LiveUSB onto their Poulsbo-based netbook.

Fortunately, after Ubuntu v8.04, the team at Ubuntu-Mobile managed to implement the older binary drivers onto a newer version of Ubuntu Linux. They backported their current libdrm/DRI library to the known-working 2.3.0 release, but kept all the other features, like Gnome, KDE, and everything else, intact. This actually kind of worked. The team released a set of packages that did this on their Personal Package Archive, or PPA, at launchpad.net. However there were two problems. First, it required users to follow instructions to manually install the new packages, and second, portions of the code, specific to their running kernel, needed to be compiled locally on the user’s device.

Granted, the instructions provided by the Ubuntu-Mobile team weren’t that complicated, however a newbie in Linux could get lost easily. Canonical couldn’t say that Ubuntu v9.04 and later actually supported the GMA500 out-of-the-box; these Ubuntu-Mobile modifications had to be performed in a broken X display, running vesa drivers in 640×480, before full resolution would work. Furthermore, the on-site compilation process was managed by a program called Dynamic Kernel Module Support, or DKMS, which actually built a set of poulsbo-specific modules for your running kernel, on demand. This build process required the user to download DKMS, make, fakeroot, and the Kernel headers onto their netbook, which ate up almost 100 Megabytes.

So, provided that you were not turned off with poor video in LiveUSB mode, and you were OK with manually adding in the PPA and its packages, and with the DKMS build, you can get GMA500 to work on Ubuntu releases post-v8.04. However, as of Ubuntu v9.10 (Karmic Koala), support is still not available out-of-the-box.

Since the Ubuntu-Mobile team released their GMA500 packages, other distributions have jumped on the GMA500 train. One such distribution that announced support is Mandriva 2010 in their “One” release build. This was essentially a repackaging of Ubuntu-Mobile’s DEBs as RPMs, then pre-install the DKMS package. It worked, GMA500 support was available without user intervention, but we thought that there were still some things that could be improved.

Jolicloud’s Implementation of GMA500

Jolicloud believes that the DKMS approach to the GMA500 problem, which is fine for faster hardware, should not be necessary, especially on netbook hardware. Our goal was to integrate the Poulsbo drivers directly into the kernel itself, and support GMA500 out-of-the-box. Established conventions say that you must “decide” which DRI to use: either a Pouslbo-specific libdrm from v2.3.0, or something more recent. You couldn’t have both on the same system, right?

To tackle this problem, we worked directly on a newer method of integrating the original Ubuntu v8.04 binaries into the newer Jolicloud kernel. Initially, because the GMA500 binaries were built against libdrm 2.3.0, it seemed like the entire kernel needed to be kept at 2.6.28 (where libdrm 2.3.0 was standard). We thought this meant that we would have to implement two kernels simultaneously; a Poulsbo-specific kernel from v2.6.28, and a kernel from v2.6.32 for everyone else.  At one point, this seemed like the only option.

However, we developed a way to install the Poulsbo DRI along side the native kernel’s DRI. First, we renamed the Poulsbo DRI’s exported symbols. This allowed us to release two DRIs without the versions colliding in the same kernel. We next promoted libdrm-poulsbo into its own, separate, implementation of libdrm (not just a simple drop-in replacement) and instructed it to use the alternate symbols. Other packages, like xserver-xorg-video-psb, were re-linked to our jolicloud-upgraded libdrm-poulsbo library.  Now, our kernel provides both DRIs, and packages provide both DRMs. This basically means that one distribution ISO can support GMA500 and all other chipsets with unique DRIs and DRMs! :)

The end result?

Jolicloud’s Pre-Beta release will support native resolution for Intel Atom z500-series netbooks with the GMA500 chipset. This is on par with the other major distributions advertising built-in Poulsbo support, except we’ve simplified the installation into a truer form of an out-of-the-box implementation.

GMA500 support out of the box is part of our mission to provide an OS that can install on the widest number of netbooks. Our quest is not finished yet. Now that we have improved the support of GMA500, we are going to continue working on our hardware support and focus on improving boot time and other optimization.

Continue reading and post a comment.

Welcome to our Developer Stories about Building Jolicloud

November 17th, 2009 at 10:47 pm, by Tariq Krim

7 comments

For our users, Jolicloud is a cool OS for their netbooks. For our developers, it’s about technical challenges, moving barriers and disrupting the status quo. On the whole Jolicloud is an interesting beast because it is bringing together two worlds that usually don’t talk together: the world of open source OS and the world of open web developers.

We believed that it would be a good idea to have our team share the stories behind the building of Jolicloud, this is how building.jolicloud.com was born.

We hope you will enjoy our posts and that you will share your thoughts with us. We are very dedicated to our work but every day we learn more, so don’t hesitate to suggest ideas and send us feedback.

Have fun reading!

Continue reading and post a comment.

Follow us on Twitter:

Follow jolicloud on Twitter
RSS Feed