Wednesday, April 30, 2008

Heard of the Hurd?

A few months ago I came across a Slashdot article The Great Microkernel Debate Continues, which peaked my interest in operating systems. The article left me specifically wondering if any projects were actually actively developing an operating system based on a microkernel.

A popular microkernel developed almost 30 years ago is the mach kernel. This microkernel has developed over the years and now has the latest implementation, GNU Mach, maintained by the GNU Project. The kernel itself provides very little functionality--it handles processes, threads, IPC, etc. Outside of this kernel, runs the Hurd.

"Hurd" is an acronym for "Hird of Unix-Replacing Daemons", where "Hird" is an acronym for "Hurd of Interfaces Representing Depth" [1]. The Hurd is a collection of servers outside the kernel, which interface directly with Mach and provide a slew of functionality: a proc server, which generates processes; a pfinet server, to handle network connections; etc.

Although is has been labeled as having a extremely slow development cycle, it is a fun and growing operating system that provides some very cool ways to think about operating systems. One of the Hurd's funnest ability's the translator. The Hurd provides a set of translator libraries, where one can create a program/server called a translator, and can have a file-name-space representation. As such, when a program like ls or an application queries the file system, this translator can return a file hierarchy.

For example, a person can cd to a directory provided by a translator ascii. When a person enters this directory and types ls, ascii receives a request for the file system. ascii can reply any way it wants, but say ascii simply shows ASCII text files of some specified directory like /tmp.


/tmp# ls

a.out source.c

/tmp# cd ~/ascii

~/ascii# ls

source.c



In the example above, a source file source.c and an executable a.out are stored in the /tmp directory. When ls runs inside of ~/ascii, the ascii translator that is running queries /tmp, uses the file command, and presents source.c as the only ASCII file. If the user cats something to this file ascii presents, ascii can either concatenate this input to the actual file in /tmp or do something else with the input. This provides a very powerful and intuitive mechanism for developers.

To read a more detailed introduction to Hurd translators and some other cool aspects of this GNU project goto http://www.gnu.org/software/hurd/hurd.html.