Page 1 of 1
Too many Virtual 8086 exceptions
Posted: Mon Aug 10, 2009 1:35 am
by AlfaOmega08
I finally wrote a v86 monitor for my kernel.
When I try to execute INT 0x10 (AX=0x4F00) to get VESA informations, i first get a Page Fault on C000:012D (PUSHF) and my monitor does the job. Then I get a second pagefault on C000:012E (CMP AL, 0F) with opcode 0x80 which isn't handled by my monitor. Why does a cmp instruction need the monitor?
Re: Too many Virtual 8086 exceptions
Posted: Mon Aug 10, 2009 3:17 am
by Brendan
Hi,
AlfaOmega08 wrote:I finally wrote a v86 monitor for my kernel.
When I try to execute INT 0x10 (AX=0x4F00) to get VESA informations, i first get a Page Fault on C000:012D (PUSHF) and my monitor does the job. Then I get a second pagefault on C000:012E (CMP AL, 0F) with opcode 0x80 which isn't handled by my monitor. Why does a cmp instruction need the monitor?
I'm guessing...
Maybe the page fault at C000:012D (PUSHF) is because the page isn't mapped into the address space properly, and for some unknown reason your page fault handler emulates the instruction that it thinks is there (and increases IP), and the page fault at C000:012E (CMP AL, 0F) occurs because the page still isn't mapped into the address space properly?
Note: The PUSHF will cause a page fault if the page at 0x000C0000 isn't present, isn't readable, or isn't executable. The PUSHF will also cause a page fault if stack is messed up (SS:SP points to a page that isn't present or isn't writable). The PUSHF instruction *should* cause a general protection fault (but you're saying it causes a page fault instead).
Cheers,
Brendan
Re: Too many Virtual 8086 exceptions
Posted: Mon Aug 10, 2009 3:32 am
by pcmattman
i first get a Page Fault on C000:012D (PUSHF) and my monitor does the job
The only exception your v8086 mode monitor should be using to do 'its job' is the GPF exception. Other exceptions are actual error conditions and should be handled as such.