Satomatic wrote:
So I've been writing a 64 bit kernel using the limine bootloader. While trying to allocate pages for the vmm page table I've run into an issue. A lot of the memory which limine marks as available in the memory map isn't mapped to a virtual address in the bootloaders page table, obviously resulting in a page fault. It seems there are huge gaps of non mapped memory in the page table which is marked as available in the memory map.
If any of what I've said makes sense, does anyone have any ideas why this might be?
Thanks
Not familiar with Lamine, other than what is documented
here, but that file makes no mention of mapping the available memory.
It looks like available memory is requested using LIMINE_MEMMAP_REQUEST, which returns a response with a variable number of entries, with each memory having some base, size and type (one type being LIMINE_MEMMAP_USABLE).
Your kernel needs to map that, surely? Lamine only says following about MMU state:
Quote:
At handoff, the kernel will be properly loaded and mapped with appropriate MMU permissions at the requested virtual memory address (provided it is at or above 0xffffffff80000000).
The page table as passed to the kernel is the Lamine page table in bootloader reclaimable memory.
Your kernel should make its own page table, in its own memory, and map physical memory how you see fit.