debug using bochs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
firas981

debug using bochs

Post by firas981 »

bona fides website tutorial about bochs is very good , however
it didn't talk about debugging , and bochs user guide was blured to me , can any body explain to me in just few words how i can debug my os using bochs ( i.e. execute in single step mode and use breakpoints )

thanks
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:debug using bochs

Post by Neo »

are you using windows or linux?
The general way is to start the BOCHS debugger that comes along with the simulator. this will allow you to use all the debugging commands
to single step through your OS use the 's option'. it should be used with "s <No.Of Steps(default=1)>"
break points are set using the 'lb' (linear breakpoint) option used as "lb <physical address>" to use virtual breakpoints use "vb <seg:off>".
You would of course be better off reading the DOCS. Try to take the time to read and understand the BOCHS documents it really is the best source and explains things quite cleary.
btw which part of it can't you understand? have you got a bootloader image etc setup to run in BOCHS??
Only Human
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:debug using bochs

Post by Candy »

Breakpoint (linear): b <address>
instruction trace: trace-on / trace-off
CPU status (states if multi-cpu): dump_cpu
continue execution: c
interrupt execution: ctrl-c
explore memory: xp /<numbytes>xb <address>
x stands for hex output, b stands for per byte

HTH, C&CW, Candy

PS: Thanks for the vb :) didn't know that one
Post Reply