First of all, I love your tutorials, you guys have teached me a lot on OS development (After spending like, 3 months reading up on assembly and Machine Arcitechture I was real excited on getting started haha).
Anyway, I've gotten past all the current tutorials and everything works, also had to fix the kernel size problem in bootloader, wasn't to hard though.
And now I want to write a heap manager, logic tells me that a kmalloc/kfree would use the VMM instead of PMM, what would the point be otherwise?
But but but, I can't figure out how to actually use the VMM. Do i use the vmmngr_alloc_page (and in that case, how do i obtain the correct pt_entry to use for argument?)
Or do i use the MmMapPage, in which case i get page_faults everytime i try to allocate something like:
Code: Select all
//Allocate place for heap for (int i = 0, j = 0; i < 1024; i++, j += 4096) MmMapPage (pmmngr_alloc_block (), (char *) 0xD0000000+j);
I've searched far and wide and never seemed to find a solution on these forums, I can't be only one asking this question?
Anyway, hope to get some help, thanks!
Edit* I actually fixed the loop, stupid mistake on my behalf. But would that be the correct way of doing it?
Also, i can't seem to load my kernel to other addresses that isn't in the 0000:0000-FFFF range, if i try loading it at , lets say, 1000:0000
It triple faults on kernel entry. (Actually, at first it gets a divide_by_zero exception, then it page faults).