Page 2 of 2
Re: Paging design, Lower half kernel, potential problems?
Posted: Sat Mar 21, 2009 11:25 pm
by Colonel Kernel
Sounds good to me.
Re: Paging design, Lower half kernel, potential problems?
Posted: Sun Mar 22, 2009 4:58 am
by mangaluve
So where do you recommend that I put my kernel then? I need the last 4 MB of my virtual memory to the self-mapping of my page directory, but should the kernel end just before those 4 MB?
Re: Paging design, Lower half kernel, potential problems?
Posted: Sun Mar 22, 2009 9:21 am
by Colonel Kernel
You don't actually need to self-map your page directory right at the end of the address space. You can do it wherever you want. Mine is self-mapped 12MB after my kernel code in the virtual address space.
Where to put your kernel really depends on what kind of kernel it is. Higher "half" is not necessarily to be taken literally. If your kernel is monolithic, you'll need more address space dedicated to the kernel. If it's a microkernel, you'll need less. Mine is a microkernel, and my kernel space starts at 0xE0000000 for example. My kernel code starts at 0xE0100000, and the current page directory is self-mapped such that all the page tables start at 0xE1000000. Where you choose to put things depends on how your own kernel is going to use memory, but in general I suggest keeping big contiguous regions of virtual address space free for kernel use.