I'm making POSIX-compatible kernel by myself just for fun...
My kernel code is below(by nasm)
Code: Select all
[bits 32]
[org 100000]
// start from grub 32bit direct jump mode
// set page table for 64bit kernel
[virtual mem addr] [pys mem addr]
0xffffffff80000000~ 0x0~
// make gdt for 64bit kernel and "lgdt"
// set cr0 register for jumping to 64bit mode
jmp 0x??:start64
start64:
// 64bit start
above code is not work because page mapping table for virtual mem address 0x10000~ is not set...
I already know that in linux kernel code, early 4gb maaping code is existed....
I just want to jumping to 0xffffffff8000000 virtual address from 32bit code by not making early 4gb mapping table....
Is there a way??? trampoline like early 4gb mapping table is esseantial for 64bit kernel???