Joined: Tue Oct 17, 2006 6:06 pm Posts: 1437 Location: Vancouver, BC, Canada
|
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.
_________________ Top three reasons why my OS project died:
- Too much overtime at work
- Got married
- My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
|
|