I finally finished my PMM and VMM.
Now I mapped everything from 0x1000 to 0xEndOfKernel (+placement address) (I reserved block 0 (first 4K of memory) to be able to return NULL if allocation failed and get page fault if try to access to 0x0).
I'm one step before starting the kernel heap, but I heard a lot about Higher Half Kernel, like Mapping the kernel not 1:1 but somewhere around 0xC... I was wonder how I can achieve this? One solution I tough about is mapping 0x100000 till end of kernel, to the pages I want (Lets say 0xC0000000) and than manually adjust eip, but something tells me it wont work.
So I would like to know how its done?
Also one more question, now I use 4KB stack defined in krnldr.asm file:
Code: Select all
STACKSIZE equ 0x4000 ; 4KB stack
... Some more code, especially .text section.
...........
mov esp, stack + STACKSIZE
......... more code that pushes multiboot info and call kernel
section .bss
align 32
stack:
resb STACKSIZE
How I can remap the stack (Do I need it?!)?
Thanks a lot