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.
Bochs Debugging
Re:Bochs Debugging
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?
Just a quick question about this message: do you get the full register dump in the bochs log when this appears?
Re:Bochs Debugging
thanks if you do so.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?
Re:Bochs Debugging
Yes we do.Just a quick question about this message: do you get the full register dump in the bochs log when this appears?
It would help a lot if you add that information.
It happens when a triple fault or something like that happens.
Re:Bochs Debugging
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.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.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Bochs Debugging
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).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.
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
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.