Page 1 of 1
Bochs Debugging
Posted: Mon May 08, 2006 1:13 pm
by LongHorn
Finally i got my os to switch to DPL3 code. Once i got there page fault happened. It's quite expected because i have all my code running at ring0. So i created pagetables and pagedirectory and copied code to appropriate place. Then i got strange errors. I couldn't find the error.
Bochs goes into a LOOP saying CPU_LOOP1 then i have to close the window explicitly. Bochs log file consists of CR3=user cr3 that i set. But no way it could be there. The errors happen even before task switching
So is there really anyway to break when there is a change in CR3 register. Is it possible? i looked down the bochs docs it seems there is no way. Since errors happens at random place i couldn't figure out errors. Tips on debugging plz. Right now i am tracing on from beginning , a painful task.
Re:Bochs Debugging
Posted: Mon May 08, 2006 1:54 pm
by paulbarker
Does anyone think I should add the info about that "CPU_LOOP 1" message to the FAQ?
Just a quick question about this message: do you get the full register dump in the bochs log when this appears?
Re:Bochs Debugging
Posted: Mon May 15, 2006 6:18 pm
by asmboozer
paulbarker wrote:
Does anyone think I should add the info about that "CPU_LOOP 1" message to the FAQ?
Just a quick question about this message: do you get the full register dump in the bochs log when this appears?
thanks if you do so.
Re:Bochs Debugging
Posted: Mon May 15, 2006 9:50 pm
by LongHorn
Just a quick question about this message: do you get the full register dump in the bochs log when this appears?
Yes we do.
It would help a lot if you add that information.
It happens when a triple fault or something like that happens.
Re:Bochs Debugging
Posted: Wed May 17, 2006 11:33 pm
by hendric
LongHorn wrote:
Finally i got my os to switch to DPL3 code. Once i got there page fault happened. It's quite expected because i have all my code running at ring0. So i created pagetables and pagedirectory and copied code to appropriate place. Then i got strange errors. I couldn't find the error.
Bochs goes into a LOOP saying CPU_LOOP1 then i have to close the window explicitly. Bochs log file consists of CR3=user cr3 that i set. But no way it could be there. The errors happen even before task switching
So is there really anyway to break when there is a change in CR3 register. Is it possible? i looked down the bochs docs it seems there is no way. Since errors happens at random place i couldn't figure out errors. Tips on debugging plz. Right now i am tracing on from beginning , a painful task.
As my thought,informations you provided were to limited to detect what's happeded to your kernel.You'd better paste your bochs log file here and we will know more about what's going.
Re:Bochs Debugging
Posted: Fri May 19, 2006 3:45 am
by Pype.Clicker
LongHorn wrote:
So is there really anyway to break when there is a change in CR3 register. Is it possible? i looked down the bochs docs it seems there is no way.
there's no way i know to "watch" the CR3 register (that is, let things running as long as CR3 doesn't change, and act as a breakpoint if it does).
what i'd suggest instead is that you insert breakpoints at code locations where you expect CR3 to change (mov cr3, xxx being an obvious candidate).
If you're desesperately needing this, i suggest you grab bochs sources, find out where CRx is handled and modify the interpreter's code so that it raises a break when a new value is written automatically ...
Re:Bochs Debugging
Posted: Fri May 19, 2006 4:22 am
by mystran
I want to add that the emulator itself in Bochs is definitely clean enough code that doing such minor tweaks should not be terribly hard.