mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
remove some more kernel_module- references
make kgdb x86_64 work once again, now pending a decent serial refactor
This commit is contained in:
@@ -1317,7 +1317,7 @@ Useless, but a good way to show how hardcore you are. Disable `lx-symbols` with:
|
||||
From inside guest:
|
||||
|
||||
....
|
||||
insmod /fops.ko
|
||||
insmod /timer.ko
|
||||
cat /proc/modules
|
||||
....
|
||||
|
||||
@@ -1336,7 +1336,8 @@ And then tell GDB where the module was loaded with:
|
||||
|
||||
....
|
||||
Ctrl-C
|
||||
add-symbol-file ../kernel_modules-1.0/fops.ko 0xfffffffa00000000
|
||||
add-symbol-file ../../../rootfs_overlay/x86_64/timer.ko 0xffffffffc0000000
|
||||
0xffffffffc0000000
|
||||
....
|
||||
|
||||
Alternatively, if the module panics before you can read `/proc/modules`, there is a <<pr_debug>> which shows the load address:
|
||||
@@ -1353,6 +1354,8 @@ And then search for a line of type:
|
||||
[ 84.877482] 0xfffffffa00000000 .text
|
||||
....
|
||||
|
||||
Tested on 4f4749148273c282e80b58c59db1b47049e190bf + 1.
|
||||
|
||||
=== GDB step debug early boot
|
||||
|
||||
TODO sucessfully debu the very first instruction that the Linux kernel runs, before `start_kernel`!
|
||||
@@ -1834,8 +1837,6 @@ Bibliography:
|
||||
|
||||
== KGDB
|
||||
|
||||
TODO: only working with <<qemu-graphic-mode>>. Without it, nothing shows on the terminal. So likely something linked to the option `console=ttyS0`.
|
||||
|
||||
KGDB is kernel dark magic that allows you to GDB the kernel on real hardware without any extra hardware support.
|
||||
|
||||
It is useless with QEMU since we already have full system visibility with `-gdb`, but this is a good way to learn it.
|
||||
|
||||
Reference in New Issue
Block a user