std::size_t nb_pages = (program_header.p_memsz + 0x1000) / 0x1000;
for (std::size_t i = 0; i < nb_pages; i++) {
const auto indices = os::paging::calc_page_table_indices(program_header.p_vaddr + i * 0x1000);
- os::assert(indices.pml4e < 256, "Userspace program must be in the lower-half of virtual memory.");
if (PML4T.contents[indices.pml4e].P == 0) {
PML4T.contents[indices.pml4e] = {.P = 1, .R_W = 1, .U_S = 1, .PWT = 0, .PCD = 0, .base_address = 0, .NX = 0};
const auto PDPT_alloc = os::paging::page_allocator.allocate(1);