summaryrefslogtreecommitdiff
path: root/kernel/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/lib.rs')
-rw-r--r--kernel/src/lib.rs28
1 files changed, 2 insertions, 26 deletions
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs
index 87e8066..d18ca6f 100644
--- a/kernel/src/lib.rs
+++ b/kernel/src/lib.rs
@@ -58,32 +58,8 @@ pub extern "C" fn _start() -> ! {
#[panic_handler]
#[no_mangle]
pub extern "C" fn panic_handler(info: &core::panic::PanicInfo) -> ! {
- let mut stderr = OStream::new();
- stderr.set_state(vga_text::CharState::from_colors(
- vga_text::Color::LightRed,
- vga_text::Color::Red,
- ));
- stderr.clear();
- stderr.print(b"uff-os");
- stderr.set_row(10);
- stderr.set_state(vga_text::CharState::from_colors(
- vga_text::Color::White,
- vga_text::Color::Red,
- ));
- stderr.print_centered(b"<kernel panic>");
- stderr.set_row(14);
- stderr.set_state(vga_text::CharState::from_colors(
- vga_text::Color::Cyan,
- vga_text::Color::Red,
- ));
- stderr.set_centered(true);
- write!(
- &mut stderr,
- "{:?}",
- info.message()
- .unwrap_or(&format_args!("no panic information obtainable"))
- );
- stderr.set_centered(false);
+ io::panic_screen::show(info.message());
+
if cfg!(test) {
write!(serial::SerialStream::new(), "Testing failed\n").unwrap();
qemu::exit_qemu(qemu::QemuExitCode::Failed);