From 3e0698d24ece7d23526a0b8e5a937553817ac43e Mon Sep 17 00:00:00 2001 From: janis Date: Wed, 12 Aug 2026 13:45:39 +0200 Subject: [PATCH] kernel: comment --- kernel/src/x86_64/paging.rs | 4 ++++ 1 file changed, 4 insertions(+) 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) => {}