page fault generates a security exception
Posted: Thu Feb 09, 2017 6:01 pm
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.
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.