pub unsafe fn init(physical_memory_offset: VirtAddr) -> OffsetPageTable<'static>
Expand description
Initializes the page table using the physical memory offset.
This function sets up an OffsetPageTable
using the Level 4 page table provided
by the CPU’s current page table register (Cr3
), and then returns an OffsetPageTable
that will handle the translation between virtual and physical addresses.
§Arguments
physical_memory_offset
- The offset that separates the kernel’s virtual address space from the physical memory space.
§Safety
This function is unsafe because it manipulates raw pointers directly.