Yet another paging question :P
Posted: Tue Aug 07, 2007 5:12 pm
Hi everybody...
So here's the situation: I'm about to implement paging. I understand the whole thing and most of my stuff is almost done. I only have one question though.
My kernel is physically loaded at 1MB, but I want to page it (or however you call it) at 2GB. So how does that affect other parts of the kernel? I can imagine it will cause some issues with the memory manager.
Like every memory block I allocate with malloc will make a small header at the beginning of each block, wich are connected through each other by using a heap structure. But should my memory manager map all that stuff in the new virtual memory space or the physical memory space? Should I create a way that when the kernel is doing it's stuff, the "normal" memory layout (1:1) is used instead of the new one? Malloc should only affect the pagetable directory of the process that is requesting the memory right?
Oh and one last question: should I turn paging on and off every time I want to point CR3 to another directory (by setting the flag in CR0) or can I just leave it turned on while changing CR3?
So here's the situation: I'm about to implement paging. I understand the whole thing and most of my stuff is almost done. I only have one question though.
My kernel is physically loaded at 1MB, but I want to page it (or however you call it) at 2GB. So how does that affect other parts of the kernel? I can imagine it will cause some issues with the memory manager.
Like every memory block I allocate with malloc will make a small header at the beginning of each block, wich are connected through each other by using a heap structure. But should my memory manager map all that stuff in the new virtual memory space or the physical memory space? Should I create a way that when the kernel is doing it's stuff, the "normal" memory layout (1:1) is used instead of the new one? Malloc should only affect the pagetable directory of the process that is requesting the memory right?
Oh and one last question: should I turn paging on and off every time I want to point CR3 to another directory (by setting the flag in CR0) or can I just leave it turned on while changing CR3?