memory model 64bit
Posted: Tue Oct 02, 2007 3:38 pm
Hi All,
I finally got preliminary elf64 support working and the boot loader now loads the kernel (core.elf) and starts the main function. In the screen shot posted all the blue stuff is the boot loader and the black lines are the kernel. The code is rather dodgy but i will change that later.
Now i have several question:
Because i am building a pure 64bit kernel, so no BIOS and pmode, i want the kernel to reside at physical memory address zero, currently 2 MiB, and onwards and the virtual memory address in the higher half the upper MiB in this case, though this is determined by the elf file.
Question 1) What is the best way to implement the loading of the core.elf file at physical address 0 without overwriting the boot loader. Considering the boot loader generally resides at 0x7C00 onwards and the kernel will be not more then 256 KiB including data structures. and i don't want to use the memory above 1 MiB.
Further more i get the concept and benefits of each user thread/process to have the kernel space mapped, so that is what i will implement but..
Question 2) Do you make the whole physical memory space available to the kernel?
I can map this using 2MiB pages so mapping 512 GiB will take only 16 KiB of memory.
Looking forward to hear from you all,
os64dev
I finally got preliminary elf64 support working and the boot loader now loads the kernel (core.elf) and starts the main function. In the screen shot posted all the blue stuff is the boot loader and the black lines are the kernel. The code is rather dodgy but i will change that later.
Now i have several question:
Because i am building a pure 64bit kernel, so no BIOS and pmode, i want the kernel to reside at physical memory address zero, currently 2 MiB, and onwards and the virtual memory address in the higher half the upper MiB in this case, though this is determined by the elf file.
Question 1) What is the best way to implement the loading of the core.elf file at physical address 0 without overwriting the boot loader. Considering the boot loader generally resides at 0x7C00 onwards and the kernel will be not more then 256 KiB including data structures. and i don't want to use the memory above 1 MiB.
Further more i get the concept and benefits of each user thread/process to have the kernel space mapped, so that is what i will implement but..
Question 2) Do you make the whole physical memory space available to the kernel?
I can map this using 2MiB pages so mapping 512 GiB will take only 16 KiB of memory.
Looking forward to hear from you all,
os64dev