[SOLVED] Stuck on page fault when loading new page directory
Posted: Wed Sep 25, 2024 10:07 am
Hi all,
I've been stuck on this issue for a week now and am trying to figure out what I did wrong. I'm writing a higher half kernel - in the loader, I enable paging using a temporary page table, which I later replace with a permanent one. Problem is, when I load the address of the permanent page directory into the CR3 register, I get a page fault.
I've tried a few things including setting up a page fault handler to inspect the state of the world when the fault happens but my interrupt handler doesn't execute. I wrote it hastily and probably don't know what I'm doing yet so not really surprised there.
Code can be found on the 0xe branch here.
Relevant files:
I've been stuck on this issue for a week now and am trying to figure out what I did wrong. I'm writing a higher half kernel - in the loader, I enable paging using a temporary page table, which I later replace with a permanent one. Problem is, when I load the address of the permanent page directory into the CR3 register, I get a page fault.
I've tried a few things including setting up a page fault handler to inspect the state of the world when the fault happens but my interrupt handler doesn't execute. I wrote it hastily and probably don't know what I'm doing yet so not really surprised there.
Code can be found on the 0xe branch here.
Relevant files:
- Here's where I load the new page directory.
- Here's the loader/where paging is originally enabled.
- Kernel C entry-point
- Linker script