You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
When we die due to a fatal exception, we get a debug message that looks like this: Exception #6 from 0x0010:0x000728E9 !!! This message by itself is not incredibly useful for figuring out which code caused the exception. This patch borrows an idea from the Linux kernel, and extends the exception information with a dump of the opcode bytes around the instruction pointer, which means that the exception debug message will now look like this: Exception #6 from 0x0010:0x000728E9 !!! 000728C9: 07 00 6A 40 E8 E0 E8 FF-FF 83 C4 0C 68 00 00 07 [...] 000728D9: 00 68 DA 3A 07 00 6A 40-E8 CC E8 FF FF 83 C4 10 [...] 000728E9: 0F 0B E8 8E F2 FF FF 8D-55 98 80 78 0E 01 8D 45 [...] 000728F9: 94 75 06 52 50 6A 01 EB-04 52 50 6A 00 68 53 47 [...] Tested by inserting a UD2 instruction into Stage1A and verifying on qemu ia32 and on qemu x64 that the right information is printed. Signed-off-by: Lennert Buytenhek <buytenh@arista.com>