Boch Debugging

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
Annie
Posts:14
Joined:Thu Feb 12, 2009 9:11 pm
Boch Debugging

Post by Annie » Thu Mar 04, 2010 10:26 am

Hi Mike,

I like the series very much, and trying to follow it.

However, I have a request. Maybe when you got time you can add to the series. It is a chapter to teach how to debug in boch. Sometimes when I ran into problems it is such a pain to find out what is wrong. I guess some knowledge of debugging would help very much.

And very nice chapter on "Graphic" part.

Thank

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Re: Boch Debugging

Post by Andyhhp » Sat Mar 06, 2010 1:43 pm

If you need a quick intro to debugging, read this link

http://bochs.sourceforge.net/cgi-bin/to ... oc/docbook

The 3 sections you need for basic debugging is Execution Control (c s q), Breakpoints (b) and Info sections.
Image

Annie
Posts:14
Joined:Thu Feb 12, 2009 9:11 pm

Re: Boch Debugging (Revisit)

Post by Annie » Tue Mar 16, 2010 10:58 am

hi, thank a lot for the link. I have another question regarding Bochs Debug. Suppose that inside your code you have a function, say Print and its called in the main program. Now if you are stepping the code with Bochs debug, when get to the function call, it will step into the function. Is there away we can step over that, without getting inside?

thanks in advance :D

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: Boch Debugging

Post by Mike » Tue Mar 16, 2010 4:45 pm

Hello,

You can set a breakpoint after the function call instruction and continue execution. When the breakpoint is hit, you will be back into the debugger.

The continue command is "c". There is two ways to make a breakpoint, either using the "b" command in the debugger (for example, b 0x7c00 sets a breakpoint to 0x7c00) or a "magic breakpoint". To enable this, add magic_break: enabled=1 in your configuration file. Now, place a xchg bx, bx instruction at the location you want to set a breakpoint at and it will break into the bochs debugger.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com

Post Reply