⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

reserve_boot_page_table_frames

Function reserve_boot_page_table_frames 

Source
pub fn reserve_boot_page_table_frames()
Expand description

Walk the boot page tables (CR3) and mark all intermediate table frames as reserved in the frame allocator. This prevents the allocator from handing out frames that the bootloader used for page tables, which would corrupt kernel address space mappings when those frames are overwritten.

Reserves page table frames for both:

  • Kernel-space L4 entries (256..512): kernel code, heap, stacks, MMIO
  • Physical memory mapping L4 entry (lower half): used by phys_to_virt_addr()

Must be called AFTER init_default() (frame allocator is ready).