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

phys_to_virt

Function phys_to_virt 

Source
pub fn phys_to_virt(phys: usize) -> Option<usize>
Expand description

Translate a physical address to its virtual address using the bootloader’s physical memory mapping.

The bootloader maps all physical memory at a dynamic offset in the higher-half virtual address space. MMIO regions like the Local APIC (0xFEE0_0000) and I/O APIC (0xFEC0_0000) are not identity-mapped, so we must add the physical memory offset to access them.

Returns None if boot info or the physical memory offset is unavailable.