# GNU/Hurd on L4 wiki ## Introduction This page is a place for information pertaining to the efforts towards realizing the migration and porting of the [[Hurd/WebHome]] such that it uses the [L4 Microkernel](http://l4ka.org/). The GNU/Hurd Operating System, sometimes just referred to as the _GNU Operating System_ is a rich and robust collection of programs and utilities which enable you to use your computer to do usefull and or entertaining things. The intent is that most any applicable software package available on the [GNU Website](http://www.gnu.org) (and many others also) will be able to be compiled and run under the resultant operating system. At this point (06/20/2004) this is not yet possible. Indeed, the preliminary foundations are still being developed. Nevertheless, this is a volunteer created operating system so those with the knowledge, interest, and spare time are encouraged to study and if possible contribute to the project. ## Components of the System ### The L4 Microkernel The kernel of an operating system is a fundamental program which provides essential resources from the hardware of the computer to other programs. A kernel typically runs all the time and remains resident in main memory. The amount of functionality and resources which it provides vary tremendously. The [L4 Microkernel](http://l4ka.org/) is an attempt to create a very small high performace core which provides basic memory management, task and context switching, and little else. ### The Hurd The [Hurd](http://www.gnu.org/software/hurd/hurd.html) is a conglomeration of servers and programs which add additional functionality to a microkernel such that it is capable of utilizing additional hardware resources of the computer. It also provides a compatibility layer such that compiling higher level programs is essentially transparent; i.e. when you write a C program and compile it, you need only include standard headers and libraries and for all intents and purposes your generic program will build and run and you need never resort to unportable coding or access to hardware specific methods. For a typical user, The Hurd is intended to silently work in the background providing the services and infrastructure which are lacking in the microkernel but are required for higher level programs and libraries to operate. ### GNU Programs For the user, this is what is desired: to run [GNU Software](http://www.gnu.org/). These programs provide a full featured, robust, and extremely effective operating system. A L4/Hurd system should be capable of compiling and executing most any software package available from GNU with little or no modification. Some readers may be familiar with GNU/Linux systems. When GNU/L4 is complete it should highly resemble the functionality of such systems as L4 and Hurd effectively replace the Linux kernel. The bulk of the software should be expected to run much as it does presently under the Linux kernel (or gnumach based GNU/Hurd systems). ## Preparations ### Build System There are no precompiled binaries for Hurd on L4 that I am aware of, so you will need to be able to compile the source code packages in order to experiment with it. While L4Ka will likely build on a variety of compilers and systems, the Hurd may prove troublesome unless it is built using recent GNU compilers and tools. I recently used [Debian Unstable](http://www.debian.org) (Sarge) with GNU gcc version 3.3, autoconf version 2.50, and automake version 1.8 to build the system with good results, although other similarly equipped systems with a good development environment, such as [Gentoo](http://www.gentoo.org) or [Slackware](http://www.slackware.com) are reported to work fine also. Generally, I would recommend building the packages using any very up-to-date GNU development system. I'm not going to say that you can't compile them using more exotic platforms, but I wouldn't be overly hopefull about it. I have no idea if Pistachio can be compiled under current gnuMach/Hurd systems it might be interesting to try it. ### Making a Home for L4/Hurd Obviously you want to have a home for this little embryonic operating system. Currently, mine is using about 5M for the binaries and headers. If you want the source to reside with the binaries, then allow perhaps another 50M or so, but this is purely optional. At the moment, Hurd on L4 can't even see your hard drive, so all you need is a directory on some partition which is visible to the GRUB bootloader. A `/l4hurd` directory on your existing GNU/Linux system is probably fine for now. Howevever, if you have some spare disk space or an unused partition, you could optionally create a small partition for the system. This is totally unnecessary at the moment because L4/Hurd lacks hard disk drivers right now, but it is an option. Assuming that you have made some partition **X** with linux _fdisk_, set it to type 83 - Linux and use the following command to initialize it with the classic Hurd extensions: As noted, this is purely optional, in fact right now you can use any filesystem that GRUB can understand. You can even use TFTP to netboot the system. My current setup takes about 5M for the full install so obviously you don't need much space for this. ### Boot Loader Just like regular GNU/Hurd, you need to use [GNU GRUB](http://www.gnu.org/software/grub/), the _GRand Unified Bootloader_ in order to boot the system. Hopefully you already have it installed, in which case adding the commands for L4/Hurd to your `menu.lst` is quite trivial. If you don't have GRUB installed, then you should probably take some time to get it set up. A good place to look for help is on the regular [Debian GNU/Hurd Installation Page](http://www.debian.org/ports/hurd/hurd-install) at the **3\. The Boot Loader** section. This is probably a bit superfluous, but you can even display a snazzy little graphic of some type on your GRUB boot menu. Here's a snip from the header of my `menu.lst` which demonstrates how to do this. # menu for grub splashimage (hd0,0)/boot/grub/debian.xpm foreground bfbfe7 background 3f3f7f In the above example, my `debian.xpm` is just a 640x480 graphic in xpm format (which you can easily create with GIMP). It does add a bit of pizazz to your boot screen :-) In fact, I will attach a sample copy of my `menu.lst` here. It has lots of examples for booting a variety of operating systems in it. Remember that my hard drive partitions are unique to my system. * [[ATTACHURLmenulst]]: Sample GRUB boot menu ## Building Hurd on L4 ### L4Ka Pistachio #### Getting the Sources I used the latest version of L4Ka, Pistachio version 0.4. It can be obtained from the following website: [L4Ka Pistachio Home](http://l4ka.org/projects/pistachio/) #### Compiling Pistachio is designed to be compiled in a build directory which is independant from the source directory, so you need to create your build directory after unpacking the tarball. Furthermore, you need to pass a couple of special parameters to the configure program to set it up for use with Hurd. Here is what I did on my ia32 system: Note: I have my installation set up in `/l4hurd` and I am starting from within the Pistachio source top-level directory. $ mkdir build $ cd build $ ../user/configure --with-s0-linkbase=0x40000 --prefix=/l4hurd $ make $ make install $ mkdir /l4hurd/boot $ cp kernel/ia32-kernel /l4hurd/boot Hopefully everything worked and there were no problems. As usual, if the build fails then scrutinize the output from `configure` and install any missing libraries or development packages. ### CVS l4hurd #### Getting the sources You need to pull the L4 Hurd sources from the CVS tree on Savannah. The main page is [GNU/Hurd on L4 - Summary](http://savannah.nongnu.org/projects/l4hurd/) and the CVS access page is [GNU/Hurd on L4 - CVS](http://savannah.nongnu.org/cvs/?group=l4hurd). In a nutshell, the following commands should retrieve the sources for you: $ export CVS_RSH="ssh" $ cvs -z3 -d:ext:anoncvs@savannah.nongnu.org:/cvsroot/l4hurd co l4hurd #### Compiling Take a look at the README, compiling should be quite simple on any state of the art GNU development system. As per the README, and for my example, you would: $ autoreconf -f -i -s $ ./configure --enable-maintainer-mode --prefix=/l4hurd $ make $ make install $ mkdir /l4hurd/boot $ cp laden/laden /l4hurd/boot $ cp wortel/wortel /l4hurd/boot $ cp physmem/physmem /l4hurd/boot In my case it was slightly more complicated as Debian uses a wrapper system to enable the use of multiple versions of the GNU Autotools. In this case, the trick is to utilize some environment variables on the command line as follows: $ ACLOCAL=aclocal-1.8 AUTOMAKE=automake-1.8 autoreconf -f -i -s As above, hopefully this will compile cleanly; otherwise, scroll up, read any error messages, and correct them by installing required packages of the proper version. Any bad compilation problems are most likely due to you either missing or using a wrong version of something. ## Installing The binaries are now installed into `/l4hurd`. All that remains is to add an entry into GRUB's `menu.lst` in order to test it out. Here's an example from my system where I have `/l4hurd` on `/dev/hda9` in my Linux system: title GNU Hurd on L4Ka Pistachio 0.4 root (hd0,8) kernel /boot/laden -D module /boot/ia32-kernel module /libexec/l4/sigma0 module /boot/wortel -D module /boot/physmem ## Booting For me at least, I got some nifty messages and then it dropped into a simple debugging mode. As far as I know, thats all there is right now. Read, build, learn, code... --todo: add more here. ## Experimenting Well, thats why you did all of this, certainly not to do anything else. Use that debugger and get experimenting. --todo: things to do wth the debugger ## Conclusion If you followed these steps, you most likely have built and booted the latest version of Hurd on L4. I would encourage you to subscribe to the mailing list at the following URL and help in the efforts to get this nifty system up to speed: [l4-hurd mailing list](http://lists.gnu.org/mailman/listinfo/l4-hurd) And finally, this is a wiki, meaning that **you** have the ability to edit and modify this page. If you want to fix something, add more information, new sub-pages, whatever, feel free to do so. This is a great way to get a doc base up fast and keep it current, so use it like its supposed to be and have fun with Hurd on L4! -- [[Main/BDouglasHilton]] - 20 Jun 2004