Page 1 of 1

Kernel Relocation

Posted: Wed Jul 02, 2003 10:21 am
by nullify
Ok, GRUB loads my kernel at physical address 0x00100000 (1MB). What happens now is when I enable paging, kernel memory is just identity mapped, so its virtual address is also at the 1MB mark. My question is: other more mature kernels seem to relocate the kernel to be above user space, eg. user space in the bottom 2 GB, and kernel space resides at the top 2 GB or something. The Mobius is first example that comes to my mind on this: its kernel starts at virtual 0xc0000000 (3GB). Is there an advantage to doing things this way? In other words, what implications are there if I simply leave kernel memory identity mapped at the bottom of memory?

Thanks in advance for any advice.

Re:Kernel Relocation

Posted: Wed Jul 02, 2003 12:50 pm
by Tim
The only argument I can think of either way is for V86 mode. V86 mode always uses the bottom 1MB of the address space (regardless of where the physical pages are located), so if you put your kernel at the bottom and want to use V86 mode, you'll have to make the bottom 1MB user-accessible and read-write.

Re:Kernel Relocation

Posted: Thu Jul 03, 2003 7:35 am
by nullify
Thanks for your reply!