summaryrefslogtreecommitdiff
path: root/microkernel/mach/gnumach
diff options
context:
space:
mode:
Diffstat (limited to 'microkernel/mach/gnumach')
-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
7 files changed, 206 insertions, 80 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