script to debug with qemu and gdb
This commit is contained in:
parent
3ec479833b
commit
c99a319d34
2 changed files with 10 additions and 4 deletions
8
makefile
8
makefile
|
@ -7,11 +7,11 @@ disk: kernel boot
|
|||
dd if=out/kernel.bin of=obj/shadow.img seek=1 conv=notrunc
|
||||
mv obj/shadow.img out/disk.img
|
||||
|
||||
vbox-image: disk
|
||||
vdi-file: disk
|
||||
VBoxManage convertfromraw out/disk.img out/disk.vdi --uuid a61929ed-3bf2-45ff-b98a-44f87c616dba
|
||||
|
||||
kdump: kernel
|
||||
objdump -M intel -d obj/kernel.elf > out/kernel.dasm
|
||||
debug: vdi-file
|
||||
gdb -x qemu-debug.gdb
|
||||
|
||||
kgccargs = -m32 -ffreestanding -fno-asynchronous-unwind-tables
|
||||
kernel:
|
||||
|
@ -33,4 +33,4 @@ boot:
|
|||
nasm src/boot.asm -o out/boot.bin
|
||||
|
||||
clean:
|
||||
rm -r obj out
|
||||
rm -r obj out
|
||||
|
|
6
qemu-debug.gdb
Normal file
6
qemu-debug.gdb
Normal file
|
@ -0,0 +1,6 @@
|
|||
target remote | qemu-system-i386 -S -gdb stdio out/disk.img
|
||||
add-symbol-file obj/kernel.elf
|
||||
set disassembly-flavor intel
|
||||
layout reg
|
||||
break *0x30000
|
||||
cont
|
Reference in a new issue