mirror of
https://github.com/realmicrosoft/windows.git
synced 2024-08-14 22:46:44 +00:00
add some interrupts
This commit is contained in:
parent
d0817025aa
commit
9a5a004243
2 changed files with 20 additions and 1 deletions
|
@ -1,8 +1,10 @@
|
|||
|
||||
use core::borrow::{BorrowMut};
|
||||
use x86_64::registers::control::Cr2;
|
||||
use x86_64::structures::idt::PageFaultErrorCode;
|
||||
|
||||
|
||||
use crate::{InterruptStackFrame, font, println};
|
||||
use crate::{InterruptStackFrame, font, println, print};
|
||||
use crate::internals::WhyDoTheyCallItOvenWhenYouOfInTheColdFoodOfOutHotEatTheFood::{COMMUNIST_RED, CUM_WHITE, Colour};
|
||||
use crate::serial::terminal::ST;
|
||||
|
||||
|
@ -10,5 +12,20 @@ pub extern "x86-interrupt" fn breakpoint_exception(stack_frame: InterruptStackFr
|
|||
println!("---KERNEL WARNING UWU---");
|
||||
println!("breakpoint exception");
|
||||
println!("stack frame: {:#?}", stack_frame);
|
||||
}
|
||||
|
||||
pub extern "x86-interrupt" fn double_fault(stack_frame: InterruptStackFrame, _error_code: u64) -> ! {
|
||||
println!("---KERNEL FUCKY WUKKY UWU---");
|
||||
println!("double fault!");
|
||||
println!("stack frame: {:#?}", stack_frame);
|
||||
loop {}
|
||||
}
|
||||
|
||||
pub extern "x86-interrupt" fn page_fault(stack_frame: InterruptStackFrame, error_code: PageFaultErrorCode) -> ! {
|
||||
println!("---KERNEL FUCKY WUKKY UWU---");
|
||||
println!("page fault!");
|
||||
println!("accessed address: {:?}", Cr2::read());
|
||||
println!("error code: {:?}", error_code);
|
||||
println!("stack frame: {:#?}", stack_frame);
|
||||
loop {}
|
||||
}
|
|
@ -37,6 +37,8 @@ lazy_static! {
|
|||
static ref IDT: InterruptDescriptorTable = {
|
||||
let mut idt = InterruptDescriptorTable::new();
|
||||
idt.breakpoint.set_handler_fn(internals::errors::breakpoint_exception);
|
||||
idt.double_fault.set_handler_fn(internals::errors::double_fault);
|
||||
idt.page_fault.set_handler_fn(internals::errors::page_fault);
|
||||
idt
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue