So far I have an asm loader to setup a temporary page directory and enable paging, and it works to call my main.c at 0xc0000000. At this point, though, I'm not sure how to switch to a new page directory.
From what I understand the cr3 register takes a pointer to the physical address of the page directory entries? I think before I was just storing the physical addr in the page directory struct, but this wouldn't work with paging already enabled. It doesn't look like any sort of disabling paging is feasible for this?
I've heard a little about pointing one page table back to the directory, but I'm still pretty unclear about how this would work. Is it as simple as it sounds, in which case you would access the address using a member of
Code: Select all
&directory->tables[x]
Thanks,
-friendly neighborhood polluticorn