Skip to main content

Module _14_page_fault

Module _14_page_fault 

Source
Expand description

Page-fault exception handler (vector 14, #PF).

Authors: MarioS271

Re-exportsยง

use crate::arch::x86_64::mm::vmm::page_type::PageType; ๐Ÿ”’
use crate::lib::addr::VirtAddr; ๐Ÿ”’
use crate::lib::panic::kernel_panic; ๐Ÿ”’
use crate::lib::panic_codes::PanicCode; ๐Ÿ”’
use crate::lib::types::fmt_buffer::FmtBuffer; ๐Ÿ”’
use crate::mm::layout::USER_MAX; ๐Ÿ”’
use crate::mm::pmm::FRAME_SIZE; ๐Ÿ”’
use crate::mm::vmm::Vmm; ๐Ÿ”’
use crate::mm::vmm::VmmError; ๐Ÿ”’
use crate::mm::vmm::traits::VmmPaging; ๐Ÿ”’
use crate::mm::vmm::vma::VmaFlags; ๐Ÿ”’
use crate::state::kstate::KSTATE; ๐Ÿ”’
use core::fmt::Write; ๐Ÿ”’
use x86_64::registers::control::Cr2; ๐Ÿ”’
use x86_64::structures::idt::InterruptStackFrame; ๐Ÿ”’
use x86_64::structures::idt::PageFaultErrorCode; ๐Ÿ”’
use crate::arch::x86_64::exception_table::search_exception_table; ๐Ÿ”’

Functionsยง

handle_kernel_address_pf ๐Ÿ”’
Handle a kernel page fault; maps a new page if VMA is found, otherwise panics
handle_user_address_pf ๐Ÿ”’
Handle Page Faults which happened when accessing a user address (either from userspace or from the kernel in a syscall)
handler
Handle Page Faults; dispatches to handle_kernel_address_pf and handle_user_address_pf
kernel_pf_panic ๐Ÿ”’
Wrapper for kernel_panic which appends the error code, CR2 address and interrupt stack frame onto the panic message
user_pf_cant_map_handler ๐Ÿ”’
Handle the user page fault handler being unable to map