page fault generates a security exception

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
rpatel3001
Posts: 2
Joined: Thu Feb 09, 2017 5:44 pm

page fault generates a security exception

Post 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.
User avatar
BrightLight
Member
Member
Posts: 901
Joined: Sat Dec 27, 2014 9:11 am
Location: Maadi, Cairo, Egypt
Contact:

Re: page fault generates a security exception

Post 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.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
rpatel3001
Posts: 2
Joined: Thu Feb 09, 2017 5:44 pm

Re: page fault generates a security exception

Post by rpatel3001 »

aargh the ole copy-paste-forget-to-change-a-number
Post Reply