Android and Linux are growing back together

Google's Android, the increasingly important embedded Linux, had one major problem: it had been moving slowly away from the Linux mainstream. Now, after the recent Linux Foundation Collaboration Conference, Android and Linux are coming back together.

Not only is Google going to be hiring two new Android developers to work more closely with the Linux kernel development team, they're also working on re-merging its driver code with Linux. Indeed, the first series of driver patches that will bring Android and Linux back into alignment have already arrived.

The drift between Android and Linux first came to light as Ryan Paul noted last year, when he wrote, "Google engineer Patrick Brady stated unambiguously that Android is not Linux." Indeed, Brady had said that, but that was an overstatement.

Android is Linux. To be exact, its latest version, 2.1, Éclair, runs on the 2.6.29 Linux kernel. But instead of its userspace being based on the various desktop Linux software frameworks such as GTK+, commonly used in the GNOME desktop, or Qt, which is the basis of the KDE desktop, it is built atop Dalvik, a Google-designed custom JVM (Java virtual machine). This means that using conventional desktop Linux API (application programming interfaces) or porting ordinary desktop Linux programs to Android is very difficult, but it hardly disqualified Android from being Linux.

Far more troubling was that Google's engineers were no longer sharing their device driver code with Linux's development community. This led Linus Torvalds to drop these drivers from the main Linux kernel.

Greg Kroah-Hartman, a Novell engineer and head of the Linux Driver Project, explained in his essay, "Android and the Linux kernel community": "The Android kernel code is more than just the few weird drivers that were in the drivers/staging/androidsubdirectory in the kernel. In order to get a working Android system, you need the new lock type they have created, as well as hooks in the core system for their security model. In order to write a driver for hardware to work on Android, you need to properly integrate into this new lock, as well as sometimes the bizarre security model. Oh, and then there's the totally-different framebuffer driver infrastructure as well.

"This means that any drivers written for Android hardware platforms can not get merged into the main kernel tree because they have dependencies on code that only lives in Google's kernel tree, causing it to fail to build in the tree.

"Because of this, Google has now prevented a large chunk of hardware drivers and platform code from ever getting merged into the main kernel tree. Effectively creating a kernel branch that a number of different vendors are now relying on."

Why did Google do this? Basically because they were so busy working on Android specifics that they were ignoring the big picture. Google open source engineering manager Chris DiBona said at the Linux Collaboration Summit that Google had to do a "better job" of contributing Android patches back to the Linux kernel. DiBona also said that Google would be hiring two new Android developers to work on better collaboration with the Linux kernel developers.

Google hasn't waited for the new hires to start. James Bottomley, Chair of the Linux Foundation's Technical Advisory Board, explained to me in an e-mail that, while he couldn't speak directly at what had been decided between Google and the kernel developers at the Linux Foundation's meeting, he could draw my attention to a series of nine patches entitled "Suspend Blocker API (version 4)" from [Google developer] Arve Hjønnevåg. It certainly wouldn't be illogical to infer they were a result of the Android meeting. So far, it seems they've met with some easily addressable technical suggestions, but no major push back"

Bottomley added, "I can certainly say that if this patch set is accepted, it will allow us to merge at least 75% of the android drivers that are currently out of tree because of API differences between the Android kernel and the vanilla one." On the LKML (Linux Kernel Mailing List), Kroah-Hartman signaled his approval, writing, "Yeah! Thanks for re-spinning this and pushing it out. This should help lots of drivers get merged."

From where I sit, the bigger news is that this will help get Linux and Android back to where they belong with Android being as full a member of Linux as say Red Hat Enterprise Linux or Ubuntu.

Copyright © 2010 IDG Communications, Inc.

7 inconvenient truths about the hybrid work trend
Shop Tech Products at Amazon