Page 1 of 1

page fault generates a security exception

Posted: Thu Feb 09, 2017 6:01 pm
by rpatel3001
I have just set up paging on my kernel and wanted to generate a page fault to make sure I could handle it. To do this I either mark a page as not present or not writable (together with the write protect bit in CR0). Trying to write to this page then produces a security exception (0x1e) instead of a page fault (0x0e). The error code that gets put on the stack appears to be the correct code that would be generated from a page fault.

Why is this? The security exception is not documented on the wiki page for exceptions, but the page fault description seems to imply that these types of protection check failures should be page faults.

Re: page fault generates a security exception

Posted: Thu Feb 09, 2017 6:33 pm
by BrightLight
My first guess is that you have installed the wrong handler at the wrong interrupt number, because you mention that the error code on the stack is correct.

Re: page fault generates a security exception

Posted: Thu Feb 09, 2017 6:54 pm
by rpatel3001
aargh the ole copy-paste-forget-to-change-a-number