## Table of Contents
%TOC%
This is a brief HowTO building OSKit-Mach (a.k.a GNUmach 2.0). It covers everything from getting the latest sources of both the [OSKit](http://www.cs.utah.edu/flux/oskit/) and the GNUmach kernel. Down to building and debugging them. There is also [another guide](http://www.etherhogz.org/doc/oskit-mach.html) available.
To be able to actually make use of your recently checked out CVS version of the GNUMach kernel & C:o you need a GNU system of [gnu-20020816.tar.gz](ftp://ftp.funet.fi/pub/gnu/alpha/gnu/hurd/contrib/marcus/gnu-20020816.tar.gz) or later.
## Getting your hands on the source
First you need to checkout the relevant sources.
### The OSKit
**_Sources:_**
* St. Patricks day 2002 release:
* Valentine's day 2001 release:
**_Patches:_**
* Useful patches are available [[OskitPatches]] or on the nearest Debian FTP.
### Accessing the GNU CVS
The recommended document for accessing the Hurd CVS on Savannah is at
This is only a brief restatement, which may be inaccurate. Setup your environment with the `CVSROOT` variable and login as anonymous. How you do this may differ between shells.
$ export CVSROOT=":pserver:anoncvs@anoncvs.gnu.org:/cvsroot/hurd"
$ cvs login # Press Enter when asking for password
**_Gnu Mach:_**
All development, apart from critical bug fixes, is done on the upcoming 2.0 release. Previously the `oskit-branch` of gnumach, now on `HEAD` (the default CVS tag).
$ cvs -z3 co gnumach
In case you have been tracking the oskit-branch and want to move to the current `HEAD` branch you can issue the following instead to update your tree.
$ cd
$ cvs -z3 update -r HEAD -Pd
Where <YOUR MACH DIR> can be `gnumach`, `oskit-mach`, or similar.
_Using `-r HEAD` is a bad thing because this setting is sticky. The right way to get out of a branch is with `update -A`. Ref: `info (cvs)Sticky tags`._ -- [[Main/LaloMartins]] - 01 Jan 2003
**_The Hurd servers:_**
In case you want to build the Hurd servers as well, you can check them out with:
$ cvs -z3 co hurd
**_Inteface generator:_**
See the [[Mig/MachInterfaceGenerator]] for more information.
Check it out using
$ cvs -z3 co mig
## Building
The recommended versions of GCC are
- For the OSKit
- GCC 2.95.X
- For GNUmach and MiG
- GCC 3.2
### The OSKit
Do _not_ forget to apply all known [[OskitPatches]] before starting the build!
The attached [[ATTACHURLmodulesx86pc]], or [[ATTACHURLmodules-lightx86pc]], is an example setup, your needs may vary but this one works for standard COTS PC's. Now, how to configure and build the OSKit.
$ cd oskit-20020317/
$ mkdir build
$ cd build
$ CC=gcc-2.95 \
CFLAGS="-g" \
../configure --prefix=/usr/local \
--enable-debug \
--enable-modulefile=modules-light.x86.pc
$ make
$ sudo make install
### Mach Interface Generator
To build any Mach kernel you need an interface generator, MiG. To be on the safe side, use the CVS version. If you use Debian, you can install package [mig-i386-gnu](http://packages.debian.org/mig-i386-gnu). If you don't use Debian or want to compile MiG by yourself on Linux/\*BSD system, you must first install Mach headers. In Mach directory do:
$ mkdir build
$ cd build
$ ../configure --prefix=/usr # Default prefix is / !
$ sudo make -k install-headers # -k is for ignoring errors
Now you are ready to compile and install MiG (commands are in Mig's source directory):
$ automake --add-missing # sometimes it's needed
$ mkdir build
$ cd build
$ ../configure
$ make
$ sudo make install
### GNUmach 2.0 (OSKit-Mach)
Different to its half sister, the OSKit-Mach kernel does _not_ need a cross compiler. The regular gcc for your x86 Linux system does just fine. However, you might want to use gcc 3.2 with the latest and greatest CVS version of Mach.
**_Configuring:_**
$ cd gnumach
$ mkdir build
$ cd build
$ MIG=/usr/local/bin/mig \
CC=gcc-3.2 \
CFLAGS="-g -O" \
OSKIT_LIBDIR=/usr/local/lib/oskit \
../configure --prefix=/gnu
**_Building:_**
Instead of using `make kernel` to build kernel, in OSKit-Mach you have to use make kernel-DRIVERS
, where DRIVERS is DRIVER+DRIVER+...+DRIVER
(a list of drivers separated by `+`). DRIVER can be one of:
* `ide`
* `floppy`
* ethernet\_ETHDRV
where ETHDRV is taken from `oskit/oskit/dev/linux_ethernet.h`.
* scsi\_SCSIDRV
where SCSIDRV is taken from `oskit/oskit/dev/linux_scsi.h`.
Thus, to build a IDE capable kernel with 3Com Vortex Boomerang support you use the following:
$ make kernel-ide+ethernet_vortex
$ sudo make install
$ sudo gzip -f /gnu/boot/oskit-mach
If you want to use tftp to download the kernel from Grub and don't care about the symbols I recommend either stripping or removing the `--enable-debug` and `-g` statements.
## Debugging
See the [[Mach/RemoteDebugOskitMach]] page.
## Attachments
* [[ATTACHURLmodulesx86pc]]: Modules to build in OSKit
* [[ATTACHURLmodules-lightx86pc]]: Lighter version of required modules for building GNUmach
----
## Comments:
_I think this is a bug that you have to specify $prefix/lib/oskit as OSKIT\_LIBDIR when configuring oskit-mach. Libdir is usually just $prefix/lib._ -- [[Main/MichalSuchanek]]
_I think not. The $prefix variable in autoconf comes from the --prefix option to configure, that in turn is intended as the prefix path to the installation of the package you are configuring, i.e. oskit-mach and **NOT** the OSKit itself_ -- [[Main/JoachimNilsson]]
_I refer to the $prefix value at the time oskit is built. Of course, you can choose a different prefix for oskit-mach._ -- [[Main/MichalSuchanek]]
_I see, it was not that clear the context of your first comment, well anyhow when reality changes so will this page. :)\__ -- [[Main/JoachimNilsson]]
----
## Blame annotations:
First version. -- [[Main/JoachimNilsson]] - 14 May 2002
Updated by: -- [[Main/LuisBustamante]] - 04 Jun 2002
Moving from oskit-branch to HEAD. -- [[Main/JoachimNilsson]] - 05 Jun 2002
Add instructions on compiling MiG. -- [[Main/OgnyanKulev]] - 15 Dec 2002
Replaced commands' prompt # with $ and other minor changes. -- [[Main/OgnyanKulev]] - 20 Dec 2002