|
|
@ -22,6 +22,12 @@ pub extern "x86-interrupt" fn page_fault_handler(
|
|
|
|
loop {}
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub extern "x86-interrupt" fn general_protection_fault_handler(
|
|
|
|
|
|
|
|
stack_frame: &mut ExceptionStackFrame, error_code: u64)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("\nEXCEPTION: General Protection Fault\n{:#?}\nErrorCode: {:#x}", stack_frame, error_code);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(feature = "use_apic")]
|
|
|
|
#[cfg(feature = "use_apic")]
|
|
|
|
use arch::driver::apic::ack;
|
|
|
|
use arch::driver::apic::ack;
|
|
|
|
#[cfg(not(feature = "use_apic"))]
|
|
|
|
#[cfg(not(feature = "use_apic"))]
|
|
|
@ -71,3 +77,25 @@ pub extern "x86-interrupt" fn timer_handler(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ack(IRQ_TIMER);
|
|
|
|
ack(IRQ_TIMER);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub extern "x86-interrupt" fn to_user_handler(
|
|
|
|
|
|
|
|
stack_frame: &mut ExceptionStackFrame)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("\nInterupt: To User");
|
|
|
|
|
|
|
|
stack_frame.code_segment = 16;
|
|
|
|
|
|
|
|
stack_frame.stack_segment = 32;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub extern "x86-interrupt" fn to_kernel_handler(
|
|
|
|
|
|
|
|
stack_frame: &mut ExceptionStackFrame)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("\nInterupt: To Kernel");
|
|
|
|
|
|
|
|
stack_frame.code_segment = 8;
|
|
|
|
|
|
|
|
stack_frame.stack_segment = 24;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub extern "x86-interrupt" fn syscall_handler(
|
|
|
|
|
|
|
|
stack_frame: &mut ExceptionStackFrame)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
println!("\nInterupt: Syscall");
|
|
|
|
|
|
|
|
}
|