From fdb9cbebc5eefbb89886eef86ab71dfac70cc39a Mon Sep 17 00:00:00 2001 From: natrixaeria Date: Sat, 9 Nov 2019 02:00:29 +0100 Subject: Add error messages --- kernel/src/interrupts/exceptions.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'kernel/src/interrupts/exceptions.rs') diff --git a/kernel/src/interrupts/exceptions.rs b/kernel/src/interrupts/exceptions.rs index 88c78a7..057adbc 100644 --- a/kernel/src/interrupts/exceptions.rs +++ b/kernel/src/interrupts/exceptions.rs @@ -37,10 +37,9 @@ pub extern "x86-interrupt" fn segment_not_present_handler( error_code: u64, ) { panic!( - "SEGMENT NOT PRESENT: {:?}Flags: {:b} Stack: {:x}", + "SEGMENT NOT PRESENT exception\nerror code: 0x{:x}\n{}", error_code, - stack_frame.cpu_flags, - stack_frame.stack_pointer.as_u64() + exception_default!(stack_frame) ); } @@ -49,8 +48,7 @@ pub extern "x86-interrupt" fn double_fault_handler( _error_code: u64, // code is always zero ) { panic!( - "DOUBLE FAULT Flags: {:b} Stack: {:x}", - stack_frame.cpu_flags, - stack_frame.stack_pointer.as_u64() + "DOUBLE FAULT\nthis is a fatal exception\n{}", + exception_default!(stack_frame) ); } -- cgit v1.2.3-70-g09d2