x86 interrupt present bit effect on EMM386?

Emulation of old PCs, PC hardware, or PC peripherals.

x86 interrupt present bit effect on EMM386?

Postby superfury » 2019-1-30 @ 23:55

I notice that when I change the interrupt handler's Present bit of 0 to trigger an #NP exception instead of a #GP exception, EMM386 starts hanging during boot? So it requires non-present descriptors to cause a #GP for some odd reason, instead of the documented #NP?

Anyone knows what's happening or going wrong?

See CPU_ProtectedModeInterrupt() in https://bitbucket.org/superfury/unipcem ... ?at=master

Edit: Just modified the interrupt handling to act like Bochs: first plain #GP(IDTsel+2+EXT) faulting on the privilege level mismatch(on INT) and invalid descriptor type(type part of the field), then after that checking for the present bit(why is that done after the first two?) which #NP(IDTsel+2+EXT) faults if errored out?
superfury
l33t
 
Posts: 3228
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: x86 interrupt present bit effect on EMM386?

Postby superfury » 2019-2-02 @ 02:10

Just adjusted the remainder of interrupt handling, stack switching and stack access checking to also follow the correct order. Also throwing proper stack faults instead of #SS(0) (#SS(sel|EXT) instead).

Also modified incorrect SS segment loads when switching stacks to a higher privilege(interrupts) to properly set the EXT bit for the fault and throw #TS(selector|EXT) properly.
superfury
l33t
 
Posts: 3228
Joined: 2014-3-08 @ 11:25
Location: Netherlands


Return to PC Emulation

Who is online

Users browsing this forum: Silanda and 3 guests

cron