summaryrefslogtreecommitdiff
path: root/kernel/src/testing/panic.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/testing/panic.rs')
-rw-r--r--kernel/src/testing/panic.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/src/testing/panic.rs b/kernel/src/testing/panic.rs
index 729a45f..de07ba8 100644
--- a/kernel/src/testing/panic.rs
+++ b/kernel/src/testing/panic.rs
@@ -4,8 +4,10 @@ use core::panic::PanicInfo;
use qemu::{exit_qemu, QemuExitCode};
use serial::SerialStream;
use vga_text::OStream;
+use x86_64::instructions::interrupts;
pub fn serial_should_panic(info: &PanicInfo) -> ! {
+ interrupts::disable();
let mut stdout = SerialStream::new();
write!(stdout, "\nOK\nsuccessfully panicked\n").unwrap();
exit_qemu(QemuExitCode::Success);
@@ -13,6 +15,7 @@ pub fn serial_should_panic(info: &PanicInfo) -> ! {
}
pub fn serial_panic(info: &PanicInfo) -> ! {
+ interrupts::disable();
crate::io::panic_screen::show(info.message());
let mut stdout = SerialStream::new();
write!(
@@ -26,11 +29,13 @@ pub fn serial_panic(info: &PanicInfo) -> ! {
}
pub fn should_panic(_info: &PanicInfo) -> ! {
+ interrupts::disable();
exit_qemu(QemuExitCode::Success);
loop {}
}
pub fn panic(info: &PanicInfo) -> ! {
+ interrupts::disable();
crate::io::panic_screen::show(info.message());
loop {}
}