is anyone sure if this is a bochs bug?
Ok, well, I'm trying to test the double fault stuff, so I divide by zero to get to the div0 exception handler, and then in the exception handler, I divide by zero again.. if I do this, there are many things that can go wrong... I usually get a panic with "prefetch >> running in bogus memory" and sometimes I get something like "Message: prefetch: getHostMemAddr vetoed direct read, pAddr=0xa0000" and such... with the prefetch error, I can't find what the eip is or anythign when this happens, but for the second message, bochs will still dump all of the registers.. and it says eip is 0xA0000, and esp is 0xFFFFFFFF and other weird things...
but, if I remove the divide by zero in the exception handler, it all works just fine.
any ideas on testing the doubel fault handler if this is a bug?
Bochs bug?
- Combuster
- Member

- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Bochs bug?
From what I got out of the intel manuals is that double exceptions only occur when it fails to transfer control to a different exception handler. So if you cause a completely separate error (another division by zero), the processor is able to properly deal with it, reentering the exception handler (and in your case, causing a loop resulting in the stack being run over, with all the hairy effects of that)
But the manual's rather cryptic and there's possibly another different explanation that arguably fits the text.
But the manual's rather cryptic and there's possibly another different explanation that arguably fits the text.
Re: Bochs bug?
It's only a double fault if it cannot start running the exception handler for the first exception. That means, segment swapped out, invalid IDT entry, stuff like that. If it can *start* with the 1st instruction, it's a single fault again (which will be handled simply).