Search code examples
bochs

A command for bochs that skips a "call", "jmp", or "int" instruction


I'm using bochs as a debugger. I use the "s" command to step through my code. My problem is however, that whenever an "int" instruction comes, it starts stepping through BIOS code. Is there a command I can enter to get it to skip all the BIOS code and go back to my code?


Solution

  • I subscribed to the bochs mailing list and sent in an email asking my question. In an email, I got an answer that I should use the "b" command to set a breakpoint after the "int" instruction, like this:

    b <address>
    

    And then I should use the "c" command to continue until the breakpoint.

    Now, in order to figure out what the address of the instruction after the "int" instruction is, I disassembled my code using ndisasm and found the instruction after the "int" instruction:

    0000000A  B40E              mov ah,0xe
    

    I then took 0000000A, added 0x7C00 to it (because the bootfile is loaded into memory starting at 0x7C00) and that's where I set my breakpoint.