diff options
Diffstat (limited to 'microkernel')
-rw-r--r-- | microkernel/mach.mdwn | 4 | ||||
-rw-r--r-- | microkernel/mach/gnumach/building.mdwn | 28 | ||||
-rw-r--r-- | microkernel/mach/gnumach/debugging.mdwn | 41 | ||||
-rw-r--r-- | microkernel/mach/mig/gnu_mig/building.mdwn | 4 | ||||
-rw-r--r-- | microkernel/viengoos.mdwn | 2 |
5 files changed, 58 insertions, 21 deletions
diff --git a/microkernel/mach.mdwn b/microkernel/mach.mdwn index df1a3dab..3abb548d 100644 --- a/microkernel/mach.mdwn +++ b/microkernel/mach.mdwn @@ -24,9 +24,7 @@ microkernel currently used by the [[Hurd]]. # Implementations * [[GNU_Mach|gnumach]] - * [Apple's Darwin](http://developer.apple.com/darwin/) - ([API](http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming/index.html)) - (**non-free**) + * [Apple's XNU (Darwin)](https://github.com/apple-oss-distributions/xnu) (**non-free**) * [[open_issues/OSF_Mach]] diff --git a/microkernel/mach/gnumach/building.mdwn b/microkernel/mach/gnumach/building.mdwn index aed87046..b23985ac 100644 --- a/microkernel/mach/gnumach/building.mdwn +++ b/microkernel/mach/gnumach/building.mdwn @@ -19,16 +19,19 @@ enabled) is around 50 MiB. ## Getting the Source Code -You can either use the git repository (see <http://git.savannah.gnu.org/git/hurd/>), +You can either use the git repository (see <https://git.savannah.gnu.org/git/hurd/>), $ git clone https://git.savannah.gnu.org/git/hurd/gnumach.git/ + $ cd gnumach + $ autoreconf --install -... or get the Debian sources, if you're using Debian. (See +... or get the Debian sources to build a Debian package, if you're using Debian. (See [here](http://packages.debian.net/source/unstable/gnumach).) $ apt source gnumach + $ cd gnumach-XXXXXXXX -## On Debian Systems: +## Building a `.deb` package on Debian Systems: ### Preparing for the Build @@ -40,34 +43,29 @@ and some additional dependencies specified by the gnumach source package: ### Building and Installing ... Debian `.deb` files -Change into the directory with the downloaded / unpacked GNU Mach sources, +Start the build process with - $ cd gnumach-XXXXXXXX + $ dpkg-buildpackage -us -uc -b -Start the build process with +But to get it built faster, you probably want to only build the most common uniprocessor variant: - $ dpkg-buildpackage -us -uc -b -rfakeroot + $ dpkg-buildpackage -us -uc -b -Ppkg.gnumach.onlyup [[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: - # dpkg -i ../gnumach_XXXXXXXX-X_hurd-i386.deb + # dpkg -i ../gnumach-image-1.8-486_*_hurd-i386.deb You can now reboot your computer and enjoy the new kernel. -## On non-Debian Systems: +## Building from the git repository: ### Preparing for the Build Building GNU Mach requires a C compiler, a _static_ 32 bit standard C library, your favourite flavor of awk (gawk) and GNU make. -First, create the configuration files: - - $ cd gnumach - $ autoreconf --install - GNU Mach (and the associated headers) need be built in a separate build directory: $ mkdir build @@ -77,7 +75,7 @@ Run configure: $ ../configure --prefix= -If building on a 64 bit host system, +If building on a Linux 64 bit host system, you need a number of additional settings to force a 32 bit build: $ ../configure --prefix= --host=i686-gnu LD=i686-linux-gnu-ld CC=i686-linux-gnu-gcc diff --git a/microkernel/mach/gnumach/debugging.mdwn b/microkernel/mach/gnumach/debugging.mdwn index a134b618..bcff970e 100644 --- a/microkernel/mach/gnumach/debugging.mdwn +++ b/microkernel/mach/gnumach/debugging.mdwn @@ -73,6 +73,10 @@ and then type continue, to let Mach continue execution. The debugger will be ent struct db_watchpoint watch = { .task = NULL, .loaddr= 0x40e, .hiaddr = 0x40e+2, .link = NULL}; db_set_hw_watchpoint(&watch, 0); +To discover what an arbitrary address points to, try + + whatis 0x123400 + # GDB in QEMU When you're [[running_a_system_in_QEMU|hurd/running/qemu]] you can directly @@ -128,6 +132,43 @@ working directory. For example: ## [[open_issues/debugging_gnumach_startup_qemu_gdb]] +## Debug 64-bit gnumach + +[[build|microkernel/mach/gnumach/building/]] 64-bit gnumach with: + + $ export CFLAGS=-g + $ ../configure --enable-kdb ... + +run a spare Hurd vm (prepare for data loss in vm): + +* `kvm -net user,hostfwd=tcp:127.0.0.1:2222-:22 -net nic,model=e1000 -drive file=$(echo debian-hurd*.img),cache=writeback -m 1G` +* `cd gnumach/build` +* `scp -P 2222 gnumach.gz user@127.0.0.1:/home/user/` +* You may copy `gnumach.gz` (also create new grub entry) or replace using `mv /home/user/gnumach.gz /boot/gnumach-xxx.gz` +* Shutdown vm. +* Append `console=com0` in boot menu and switch to console mode in qemu. (We have known issues with vga output for 64-bit.) +* You may load only required modules for debugging. +* `kvm -s -S -net user,hostfwd=tcp:127.0.0.1:2222-:22 -net nic,model=e1000 -drive file=$(echo debian-hurd*.img),cache=writeback -m 1G` (note: `-s -S` added.) +* `gdb ./gnumach` +* `(gdb) target remote :1234` +* Press `c` to continue booting. + + +example `/boot/grub/grub.cfg`: + + multiboot /boot/gnumach-1.8-486.gz root=part:2:device:hd0 console=com0 + ... + echo 'Loading the Hurd ...' + module /hurd/ext2fs.static ext2fs --readonly \ + --multiboot-command-line='${kernel-command-line}' \ + \ + --host-priv-port='${host-port}' --device-master-port='${device-port}' \ + --exec-server-task='${exec-task}' -T typed '${root}' \ + '$(fs-task=task-create)' '$(task-resume)' + module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)' + + + # Code Inside the Kernel diff --git a/microkernel/mach/mig/gnu_mig/building.mdwn b/microkernel/mach/mig/gnu_mig/building.mdwn index e14c8fb0..eed12e03 100644 --- a/microkernel/mach/mig/gnu_mig/building.mdwn +++ b/microkernel/mach/mig/gnu_mig/building.mdwn @@ -84,10 +84,10 @@ configure: $ GNU=~/gnu $ TARGET_CPPFLAGS=-I"$GNU"/include ../configure --prefix="$GNU" -If you are building on a 64 bit machine, you need to add a --host option: +If you want to build 32-bit gnumach on a 64-bit machine, you need to add a --target option. mig(com) will be build as ELF64 binary, but it will generate 32-bit stub code for gnumach: $ GNU=~/gnu - $ TARGET_CPPFLAGS=-I"$GNU"/include ../configure --prefix="$GNU" --host=i686-unknown-linux-gnu + $ TARGET_CPPFLAGS=-I"$GNU"/include ../configure --prefix="$GNU" --target=i686-gnu TARGET_CC=i686-linux-gnu-gcc Build and install the Mach Interface Generator into _$GNU_ (i.e. _~/gnu/_ in our example): diff --git a/microkernel/viengoos.mdwn b/microkernel/viengoos.mdwn index 66c6ff36..f8643f7f 100644 --- a/microkernel/viengoos.mdwn +++ b/microkernel/viengoos.mdwn @@ -23,7 +23,7 @@ to some of the [[issues_uncovered_by_the_Hurd|challenges]]. Knowledge gained can then be integrated into something like [[Mach]]. The source can be downloaded from the *viengoos.git* repository, cf. -<http://git.savannah.gnu.org/gitweb/?p=hurd/viengoos.git>. You can +<https://git.savannah.gnu.org/gitweb/?p=hurd/viengoos.git>. You can check it out using, for example: git clone git://git.sv.gnu.org/hurd/viengoos.git |