|
|
Subscribe / Log in / New account

The Hurd: GNU's quest for the perfect kernel

July 7, 2010

This article was contributed by Koen Vervloesem

When Richard Stallman founded the GNU project in 1983, he started building a completely free Unix-like operating system bit by bit. Over the years, the GNU system got a compiler (GCC), a C library (glibc), a build system (make), a shell (Bash), an editor (Emacs), and so on. However, it wasn't until May 1991 that the project announced they would start working on a kernel, the last missing piece of their free operating system: the Hurd (note the article in the name, and that "Hurd" is the phonetic equivalent for the English word herd).

By then, Linus Torvalds had already started working on his Linux kernel, which he would announce in August of that year. In his now famous debate with Andrew Tanenbaum on the newsgroup comp.os.minix, he wrote (in January 1992):

If the GNU kernel had been ready last spring, I'd not have bothered to even start my project: the fact is that it wasn't and still isn't. Linux wins heavily on points of being available now.

Ted Ts'o, one of the earliest Linux developers, made a similar remark:

I am aware of the benefits of a micro kernel approach. However, the fact remains that Linux is here, and GNU isn't --- and people have been working on Hurd for a lot longer than Linus has been working on Linux.

So, with all due respect to the project's mission and philosophy, we should be happy that the Hurd wasn't ready in 1991, because in 2010 it still isn't (at least for production use). Reading the history of the Hurd (for example in the article that The H published in late June), a comparison to the everlasting development of the video game Duke Nukem Forever is not completely far-fetched. A release has been promised several times, but the development schedule has been postponed even more and the architecture has been completely redone several times.

No vaporware

So what is the state of the Hurd? Is it vaporware, like Duke Nukem Forever? Fortunately not: the code exists, there is still work going on (for instance as part of Google Summer of Code), and there are even some relatively functional Hurd distributions. Let's look first at the code and the current architecture, and then at the Hurd distributions.

The current architecture of the Hurd is a set of "servers" running on top of the GNU Mach microkernel. These servers implement file systems, network protocols, authentication, processes, terminals, and other features that traditional monolithic kernels implement in the kernel itself. The Hurd servers implement clear protocols that formalize how the different components of the Hurd kernel interact, which is designed to reduce mutual trust between components. To transfer information to each other, the servers use Mach's interprocess communication (IPC) system. Collectively, these loosely coupled servers implement the POSIX API, with each individual server implementing its part of the specification.

Both the logo and the name of the Hurd project reflect this architecture. The logo is called the Hurd boxes, and it shows some boxes (the Hurd kernel's servers) connected by arrows (Mach's IPC messages). The name is, in hacker culture tradition, a recursive acronym. Thomas (then Michael) Bushnell, the primary architect of the Hurd, explained the meaning like this:

It's time [to] explain the meaning of "Hurd". "Hurd" stands for "Hird of Unix-Replacing Daemons". And, then, "Hird" stands for "Hurd of Interfaces Representing Depth". We have here, to my knowledge, the first software to be named by a pair of mutually recursive acronyms.

For readers that want a technical overview of the Hurd's architecture and some critiques on the decisions made, your author points to the paper A Critique of the GNU Hurd Multi-server Operating System [PDF] by Neal Walfield and Marcus Brinkmann, published in ACM SIGOPS Operating Systems Review in July 2007. The two have also written a forward-looking proposal for how a future GNU Hurd might be architected: Improving Usability via Access Decomposition and Policy Refinement.

To fix some of these shortcomings of the Hurd while preserving the main design goals, there's already a Hurd-ng project in the works, although it is mostly research oriented. For a time there was an effort, led by Walfield and Brinkmann, to port the Hurd from Mach to the L4 microkernel family, but it never reached a releasable state. The two also considered the Coyotos microkernel, but eventually Walfield moved on to working on a new microkernel Viengoos, about which he published two academic papers.

Hurd distributions

Over the years, a couple of Hurd-based distributions have been born, all of them spin-offs of an existing Linux distribution. In March 2003, Jon Portnoy started a Gentoo GNU Hurd system, but it was abandoned at the end of 2006. There was also a Hurd live CD at superunprivileged.org, but it appears to have stalled in December 2007. Luckily, two Hurd distributions are still active projects: Debian GNU/Hurd and Arch Hurd.

Debian GNU/Hurd is an active subproject of Debian, in development since 1998, but it is not officially released yet ("and won't be for some time", according to the project's home page). Debian GNU/Hurd is calling for help in the development of the distribution, which amounts mostly to porting software. About 67 percent of the Debian packages have been ported to the Hurd kernel, and the Hurd project has a compilation of common porting problems and their solutions. It's interesting to point out that the GNU Hurd developers rely on Debian GNU/Hurd and endorse it on their web site. The last official release of the Hurd without the Debian parts was 0.2 in 1997. On the Hurd project's status page they explain:

That Debian version closely tracks the progress of the Hurd (and often includes many new features), so little would be gained by creating an official pure Hurd release.

People that want to try Debian GNU/Hurd can install the most recent version, called Debian GNU/Hurd L1, or run the live CD that Justus Winter created. There's also a Qemu image made by Jose Luis Alarcon Sanchez (and made smaller by Samuel Thibault), which makes it easy to test Debian GNU/Hurd virtualized with KVM. All these versions work on x86 and x86_64 (in 32-bit mode) PCs. There's also some information about the first steps after installation, such as getting networking running and configuring X, and the GNU/Hurd user's guide is focused on the Debian flavor.

Another Hurd-based distribution, which started in the beginning of 2010, is Arch Hurd (with a logo that is a nice blend between the logos of Arch Linux and the Hurd). This project attempts to bring the spirit of Arch Linux (a minimalist and bleeding edge operating system) to the Hurd kernel. With just four developers, the project has managed to develop a basic Arch Hurd system in a couple of months.

Recently a live CD and installer has been written and, as expected from an Arch project, there is extensive documentation about installing Arch Hurd using the live CD and installing from within another distribution. Xorg 1.8 has already been ported and, while there are not many graphical programs yet, the system has the Openbox window manager and the XTerm terminal emulator.

Because the Hurd runs on Mach, hardware compatibility for these distributions depends on what Mach supports. Currently, GNU Mach uses a maximum of 1 GiB of RAM. Video card drivers are the ones from X.org, but if they depend on a special Linux kernel interface, only the VESA driver works. Sound cards and USB are not supported yet.

Google Summer of Code

The Hurd has been active in the Google Summer of Code project for some years now, sometimes as part of the GNU project, sometimes on its own. This year, the Hurd is participating with three projects under the GNU umbrella.

Jeremie Koenig, mentored by Samuel Thibault, is working on adapting the Debian Installer to produce up-to-date Debian GNU/Hurd installation images. Currently Debian GNU/Hurd is installed either using outdated CD images, or from an existing Debian GNU/Linux system using the crosshurd package.

Emilio Pozuelo Monfort, mentored by Carl Fredrik Hammar, is fixing compatibility problems exposed by projects' test suites when executed on the Hurd. This doesn't sound like an exciting task, but it is needed: test suites for programs like Perl, Python, GNU coreutils, and glib regularly fail on the Hurd because of shortcomings in the Hurd's implementation of system interfaces.

A third GSoC project, mentored by Sergio López, is being done by Karim Allah Ahmed: his goal is to bring the virtual memory management in The Hurd/Mach closer to that of other mainstream kernels, like Linux, FreeBSD, and XNU (the kernel of Mac OS X). He will look at those implementations to see if he can come up with improvements and optimizations for the Hurd.

Conclusion

All in all, the easiest way to currently run a Hurd system is by installing Debian GNU/Hurd. The system runs virtualized in Xen or Qemu, or on a physical system, provided that the hardware is supported by Mach. The lack of sound and USB support obviously means that it is of limited use for desktop users, but on the Hurd status page there is a testimonial of someone that has been using the Hurd for most of his everyday work for two years, so it is possible if your demands are low. A cursory look with apt-cache search by your author on his Debian GNU/Hurd installation in KVM confirmed that there's actually a lot of software available, including graphical programs.

Installing the Hurd is still not as simple as in the Linux world, but there are projects working on that. Although the Hurd is clearly not ready yet for general use as a desktop system, for people that are interested in the GNU operating system, now is a good time to give it a try.


Index entries for this article
GuestArticlesVervloesem, Koen


to post comments

The Hurd: GNU's quest for the perfect kernel

Posted Jul 10, 2010 20:32 UTC (Sat) by marcH (subscriber, #57642) [Link] (2 responses)

Very informative article, thanks.

So Hurd is not vaporware but runs. Does it actually demonstrate the benefits of a micro-kernel approach? First and foremost, can you crash a driver under development without rebooting the whole system?

Does it also demonstrate this IPC overhead micro-kernels are often blamed for?

The Hurd: GNU's quest for the perfect kernel

Posted Jul 13, 2010 23:14 UTC (Tue) by DOT (subscriber, #58786) [Link]

"Does it also demonstrate this IPC overhead micro-kernels are often blamed for?"

That's what I'd like to know too. During a class on operating systems, the lecturer told us that IPC overhead is not much of an issue on hardware that's not utterly ancient. I'd like to see proof of that though, because IPC overhead is always brought up in articles about microkernels. With a functional Hurd, Minix and Symbian, there are enough free competitors for a nice comparison with Linux.

The Hurd: GNU's quest for the perfect kernel

Posted Jul 18, 2010 10:17 UTC (Sun) by oak (guest, #2786) [Link]

> can you crash a driver under development without rebooting the whole system?

Are you asking in theory or in practice? Latter depends a lot on the implementation and whether it's a HW driver or just a pure SW driver. :-)

The Hurd distro page had at least this comment:
"You can run several instances of the Hurd in parallel, and debug even critical servers in one Hurd instance with gdb running on another Hurd instance."

(Debugging doesn't succeed if you're single stepping through critical system service, therefore debugger needs to run elsewhere.)

> Does it also demonstrate this IPC overhead micro-kernels are often blamed for?

There was this comment from user (in 2009):
"while X does work, it works very poorly -- it's not only slow and jerky all the time, but also tends to lock up completely."

But I assume the slowness is partly because of missing shared memory:
"Although the POSIX interface is provided, some additional interfaces like POSIX shared memory or semaphores are still under development."

And of course it being a development kernel; not a finished, mature and well optimized one.

Based on the referenced Hurd article and e.g. these Wikipedia articles on Mach + L4 and its derivatives which take into account things not taken into account in Mach design (perforamance, resource handling, security):
http://en.wikipedia.org/wiki/Mach_(kernel)#Second-generation_microkernels
http://en.wikipedia.org/wiki/L4_microkernel_family#History

I would say that Mach derived stuff seems better to move to newer microkernel generation to be able to be relevant to real users (or researchers).

OSX is also partially Mach based, but it's a hybrid, not a pure microkernel:
http://en.wikipedia.org/wiki/XNU

testimonial

Posted Jul 14, 2010 21:49 UTC (Wed) by roelofs (guest, #2599) [Link]

... but on the Hurd status page there is a testimonial of someone that has been using the Hurd for most of his everyday work for two years, ...

Three, assuming he's still doing so. That testimonial is dated June 2009.

Greg


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