Memory allocation for page directories and tables in the vmm
Posted: Wed Mar 23, 2022 11:09 am
I am having trouble figuring out a way to allocate memory for the page tables and directories in my virtual memory manager.
I'm working my way up from the BareBones tutorial and currently have a reasonably functional Physical Memory Manager.
My bootloader enables paging and set's up the kernel to be higher half (at 0xC0000000). Obviously, when I allocate a block using the physical memory manager and
try to use it, a page fault is thrown, as it should be.
My question is how do I allocate and use memory for the virtual memory manager structures? I can't do the same thing I did for the PhysicalMemoryManager and
attach these VMM structures to the end of the kernel since they will have to be freed and allocated. If I allocate space for the Page Tables and the Page Directories using the
Physical Memory Allocator, I won't be able to use them since any attempt to use them will throw a page fault.
Any help is appreciated. Thank you.
I'm working my way up from the BareBones tutorial and currently have a reasonably functional Physical Memory Manager.
My bootloader enables paging and set's up the kernel to be higher half (at 0xC0000000). Obviously, when I allocate a block using the physical memory manager and
try to use it, a page fault is thrown, as it should be.
My question is how do I allocate and use memory for the virtual memory manager structures? I can't do the same thing I did for the PhysicalMemoryManager and
attach these VMM structures to the end of the kernel since they will have to be freed and allocated. If I allocate space for the Page Tables and the Page Directories using the
Physical Memory Allocator, I won't be able to use them since any attempt to use them will throw a page fault.
Any help is appreciated. Thank you.