Too many Virtual 8086 exceptions

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
User avatar
AlfaOmega08
Member
Member
Posts: 226
Joined: Wed Nov 07, 2007 12:15 pm
Location: Italy

Too many Virtual 8086 exceptions

Post 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?
Please, correct my English...
Motherboard: ASUS Rampage II Extreme
CPU: Core i7 950 @ 3.06 GHz OC at 3.6 GHz
RAM: 4 GB 1600 MHz DDR3
Video: nVidia GeForce 210 GTS... it sucks...
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Too many Virtual 8086 exceptions

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: Too many Virtual 8086 exceptions

Post 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.
Post Reply