Discussion:
page fault handler error
(too old to reply)
Pratik Mathur
2005-11-04 06:22:50 UTC
Permalink
I'm getting a Page Fault at address 0.

The exact error is:

Pid 1, Page Fault received, at address 0 (1649 pages free)
Non-present page, Write Fault, in Supervisor Mode
Interrupt number = 14, error code = 2

and then it fails the KASSERT on line 98 of paging.c "Failed assertion in
Page_Fault_Handler: 0"



--
Iulian Neamtiu
2005-11-04 15:49:27 UTC
Permalink
This is a NULL pointer dereference and, lo and behold,
leaving page 0 unmapped has saved you here.

Essentially, you're trying to write to address 0 (either assigning to an
int/long *, or to a structure field at offset 0, and the structure pointer
is NULL).

Get the EIP (program counter) that generated the fault and feed it to
tools/eipToFunction to get the function it dies in. That's one way to do
it, but with the EIP in hand, I'd rather look it up directly in the
disassembled code:
$ cd build/
$ nm kernel.exe|less
search for the address using '/'. Then you'll see not only the function,
but the asm code as well, so it's easy to pinpoint the source code
location where the fault occured, and find out which pointer you left
NULL.


Iulian
Post by Pratik Mathur
I'm getting a Page Fault at address 0.
Pid 1, Page Fault received, at address 0 (1649 pages free)
Non-present page, Write Fault, in Supervisor Mode
Interrupt number = 14, error code = 2
and then it fails the KASSERT on line 98 of paging.c "Failed assertion in
Page_Fault_Handler: 0"
--
Iulian Neamtiu
2005-11-04 15:51:36 UTC
Permalink
Sorry, that should read:

$ cd build/geekos
instead of
$ cd build

Iulian

Loading...