page fault handler
page fault handler
What shall I do to prevent my page fault handler to not start recursing? (When setting the present bit)
Re:page fault handler
I'm getting page faults when I try to read from memory, even when I haven't enabled paging.
The address I'm trying to read is 0x9C0000.
When I try to read 0x200000 it crashes without a page fault.
The address I'm trying to read is 0x9C0000.
When I try to read 0x200000 it crashes without a page fault.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:page fault handler
well, one possible thing is to have something like
if a 'static' nested_pagefault doesn't suit your needs, you may try a thread_local one (but that supposes your OS has thread_local storage already)
if the PG bit of CR0 is cleared, then you shouldn't be receiving page faults (exception 0E). Are you sure your interrupt system is reliable ?
Code: Select all
pf_handler() {
static int nested_pagefault=0;
if (nested_pagefault) panic("Cannot handle page fault ...");
nested_pagefault++;
do_the_job();
nested_pagefault--;
}
if the PG bit of CR0 is cleared, then you shouldn't be receiving page faults (exception 0E). Are you sure your interrupt system is reliable ?
Re:page fault handler
Well, floppy and keyboard are using interrupts and both are working correctly.
Re:page fault handler
btw, here's my linking script:
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(_start)
OUTPUT("kernel.bin")
INPUT(kinit.o)
INPUT(kints.o)
INPUT(ints.o)
INPUT(driver_keyboard.o)
INPUT(driver_floppy.o)
INPUT(kernel.o)
INPUT(app_console.o)
INPUT(io.o)
INPUT(pic.o)
INPUT(idt.o)
INPUT(panic.o)
INPUT(doprintf.o)
INPUT(queue.o)
INPUT(string.o)
INPUT(memory.o)
INPUT(math.o)
INPUT(dma.o)
INPUT(driver_pefs.o)
INPUT(timer.o)
INPUT(mem_manager.o)
SECTIONS
{
.text 0xFF800000 : {
*(.text)
}
.data : {
*(.data)
}
.bss :
{
*(.bss)
}
}
Code: Select all
Re:page fault handler
Is it the 0xFFC'th entry or the 0xFFF'th entry which is used to point to the PageDirectory itself when we map the PageTables into the current address space? and can anyone clearly explain how this mapping the PageTables into the current address space works (in simple english).
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:page fault handler
<timbot mode engaged>
Tim already did in one of its memory management tutorials on Bona Fide, iirc
<timbot mode disabled>
Tim already did in one of its memory management tutorials on Bona Fide, iirc
<timbot mode disabled>