summaryrefslogtreecommitdiff
path: root/microkernel/mach
diff options
context:
space:
mode:
Diffstat (limited to 'microkernel/mach')
-rw-r--r--microkernel/mach/gnumach/boot_trace.mdwn13
-rw-r--r--microkernel/mach/gnumach/building.mdwn124
-rw-r--r--microkernel/mach/gnumach/debugging.mdwn59
-rw-r--r--microkernel/mach/gnumach/hardware_compatibility_list.mdwn17
-rw-r--r--microkernel/mach/gnumach/hardware_compatibility_list/discussion.mdwn29
-rw-r--r--microkernel/mach/gnumach/ports.mdwn8
-rw-r--r--microkernel/mach/gnumach/ports/xen.mdwn36
-rw-r--r--microkernel/mach/memory_object/discussion.mdwn67
-rw-r--r--microkernel/mach/mig/gnu_mig/building.mdwn82
-rw-r--r--microkernel/mach/mig/gnu_mig/building/discussion.mdwn16
-rw-r--r--microkernel/mach/port.mdwn26
11 files changed, 360 insertions, 117 deletions
diff --git a/microkernel/mach/gnumach/boot_trace.mdwn b/microkernel/mach/gnumach/boot_trace.mdwn
index d33ef25a..1badf712 100644
--- a/microkernel/mach/gnumach/boot_trace.mdwn
+++ b/microkernel/mach/gnumach/boot_trace.mdwn
@@ -1,12 +1,13 @@
-[[!meta copyright="Copyright © 2007, 2008 Free Software Foundation, Inc."]]
+[[!meta copyright="Copyright © 2007, 2008, 2011 Free Software Foundation,
+Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
`if NCPUS > 1` stuff is not being considered so far.
@@ -215,6 +216,12 @@ is included in the section entitled
>> kern/bootstrap.c: bootstrap\_create
+>>> The [[grub/multiboot]] modules have been put somewhere into memory by
+>>> [[GRUB]]. The boot scripts are parsed. The modules' ELF image's `PT_LOAD`
+>>> sections are \`\`read'' (that is, `vm_allocate` and `copyout`) and turned
+>>> into real [[task]]s. The multiboot modules' memory regions can be
+>>> deallocated then.
+
>> [...]
>> vm\_pageout
diff --git a/microkernel/mach/gnumach/building.mdwn b/microkernel/mach/gnumach/building.mdwn
index 99e566bb..427fb083 100644
--- a/microkernel/mach/gnumach/building.mdwn
+++ b/microkernel/mach/gnumach/building.mdwn
@@ -1,3 +1,14 @@
+[[!meta copyright="Copyright © 2006, 2007, 2008, 2011 Free Software Foundation,
+Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
# Building [[GNU_Mach|gnumach]] from Source
If you want to build the [[GNU_Mach|gnumach]] kernel yourself instead of just using a
@@ -8,55 +19,32 @@ enabled) is around 50 MiB.
## Getting the Source Code
-### Developers's RCS
-
-See <http://savannah.gnu.org/cvs/?group=hurd>.
-
- $ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/hurd co -r gnumach-1-branch gnumach
-
-(Most probably you want to get hold of the *GNU Mach 1 branch* and not the
-trunk, which is also what we've done above.)
-
-You then have to create the automatically generatable files:
-
- $ ( cd gnumach && autoreconf --install )
+You can either use the git repository (see <http://git.savannah.gnu.org/cgit/hurd/>),
-### What Debian is currently using
+ $ git clone http://git.savannah.gnu.org/cgit/hurd/gnumach.git/
-See [here](http://packages.debian.net/source/unstable/gnumach).
+... or get the Debian sources, if you're using Debian. (See
+[here](http://packages.debian.net/source/unstable/gnumach).)
$ apt-get source gnumach
Please see the Debian [[running/debian/FAQ]] before using `apt-get source`.
-## Preparing for the Build
+## On Debian Systems:
-### ... on Debian systems
+### Preparing for the Build
-Building GNU Mach requires the *build-essential* and *fakeroot* packages, their
-dependencies and additional packages that are specified by the source gnumach
-package:
+Building GNU Mach requires the *build-essential* and *fakeroot* packages,
+and some additional dependencies specified by the gnumach source package:
# apt-get install build-essential fakeroot
# apt-get build-dep gnumach
-### ... on non-Debian systems
+### Building and Installing ... Debian `.deb` files
-Apart from the case that you only want to install GNU Mach's header files (see
-below), building GNU Mach requires you to have the Mach Interface Generator
-installed. See [[building_MIG|mig/gnu_mig/building]] about how to do that, then come
-back here.
+Change into the directory with the downloaded / unpacked GNU Mach sources,
-Additionally, building GNU Mach requires a C compiler, a standard C library and
-your favourite flavor of awk (gawk) and GNU make.
-
-## Building and Installing
-
-### ... Debian `.deb` files
-
-Change into the directory with the downloaded / unpacked GNU Mach sources, e.g.
-
- $ cd gnumach-20050801
+ $ cd gnumach-XXXXXXXX
Start the build process with
@@ -64,48 +52,68 @@ Start the build process with
[[GNU_Mach|gnumach]] is now building. To use the new kernel, you must install the
resulting `.deb` package which is located one directory above the build
-directory and has a similar name as the build directory, e.g.
+directory and has a similar name as the build directory:
- # dpkg -i ../gnumach_20050801-4_hurd-i386.deb
+ # dpkg -i ../gnumach_XXXXXXXX-X_hurd-i386.deb
You can now reboot your computer and enjoy the new kernel.
-### [TODO]
+## On non-Debian Systems:
-GNU Mach should be built in a separate directory:
+### Preparing for the Build
- $ mkdir gnumach-build
- $ cd gnumach-build
+Building GNU Mach requires a C compiler, a _static_ 32 bit standard C library,
+your favourite flavor of awk (gawk) and GNU make.
-Find the path to your GNU Mach sources (`[...]/gnumach-1-branch`) and configure
-it:
+First, create the configuartion files:
- $ [...]/gnumach-1-branch/configure [TODO]
+ $ cd gnumach
+ $ autoreconf --install
-Build the kernel image:
+GNU Mach (and the associated headers) need be built in a separate build directory:
- $ make gnumach.gz
+ $ mkdir build
+ $ cd build
-Optionally run the (tiny) test suite:
+Run configure:
- $ make check
+ $ ../configure --prefix=
-You can then install and use `gnumach.gz`.
+If building on a 64 bit host system,
+you need a number of additional settings to force a 32 bit build:
-[TODO.]
+ $ CPP='gcc -m32 -E -x c -undef -ansi' CC='gcc -m32' LD='ld -melf_i386' ../configure --prefix= --host=i686-unknown-linux-gnu
-### Installing only the Header Files
+### Installing the Header Files First
-GNU Mach should be built in a separate directory:
+In order to build GNU Mach, you will need a working MIG.
+Building MIG in turn requires the GNU Mach header files to be already present.
+So for bootstrapping MIG, you have to install the Mach headers first,
+for example into `~/gnu/include/`:
- $ mkdir gnumach-build
- $ cd gnumach-build
+ $ make DESTDIR=~/gnu install-data
-Find the path to your GNU Mach sources (`[...]/gnumach-1-branch`) and configure
-it:
+Now you can [[build_MIG|mig/gnu_mig/building]].
+Once you are done with that, come back here to finish the Mach build.
- $ [...]/gnumach-1-branch/configure --prefix=
+### Building and Installing
-Install the header files into e.g. `~/gnu/include/`:
+With MIG present, now build the kernel image:
+
+ $ make gnumach.gz
+
+Optionally run the (tiny) test suite:
+
+ $ make check
+
+It's a good idea to make a backup of the previously installed kernel, in case
+you can't boot using the new one. That way, you can restore it after booting
+from a rescue media (or mounting the disk image used by your vm).
+
+ # cp /boot/gnumach.gz /boot/gnumach.gz.bak
+
+GNU Mach can now be moved into place, typically `/boot/gnumach.gz`, so that you
+can boot your system with the new kernel.
+
+ # cp gnumach.gz /boot
- $ make DESTDIR=~/gnu install-data
diff --git a/microkernel/mach/gnumach/debugging.mdwn b/microkernel/mach/gnumach/debugging.mdwn
index 2f52adf8..f657e7cc 100644
--- a/microkernel/mach/gnumach/debugging.mdwn
+++ b/microkernel/mach/gnumach/debugging.mdwn
@@ -9,15 +9,70 @@ Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
is included in the section entitled [[GNU Free Documentation
License|/fdl]]."]]"""]]
+Here are some hints to debug with GNU Mach.
+
+[[!toc levels=2]]
+
+
+# Kernel Debugger
+
Mach has a built-in kernel debugger.
[Manual](http://www.gnu.org/software/hurd/gnumach-doc/Kernel-Debugger.html).
+First, make sure to enable it. Either by using a pre-packaged gnumach-image-something-dbg, or by passing --enable-kdb to the ./configure invocation.
+
+Then, reproduce the issue again. If something like a kernel trap happens, you will end up in the GNU Mach debugger. Otherwise, type control-alt-d to make Mach enter it by hand.
+
+If you are running in kvm or qemu, it is convenient to use the curses frontend to be able to copy/paste.
+
+To get the register values, type
+
+ show registers
+
+To get a backtrace, type trace, which will print both function return addresses and function parameters, such as
+
+ 0x107cf1(8088488,5e,40000008,2aa008,0)
+ 0x1071bc(0,0,0,0,0)
+ 0x106831(24fe00,2000,b,800,0)
+
+Run the addr2line tool on the return addresses:
+
+ $ addr2line -i -f -e /boot/gnumach 0x107cf1 0x1071bc 0x106831
+
+This will print the source code lines of the backtrace.
+
+To examine the backtrace of some given thread, use
+
+ show all thread/u
+
+to get the whole listing of all tasks and threads. You can then use trace/t to trace a specific thread.
+
+Unfortunately, userland and kernelland use the same range of addresses, so one can not get userland traces easily. The Xen port uses different ranges, and in that case one can use trace/u to also get the userland trace.
+
+To examine a variable, use nm /boot/gnumach to get the address of the variable (e.g. 0x123400), and use
+
+ x 0x123400
+
+to read it. One can also write to it by using
+
+ w 0x123400
+
+Another interesting feature is watching a variable, by using
+
+ watch 0x123400
+
+and then type continue, to let Mach continue execution. The debugger will be entered again on any change in that variable. The watch is implemented in hardware, so it does not disturb or slow down execution at all.
+
+
+# GDB in QEMU
When you're [[running_a_system_in_QEMU|hurd/running/qemu]] you can directly
[use GDB on the running
kernel](http://www.nongnu.org/qemu/qemu-doc.html#SEC48).
+# Code Inside the Kernel
+
Alternatively you can use an approach like this one: add the following code
snippet to `device/ds_routines.c`'s `ds_device_open` function, right at the top
of the function, and modify the code as needed.
@@ -56,6 +111,8 @@ This is especially useful if you need to manually trigger some stuff inside the
running kernel, as with the *D1* example.
+## Writing to the Screen Buffer
+
If you're doing real low level debugging, you might want to put variations of
the following snipped into the code, this code will write a `#` character at
line `[LINE]`, column `[COLUMN]` on the screen:
@@ -69,6 +126,8 @@ some place when running the kernel inside QEMU, as QEMU somehow decides not to
update its display buffer anymore under certain conditions.
+# Halting the CPU and Examining Registers
+
IRC, freenode, #hurd, 2011-07-14:
<braunr> one ugly trick i use when printf isn't available is to halt the
diff --git a/microkernel/mach/gnumach/hardware_compatibility_list.mdwn b/microkernel/mach/gnumach/hardware_compatibility_list.mdwn
index 2152c079..874f5f07 100644
--- a/microkernel/mach/gnumach/hardware_compatibility_list.mdwn
+++ b/microkernel/mach/gnumach/hardware_compatibility_list.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2007, 2008, 2009 Free Software Foundation,
+[[!meta copyright="Copyright © 2007, 2008, 2009, 2011 Free Software Foundation,
Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
@@ -6,8 +6,8 @@ id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
# CPU Architecture
@@ -29,7 +29,7 @@ Read about further [[ports]].
# Memory
-GNU Mach will use a maximum of 1 GiB of RAM. If your system has more,
+GNU Mach will use a maximum of 1.7 GiB of RAM. If your system has more,
the surplus will silently be ignored. (In past times, this would hinder GNU
Mach from booting at all, but this has been fixed, so you no longer need to
apply GRUB's `uppermem` directive.)
@@ -68,10 +68,11 @@ All common IDE drives should work. Some drive geometries do not work,
e.g. drives with hundreds of GiB of storage space, see [[!GNU_Savannah_bug
26425]].
-[[!toggle id="SATA" text="SATA drives may work in compatibility mode."]]
-<!-- Sure? --[[tschwinge]] -->
-[[!toggleable id="SATA" text="""
+## SATA
+
+SATA drives may work in compatibility mode.
+
This is how booting a [[GNU/Hurd_system|hurd]] will typically fail if GNU Mach
couldn't connect to the hard disk, e.g., in a SATA system without IDE
compatibility mode:
@@ -81,7 +82,7 @@ compatibility mode:
There *may* be an option in the system's BIOS setup to configure enabling such
a compatibility mode.
-"""]]
+
# Device Drivers
diff --git a/microkernel/mach/gnumach/hardware_compatibility_list/discussion.mdwn b/microkernel/mach/gnumach/hardware_compatibility_list/discussion.mdwn
index 69ca3190..2b65956a 100644
--- a/microkernel/mach/gnumach/hardware_compatibility_list/discussion.mdwn
+++ b/microkernel/mach/gnumach/hardware_compatibility_list/discussion.mdwn
@@ -1,4 +1,33 @@
+[[!meta copyright="Copyright © 2007, 2008, 2011 Free Software Foundation,
+Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+[[!tag open_issue_documentation]]
+
Further information may still be found on
<http://www.nongnu.org/thug/gnumach_hardware.html>
and could perhaps be incorporated into that page.
--[[tschwinge]]
+
+
+# SATA
+
+IRC, freenode, +hurd, 2011-07-24
+
+ <braunr> youpi: concerning the ide compatibility problem, it seems some
+ bioses provide several modes
+ <braunr> youpi: "legacy ide" and "native ide"
+ <braunr> i don't know what native ide really means, but when debugging ide
+ probing in gnumach, it just looks like there is nothing to detect
+ <braunr> and even in this mode, linux uses the ahci driver
+ <youpi> apparently native means it still uses the IDE protocol, but
+ possibly with other IRQs
+ <youpi> i.e. you need a PCI driver to handle that
+ <braunr> ok
diff --git a/microkernel/mach/gnumach/ports.mdwn b/microkernel/mach/gnumach/ports.mdwn
index afc91d7a..f114460c 100644
--- a/microkernel/mach/gnumach/ports.mdwn
+++ b/microkernel/mach/gnumach/ports.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2007, 2008, 2009 Free Software Foundation,
+[[!meta copyright="Copyright © 2007, 2008, 2009, 2011 Free Software Foundation,
Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
@@ -6,8 +6,8 @@ id="license" text="Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no Invariant
Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
-is included in the section entitled
-[[GNU Free Documentation License|/fdl]]."]]"""]]
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
* x86. This is the main port.
@@ -20,3 +20,5 @@ is included in the section entitled
started, but isn't in a usable state either.
* MIPS. Status completely unknown.
+
+ * [[open_issues/Mach_on_Top_of_POSIX]]. Status unknown.
diff --git a/microkernel/mach/gnumach/ports/xen.mdwn b/microkernel/mach/gnumach/ports/xen.mdwn
index af431c92..5fe73c06 100644
--- a/microkernel/mach/gnumach/ports/xen.mdwn
+++ b/microkernel/mach/gnumach/ports/xen.mdwn
@@ -79,20 +79,40 @@ Then use
The current `hurd-modules` was built from the debian packages `hurd 20070606-2` and `libc0.3 2.6.1-1`.
/!\ This means that when using this image, your GNU/Hurd system also needs to be a glibc version 2.6 or later-based one!
+# `pv-grub`
-# Miscellaneous
+From Xen 4.0 on you can run the GNU Hurd directly using `pv-grub`,
+without the need to [prepare a special bootstrap
+image](http://youpibouh.thefreecat.org/hurd-xen/build_hurd-modules) (like an
+initrd).
-[[Internals]].
+Download http://youpibouh.thefreecat.org/hurd-xen/pv-grub.gz into /boot, and use the following for instance:
-[[!GNU_Savannah_task 5468]], [[!GNU_Savannah_task 6584]].
+ kernel = "/boot/pv-grub.gz"
+ memory = 256
+ disk = ['phy:sda4,hda,w']
+ extra = "(hd0,1)/boot/grub/menu.lst"
+ vif = [ '' ]
+extra is now the path to the grub config file.
-# `pv-grub`
+# Partitions
-From Xen 4.0 on you'll be able to run the GNU Hurd directly using `pv-grub`,
-without the need to [prepare a special bootstrap
-image](http://youpibouh.thefreecat.org/hurd-xen/build_hurd-modules) (like an
-initrd).
+You will need the following notation for the gnumach root= parameter:
+
+root=part:2:device:hd0
+
+to access the second partition of hd0, for instance.
+
+You will also need to use the parted storeio module for the /dev entries, for instance:
+
+settrans -fgap /dev/hd0s1 /hurd/storeio -T typed part:1:device:hd0
+
+# Miscellaneous
+
+[[Internals]].
+
+[[!GNU_Savannah_task 5468]], [[!GNU_Savannah_task 6584]].
# Host-side Writeback Caching
diff --git a/microkernel/mach/memory_object/discussion.mdwn b/microkernel/mach/memory_object/discussion.mdwn
new file mode 100644
index 00000000..a2a1514b
--- /dev/null
+++ b/microkernel/mach/memory_object/discussion.mdwn
@@ -0,0 +1,67 @@
+[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+[[!tag open_issue_documentation open_issue_gnumach]]
+
+IRC, freenode, #hurd, 2011-08-05:
+
+ < neal> braunr: For instance, memory objects are great as they allow you to
+ specify the mapping policy in user space.
+ < neal> braunr: But, the policy for determining the eviction order is
+ realized by Mach
+ < neal> braunr: And user-space has no control
+ < braunr> are you referring to the page cache lru approximation and stuff
+ like resource containers ?
+ < neal> I'm not sure what you mean by page cache lru appoximateion
+ < braunr> the kernel eviction policy :)
+ < neal> that's an implementation detail
+
+IRC, freenode, #hurd, 2011-09-05:
+
+ <braunr> mach isn't a true modern microkernel, it handles a lot of
+ resources, such as high level virtual memory and cpu time
+ <braunr> for example, the page replacement mechanism can't be implemented
+ outside the kernel
+ <braunr> yet, it provides nothing to userspace server to easily allocate
+ resources on behalf of clients
+ <braunr> so, when a thread calls an RPC, the cpu time used to run that RPC
+ is accounted on the server task
+ <braunr> the hurd uses lots of external memory managers
+
+[[external_pager_mechanism]].
+
+ <braunr> but they can't decide how to interact with the page cache
+ <braunr> the kernel handles the page cache, and initiates the requests to
+ the pagers
+ <cjuner> braunr, why can't they decide that?
+ <braunr> because it's implemented in the kernel
+ <braunr> and there is nothing provided by mach to do that some other way
+ <slpz_> braunr: you probably already know this, but the problem with client
+ requests being accounted on behalf the server, is fixed in Mach with
+ Migrating Threads
+
+[[open_issues/mach_migrating_threads]].
+
+ <braunr> slpz_: migrating threads only fix the issue for the resources
+ managed by mach, not the external servers
+ <braunr> slpz_: but it's a (imo necessary) step to completely solve the
+ issue
+ <braunr> in addition to being a great feature for performance (lighter
+ context switchers, less state to track)
+ <braunr> it also helps priority inversion problems
+ <slpz_> braunr: I was referring just to cpu-time, but I agree with you an
+ interface change is needed for external pagers
+ <braunr> slpz_: servers in general, not necessarily pagers
+ <slpz_> as a way to mitigate the effect of Mach paging out to external
+ pagers, the folks at OSF implemented an "advisory pageout", so servers
+ are "warned" that they should start paging out, and can decide which
+ pages are going to be flushed by themselves
+
+[[open_issues/resource_management_problems]].
diff --git a/microkernel/mach/mig/gnu_mig/building.mdwn b/microkernel/mach/mig/gnu_mig/building.mdwn
index f92f7dbe..e7d3c150 100644
--- a/microkernel/mach/mig/gnu_mig/building.mdwn
+++ b/microkernel/mach/mig/gnu_mig/building.mdwn
@@ -1,15 +1,28 @@
+[[!meta copyright="Copyright © 2006, 2007, 2008, 2011 Free Software Foundation,
+Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
# <a name="Building_the_Mach_Interface_Gene"> Building the Mach Interface Generator from Source </a>
-If you want to build the Mach Interface Generator yourself instead of just using a pre-built package, follow these instructions.
+If you want to build the Mach Interface Generator yourself instead of just
+using a pre-built package, follow these instructions.
## <a name="Getting_the_Source_Code"> Getting the Source Code </a>
You can chose between getting the [sources from the developers'
-RCS](http://savannah.gnu.org/cvs/?group=hurd):
+RCS](http://git.savannah.gnu.org/cgit/hurd/):
- $ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/hurd co mig
+ $ git clone http://git.savannah.gnu.org/cgit/hurd/mig.git/
-... or (if you are working on a Debian system) the ones that are used for the [current Debian mig package](http://packages.debian.net/source/unstable/mig):
+... or (if you are working on a Debian system) get the sources that are used for the
+[current Debian mig package](http://packages.debian.net/source/unstable/mig):
$ apt-get source mig
@@ -17,53 +30,70 @@ Please see the Debian [[hurd/running/debian/FAQ]] before using _apt-get source_.
The unpacked source tree is around 1 MiB, and the build tree also is around 1 MiB.
-## <a name="Preparing_for_the_Build"> Preparing for the Build </a>
+## <a name="_on_Debian_systems"> On Debian Systems: </a>
-### <a name="_on_Debian_systems"> ... on Debian systems </a>
+### <a name="Preparing_for_the_Build"> Preparing for the Build </a>
-Building the Mach Interface Generator requires the _build-essential_ and _fakeroot_ packages, their dependencies and additional packages that are specified by the source mig package:
+Building MIG requires the *build-essential* and *fakeroot* packages,
+and some additional dependencies specified by the mig source package:
# apt-get install build-essential fakeroot
# apt-get build-dep mig
-### <a name="_on_non_Debian_systems"> ... on non-Debian systems </a>
+### <a name="Building_and_Installing"> Building and Installing </a> <a name="_a_deb_file"> ... a _.deb_ file </a>
-Building the Mach Interface Generator requires a C compiler, a standard C library (with corresponding header files) and your favourite flavor of awk (gawk), yacc (bison), lex (flex) and make.
+Change into the directory with the downloaded / unpacked MIG sources:
-Additionally, you need to have GNU Mach's header files installed. See
-[[mach/gnumach/building]] about how to do that, then come back here.
+ $ cd mig-X.X.X.XX
-## <a name="Building_and_Installing"> Building and Installing </a>
+Start the build process:
-### <a name="_a_deb_file"> ... a _.deb_ file </a>
+ $ dpkg-buildpackage -us -uc -b -rfakeroot
-Change into the directory with the downloaded / unpacked MIG sources (_mig-1.3.1.99_):
+This will create a _.deb_ package in the parent directory,
+which you can then install on your system.
- $ cd mig-1.3.1.99
+## <a name="_on_non_Debian_systems"> On non-Debian Systems: </a>
-Start the build process:
+### <a name="Preparing_for_the_Build"> Preparing for the Build </a>
- $ dpkg-buildpackage -us -uc -b -rfakeroot
+Building the Mach Interface Generator requires a C compiler, a standard 32 bit
+C library (with corresponding header files), your favourite flavor of awk
+(gawk), yacc (bison), lex (flex) and make.
-You can then install / distribute the _.deb_ file which will drop out one directory above the current one.
+Additionally, you need to have GNU Mach's header files installed. See
+[[building GNU Mach|mach/gnumach/building]] about how to do that, then come back here.
+
+### <a name="Building_and_Installing"> Building and Installing </a>
+
+First, generate the configuration files:
-### <a name="_TODO_"> [TODO] </a>
+ $ cd mig
+ $ autoreconf --install
-The Mach Interface Generator has to be built in a separate directory:
+The Mach Interface Generator has to be built in a separate build directory:
- $ mkdir mig-build
- $ cd mig-build
+ $ mkdir build
+ $ cd build
+
+Find the base directory where you installed GNU Mach's header files and where
+you now intend to install the Mach Interface Generator (e.g. _~/gnu_), and run
+configure:
+
+ $ GNU=~/gnu
+ $ TARGET_CPPFLAGS=-I"$GNU"/include ../configure --prefix="$GNU"
-Find the root directory where you installed GNU Mach's header files and where you now intend to install the Mach Interface Generator (_~/gnu_) and the path to your Mach Interface Generator sources (\_[...]/mig) and configure it:
+If you are building on a 64 bit machine, you need to add a --host option:
$ GNU=~/gnu
- $ TARGET_CPPFLAGS=-I"$GNU"/include [...]/mig/configure --prefix="$GNU"
+ $ TARGET_CPPFLAGS=-I"$GNU"/include ../configure --prefix="$GNU" --host=i686-unknown-linux-gnu
-Build and install the Mach Interface Generator into _$GNU_, i.e. _~/gnu/_ in our example:
+Build and install the Mach Interface Generator into _$GNU_ (i.e. _~/gnu/_ in our example):
$ make all install
-To make your _mig_ binary easily available, you should append something like the following to e.g. your _~/.bash\_profile_:
+To make your _mig_ binary easily available, you should append something like
+the following to e.g. your _~/.bash\_profile_:
PATH=~/gnu/bin:$PATH
export PATH
diff --git a/microkernel/mach/mig/gnu_mig/building/discussion.mdwn b/microkernel/mach/mig/gnu_mig/building/discussion.mdwn
new file mode 100644
index 00000000..d7636158
--- /dev/null
+++ b/microkernel/mach/mig/gnu_mig/building/discussion.mdwn
@@ -0,0 +1,16 @@
+[[!meta copyright="Copyright © 2011 Free Software Foundation, Inc."]]
+
+[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
+id="license" text="Permission is granted to copy, distribute and/or modify this
+document under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no Invariant
+Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license
+is included in the section entitled [[GNU Free Documentation
+License|/fdl]]."]]"""]]
+
+# Non-cross-compiling
+
+[[!tag open_issue_mig]]
+
+[[samuelthibault]] mentioned that I should make clear what compiler options, etc. are only needed if compiling on a 64 bit computer. However, I don't know if the --host=i686... option is needed, here and when making gnumach, in case there may be some other default on 32 bit computers? --[[sudoman]]
+
diff --git a/microkernel/mach/port.mdwn b/microkernel/mach/port.mdwn
index ba2e22c2..26b55456 100644
--- a/microkernel/mach/port.mdwn
+++ b/microkernel/mach/port.mdwn
@@ -1,4 +1,4 @@
-[[!meta copyright="Copyright © 2002, 2003, 2007, 2008, 2010 Free Software
+[[!meta copyright="Copyright © 2002, 2003, 2007, 2008, 2010, 2011 Free Software
Foundation, Inc."]]
[[!meta license="""[[!toggle id="license" text="GFDL 1.2+"]][[!toggleable
@@ -10,8 +10,8 @@ is included in the section entitled [[GNU Free Documentation
License|/fdl]]."]]"""]]
[[Mach]] *port*s are [[capabilities|capability]], and are also essentially
-similar to [[UNIX]] pipes. They are communication channels, implemented by
-kernel queues.
+similar to [[UNIX]] pipes. They are unforgeable communication channels,
+implemented by kernel queues.
Each port has associated with it one *receive right* and one or more *send
right*s and *send-once right*s. That is, there is one receiver and one or more
@@ -39,7 +39,7 @@ like [[UNIX file descriptors|unix/file_descriptor]]. Only these local names
can be used by [[thread]]s for invoking operations on ports, threads do not
deal with port rights directly.
-For that, each task has associated with it a *port address_space*, or *port
+For that, each task has associated with it a *port address space*, or *port
name space*. All ports are addressed via this table. Each task thus has its
own private [[naming_context]] for port rights.
@@ -49,7 +49,7 @@ send-once right. These messages are (probably) queued and when the server task
tries to receive messages by having a [[thread]] use its port receive right, it
gets the message(s). This is called [[IPC]].
-Port rights themselvse can be [[delegate]]d in a [[message]], too. When the
+Port rights themselves can be [[delegate]]d in a [[message]], too. When the
receiver dequeues the message, the right is made available to it.
The delivery of [[message]]s is reliable and strictly ordered. When a
@@ -58,20 +58,24 @@ The delivery of [[message]]s is reliable and strictly ordered. When a
intermediate messages that are sent by other threads.
Ports are objects that are implemented by the [[kernel]], and they are
-kernel-protected resources. There is no way for a [[task]] to do anything with
-a port unless it have corresponding port right.
+kernel-protected resources: they are unforgeable, and there is no way for a
+[[task]] to do anything with a port unless it have corresponding port right.
Due to this, ports are globally unique. This makes them ideal for constituting
-system-wide *object references*. For example, the [[RPC]] system as used by
-the GNU Hurd works by invoking *methods* on such object references. The
-available methods are defined in [[hurd/interface]] files, and are processes by
-the [[MIG]] tool.
+system-wide *object references*. (Fruther reading:
+{{$capability#wikipedia_object-capability_model}}.) For example, the [[RPC]]
+system as used by the GNU Hurd works by invoking *methods* on such object
+references. The available methods are defined in [[hurd/interface]] files, and
+are processes by the [[MIG]] tool.
Invoking an operation on a port does not transfer the current execution control
to the receiver, but instead is an asynchronous operation. For this, and
especially in a [[RPC]] system, the sender may include a *reply port* using a
send-once right, and synchronize (block) on that one.
+
+# Port Set
+
A [[thread]] can only block receiving on a single port. To work around this,
the concept of a *port set* was introduced. A receive right can be added to
(at most) one port set. These port sets look like port receive rights, but