水曜日, 5月 13, 2009

QEMU and GDB to debug bootsector

See Trying to use QEMU and GDB to debug GRUB 2

Start Qemu
  • For Floppy:
    qemu -fda floppya.img  -s -S
  • For CDROM:
    qemu -cdrom grub2.iso -s -S


Start GDB in another console

target remote localhost:1234
; as we start in 16bit real mode
set arch i8086
; set breakpoint in entry point, at begining of GRUB2's CD-ROM boot sector ode.
break *0x7c00
; entered 'c' to start execution until it hit the break point.


; to see where I really was I had to use following command:
x/10i $cs*16+$eip

0 件のコメント: