Following this tutorial: http://www.lowlevel.eu/wiki/Teil_9_-_Paging
When you run a program in user mode jumps me except 14 (Page Fault). I am not able to implement the last part of the tutorial, could anyone help? The error occurs when I run a task in user mode.
Help! Exception 14, Page Fault
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: Help! Exception 14, Page Fault
What does #PF error code tell you...?
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: Help! Exception 14, Page Fault
Failure paging. Since everything is padded as Kernel, then when I go to user mode is being accessed at jumping Kernel Page Fault. But I fix this? I am unable to implement the last part of the tutorial, which is correcting this error.
Re: Help! Exception 14, Page Fault
Hi,
If you gather all the information that the CPU is trying to tell you, then you might end up with a description of the problem like "the code at 0x0008:0x1234 attempts to write to address 0x12345678, which is a not present page".
If the page fault's error code (on the page fault exception handler's stack) says the page isn't present, then the problem is that the page isn't present (e.g. you've used a dodgy pointer or didn't map a page where you should have). Alternatively, if the page fault's error code says that "user" (CPL=3) code attempted to access "supervisor" (CPL=0) pages then the problem is that "user" code attempted to access "supervisor" pages (e.g. you've used a dodgy pointer, or didn't set the "user/supervisor" flag in a page table entry or page directory entry).
Cheers,
Brendan
When a page fault occurs the CPU puts important information on the exception handler's stack and in CR2. The information on the exception handler's stack is the return CS:EIP (the address of the instruction that caused the page fault) and an error code (if the fault was caused by a "not present" page, writing to a read only page, CPL=3 code trying to access a "supervisor" page, etc). The value in CR2 is the address that the code attempted to access.Miky95 wrote:Failure paging. Since everything is padded as Kernel, then when I go to user mode is being accessed at jumping Kernel Page Fault. But I fix this? I am unable to implement the last part of the tutorial, which is correcting this error.Griwes wrote:What does #PF error code tell you...?
If you gather all the information that the CPU is trying to tell you, then you might end up with a description of the problem like "the code at 0x0008:0x1234 attempts to write to address 0x12345678, which is a not present page".
If the page fault's error code (on the page fault exception handler's stack) says the page isn't present, then the problem is that the page isn't present (e.g. you've used a dodgy pointer or didn't map a page where you should have). Alternatively, if the page fault's error code says that "user" (CPL=3) code attempted to access "supervisor" (CPL=0) pages then the problem is that "user" code attempted to access "supervisor" pages (e.g. you've used a dodgy pointer, or didn't set the "user/supervisor" flag in a page table entry or page directory entry).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.