mmu_init() identity-maps only 0x0-0x400000. But mmu_init() and mmu_map_page() access the page directory / page tables via @ptrFromInt(<physical address>). This only works while pmm_alloc_frame() happens to return frames below 4 MB.
Once low memory fills up (heap growth) and a new page table gets a frame >= 0x400000, the @memset on the new table touches unmapped virtual memory and page-faults inside the mapping code itself -- with paging enabled this ends in a double fault and a dead machine.
Possible directions:
- identity-map all detected RAM at init,
- keep a dedicated low-memory pool for paging structures, or
- a recursive page directory mapping.
Can send a PR once a direction is picked.
mmu_init()identity-maps only0x0-0x400000. Butmmu_init()andmmu_map_page()access the page directory / page tables via@ptrFromInt(<physical address>). This only works whilepmm_alloc_frame()happens to return frames below 4 MB.Once low memory fills up (heap growth) and a new page table gets a frame >=
0x400000, the@memseton the new table touches unmapped virtual memory and page-faults inside the mapping code itself -- with paging enabled this ends in a double fault and a dead machine.Possible directions:
Can send a PR once a direction is picked.