0

I was debugging, through the Boot Loader from the FreeDos OS, till I got lost after the interrupt 13h instruction. I use gdb with qemu.

gdb version: 7.11.1
qemu version: 2.5
FreeDos version: 1.2

I got to this point:

int 13h

and then I typed:

si (step instruction)

and then, when I examine the instruction pointer I got this:

add BYTE PTR [bx+si], al

add BYTE PTR [bx+si], al   

add BYTE PTR [bx+si], al

add BYTE PTR [bx+si], al

Obvious there shouldn't come these instructions. There should come:

jb     0xf2

The next thing, is that I can't get out of these weired instructions. They go one forever but when I type c (continue) then the program continues normally. I tried several things but nothing worked out: Set a breakpoint after the int 13h instruction but when I then pressed c the program didn't stopped there. Also I tried to press n or s. Nothing worked.

My setup for qemu:

qemu-system-i386 -localtime freedos.img -boot d -S -s

And for gdb:

gdb -q
target remote localhost:1234
set architecture i8086

Why is this so? What am I missing?

Edit: It's the the check for extensions interrupt.

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
flexw
  • 63
  • 8
  • 3
    For real mode I'd recommend using BOCHS since its internal debugger actually understands real mode segment:offset addressing where as _GDB_ doesn't. I wrote an [answer that may help](http://stackoverflow.com/a/32960272/3857942). There is a link in the answer to a _GDB_ script that adds a new `stepo` instruction to handle a case like calling `int 13h`. – Michael Petch Dec 23 '16 at 18:38
  • Thank you very much for that. It helped. – flexw Dec 23 '16 at 19:02

0 Answers0