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.
page fault generates a security exception
- BrightLight
- Member
- Posts: 901
- Joined: Sat Dec 27, 2014 9:11 am
- Location: Maadi, Cairo, Egypt
- Contact:
Re: page fault generates a security exception
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.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
-
- Posts: 2
- Joined: Thu Feb 09, 2017 5:44 pm
Re: page fault generates a security exception
aargh the ole copy-paste-forget-to-change-a-number