summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpasha (biblio) <pasha@bell01.com>2023-05-12 01:04:46 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-05-12 01:04:46 +0200
commit226c696e2952af17c5263fda2bcf37795017fab8 (patch)
tree7f2d37720810b64d06562793c4b292ca2ab7b9fd
parent414a8e4f7e3955b333410b858144dd29131bb2ba (diff)
Add example of 64-bit debugging.
-rw-r--r--microkernel/mach/gnumach/debugging.mdwn35
1 files changed, 35 insertions, 0 deletions
diff --git a/microkernel/mach/gnumach/debugging.mdwn b/microkernel/mach/gnumach/debugging.mdwn
index a134b618..0e4898be 100644
--- a/microkernel/mach/gnumach/debugging.mdwn
+++ b/microkernel/mach/gnumach/debugging.mdwn
@@ -128,6 +128,41 @@ working directory. For example:
## [[open_issues/debugging_gnumach_startup_qemu_gdb]]
+## Debug 64-bit gnumach
+
+[[build|microkernel/mach/gnumach/building/]] 64-bit gnumach
+
+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
+ ...
+ module /hurd/acpi.static acpi \
+ --host-priv-port='${host-port}' --device-master-port='${device-port}' \
+ --next-task='${fs-task}' \
+ '$(acpi-task=task-create)' '$(task-resume)'
+ module /hurd/ext2fs.static ext2fs --readonly \
+ --multiboot-command-line='${kernel-command-line}' \
+ --exec-server-task='${exec-task}' -T typed '${root}' \
+ '$(fs-task=task-create)'
+ module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'
+
+
+
# Code Inside the Kernel