From 226c696e2952af17c5263fda2bcf37795017fab8 Mon Sep 17 00:00:00 2001 From: "pasha (biblio)" Date: Fri, 12 May 2023 01:04:46 +0200 Subject: Add example of 64-bit debugging. --- microkernel/mach/gnumach/debugging.mdwn | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'microkernel/mach') 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 -- cgit v1.2.3