mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-18 07:17:49 +00:00
Revise post and add new introduction
This commit is contained in:
@@ -10,6 +10,7 @@ use pic8259_simple::ChainedPics;
|
||||
use spin;
|
||||
use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable, PageFaultErrorCode};
|
||||
|
||||
|
||||
pub const PIC_1_OFFSET: u8 = 32;
|
||||
pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8;
|
||||
|
||||
@@ -58,6 +59,19 @@ extern "x86-interrupt" fn page_fault_handler(
|
||||
hlt_loop();
|
||||
}
|
||||
|
||||
extern "x86-interrupt" fn page_fault_handler(
|
||||
stack_frame: &mut ExceptionStackFrame,
|
||||
_error_code: PageFaultErrorCode,
|
||||
) {
|
||||
use crate::hlt_loop;
|
||||
use x86_64::registers::control::Cr2;
|
||||
|
||||
println!("EXCEPTION: PAGE FAULT");
|
||||
println!("Accessed Address: {:?}", Cr2::read());
|
||||
println!("{:#?}", stack_frame);
|
||||
hlt_loop();
|
||||
}
|
||||
|
||||
extern "x86-interrupt" fn double_fault_handler(
|
||||
stack_frame: &mut ExceptionStackFrame,
|
||||
_error_code: u64,
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
use core::panic::PanicInfo;
|
||||
|
||||
use blog_os::println;
|
||||
use bootloader::bootinfo::BootInfo;
|
||||
|
||||
|
||||
/// This function is the entry point, since the linker looks for a function
|
||||
/// named `_start` by default.
|
||||
#[cfg(not(test))]
|
||||
#[no_mangle] // don't mangle the name of this function
|
||||
pub extern "C" fn _start() -> ! {
|
||||
pub extern "C" fn _start(boot_info: &BootInfo) -> ! {
|
||||
use blog_os::interrupts::PICS;
|
||||
use x86_64::structures::paging::PageTable;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user