>>  Or, is there a gdb method of booting the kernel?

Short answer:
http://openbsd-archive.7691.n7.nabble.com/on-line-kernel-debugging-td335833.html

Long answer:
/dev/kmem (kmem(4)) could be used to access kernel memory.
gdb has special target (kvm) that uses it to debug bsd kernels   (
https://sourceware.org/gdb//onlinedocs/gdb/BSD-libkvm-Interface.html)

so, we need 2 things here:
1) Access to /dev/kmem is disabled by default (due to securelevel(7)).
We need to enable it with "kern.allowkmem=1" in /etc/sysctl.conf
Or we can switch to insecure level (echo "sysctl kernl.securelevel=-1 >
/etc/rc.securelevel")
Make sure to reboot before it.

Never set these values for production system!!

2) Kernel with debug symbols
You can build your kernel (man config).
As last step in "compile" folder you will have /bsd (stripped) and /bsd.gdb
(symbolized)

Then, copy /bsd.gdb to root, reboot and boot it:
boot> boot hd0a:/bsd.gdb

I think we should have article about it in FAQ:)

Reply via email to