diff --git a/kernel/src/x86_64/paging.rs b/kernel/src/x86_64/paging.rs index d4dfa89..d60651a 100644 --- a/kernel/src/x86_64/paging.rs +++ b/kernel/src/x86_64/paging.rs @@ -99,6 +99,10 @@ impl RootPageTable { let end = align_up(phy.end.0, PAGE_SIZE as u64); let size = end - start; + // split the mapping into regions of 1GB, 2MB, and 4KB pages, depending on the alignment of the virtual address and the size of the mapping. + // insert the regions with `flags` into the page table, creating new tables with permissions R/W/X as necessary. + // if any leaf-entries are encountered, undo the mapping and return an error. + match size { Self::ONE_GB.. if is_aligned(virt.0, Self::ONE_GB) => {} Self::TWO_MB.. if is_aligned(virt.0, Self::TWO_MB) => {}