Expand description
VMM Paging (x86_64): setup_kernel_paging
Authors: MarioS271
Re-exportsΒ§
use crate::lib::addr::PhysAddr;πuse crate::lib::addr::VirtAddr;πuse crate::lib::panic::kernel_panic;πuse crate::lib::panic_codes::PanicCode;πuse crate::lib::types::boot_info::KernelSectionInfo;πuse crate::mm::layout;πuse crate::mm::pmm::Pmm;πuse crate::mm::pmm::FRAME_SIZE;πuse crate::mm::vmm::boot_mapping::build_boot_mappings;πuse crate::mm::vmm::boot_mapping::BootMappings;πuse crate::mm::vmm::traits::VmmPaging;πuse crate::mm::vmm::Vmm;πuse crate::state::kstate::KSTATE;πuse crate::kinfo;πuse x86_64::registers::control::Cr3;πuse x86_64::registers::control::Efer;πuse x86_64::registers::control::EferFlags;πuse x86_64::structures::paging::PageTable;πuse x86_64::structures::paging::PageTableFlags;πuse x86_64::structures::paging::PhysFrame;π
FunctionsΒ§
- create_
zeroed_ πpdpts - Prepopulate the higher half with empty PDPTs so that if the kernel PML4 higher half ever gets cloned (like when creating processes), no stale higher halfs exist that arenβt synced with the kernelβs (which could cause page faults when switching into the kernel with user pages)
- setup_
kernel_ paging - Build the kernels page tables and switch to them
- verify_
against_ πbootloader - Verify whether the newly constructed page tables match what the bootloader gave us in critical sections, and panic if they donβt to avoid a page fault/triple fault