c - how can I jump to the higher half kernel -
i building higher half kernel, bootloader loads kernel @ physical address 0x100000(1m) , identity mapping has been set 0-4mb. here question: how can jump higher virtual address(3gb,for example).
i googled question , have found 2 ways: 1 use address space warp around , 1 set page entries map 3gb~3gb+4mb 0-4mb "jump" higher address.i decided use second way can't find enough information implement it. disassembled kernel , found addresses absolute, believe single "jmp" instruction won't suffice. way can think there function in virtual address above 3gb , call function in lower space excuting in high space , function should never returned. if ture, how can this?
my kernel, k-os, this.
basically, need write linker script shift whole kernel desired "higher-half" address (see this). then, need append little assembler snippet (see this) kernel's entry point.
this snippet should only use relative addresses , should set page tables higher half (map whole kernel said in linker script). finally, snippet should jmp "higher-half" entry point , call c code.
Comments
Post a Comment