Linking, loading, and the higher half kernel
Posted: Mon Jan 30, 2012 11:39 pm
Afternoon osdevers,
A problem I've been having now that I've managed to get my head around interrupt servicing:
If I compile and link my kernel to be loaded to 1MiB, it is loaded at 1MiB in RAM. How then do I relocate it to the higher half of the virtual address space without having to recompute every symbol offset within? Even if I save myself some difficulty and build the image as an elf32 or similar, what is the proper method to do this? Do I need to write my own linker/loader routines already before I can move?
Or am I looking at this wrong, and all I need to do is memcpy the kernel image to the higher half and remap the page table to suit?
A problem I've been having now that I've managed to get my head around interrupt servicing:
If I compile and link my kernel to be loaded to 1MiB, it is loaded at 1MiB in RAM. How then do I relocate it to the higher half of the virtual address space without having to recompute every symbol offset within? Even if I save myself some difficulty and build the image as an elf32 or similar, what is the proper method to do this? Do I need to write my own linker/loader routines already before I can move?
Or am I looking at this wrong, and all I need to do is memcpy the kernel image to the higher half and remap the page table to suit?