This section covers how you can use Bochs with a remote GDB stub to debug your kernel.
The GDB stub is not active in standard Bochs binary package. So you must recompile Bochs. Download the Bochs source package, unpack it and run the configure script with the --enable-gdb-stub argument.
$ ./configure --enable-gdb-stub |
Enable the gdbstub option in bochsrc, then just start Bochs as normal. Bochs will stop and wait for GDB to connect to the stub.
Bochs GDB stub waits for a connection on TCP port 1234. Just start GDB like this:
$ gdb YOUR-KERNEL . . . (gdb) target remote localhost:1234 Remote debugging using localhost:1234 0x0000fff0 in ?? () (gdb) |
Program received signal 0, Signal 0. syscall_testsuite_result (aux=0x1f11fe4) at ../rtmk/syscalls.c:33 33 { (gdb) |