diff options
author | Dennis Kobert <dennis@kobert.dev> | 2019-11-08 22:50:13 +0100 |
---|---|---|
committer | Dennis Kobert <dennis@kobert.dev> | 2019-11-08 22:50:13 +0100 |
commit | 933abe8bc6f9480bcdea39c6bdd1a4e937402a06 (patch) | |
tree | b6679b8e3c68fd71e59ec3ba22fe086525ddd3bc /kernel/src/interrupts/exceptions.rs | |
parent | f3dcfa225a6e3b7e6916e9b5a22db9090275d065 (diff) |
Add InterruptStackTable
Diffstat (limited to 'kernel/src/interrupts/exceptions.rs')
-rw-r--r-- | kernel/src/interrupts/exceptions.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/src/interrupts/exceptions.rs b/kernel/src/interrupts/exceptions.rs index 08555c4..782dd16 100644 --- a/kernel/src/interrupts/exceptions.rs +++ b/kernel/src/interrupts/exceptions.rs @@ -4,6 +4,7 @@ use x86_64::structures::idt::{InterruptStackFrame, PageFaultErrorCode}; pub extern "x86-interrupt" fn breakpoint_handler(stack_frame: &mut InterruptStackFrame) { let mut stdout = OStream::new(); stdout.print(b"EXCEPTION: BREAKPOINT\n"); + loop {} } pub extern "x86-interrupt" fn page_fault_handler( @@ -13,11 +14,11 @@ pub extern "x86-interrupt" fn page_fault_handler( use x86_64::registers::control::Cr2; let mut stdout = OStream::new(); - stdout.print(b"EXCEPTION: PAGEFAULT\n"); - loop {} - panic!("PAGE FAULT"); - //println!("Accessed Address: {:?}", Cr2::read()); - //println!("Error Code: {:?}", error_code); + panic!( + "PAGE FAULT while accessing address: {:?}{:?}", + Cr2::read(), + error_code + ); //println!("{:#?}", stack_frame); } @@ -25,12 +26,12 @@ pub extern "x86-interrupt" fn segment_not_present_handler( stack_frame: &mut InterruptStackFrame, error_code: u64, ) { - loop {} let mut stdout = OStream::new(); stdout.print(b"EXCEPTION: SEGMENT NOT PRESENT\n"); + loop {} } -extern "x86-interrupt" fn double_fault_handler( +pub extern "x86-interrupt" fn double_fault_handler( stack_frame: &mut InterruptStackFrame, _error_code: u64, ) { |