I’m developing a custom OS and facing a chicken-and-egg problem with my page frame allocator. I need to map a specific page, but if the corresponding PML4 entry is NULL, I must allocate a PDPT. Allocating a PDPT, however, requires allocating another page—which itself requires mapping. This creates a recursive dependency.
Has anyone encountered this issue? I’ve heard that using a self-referential entry in the PML4 might be a solution, but I’m not sure how it resolves the problem.