diff options
Diffstat (limited to 'kernel/src/lib.rs')
-rw-r--r-- | kernel/src/lib.rs | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index a81520b..59888d1 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -25,11 +25,8 @@ pub extern "C" fn _start() -> ! { test_main(); qemu::exit_qemu(qemu::QemuExitCode::Success); } - x86_64::instructions::interrupts::int3(); - let stdout = OStream::new(); - stdout.clear(); - panic!("panic! at the disco"); + x86_64::instructions::interrupts::int3(); /// TODO: write test ///fn _loop(i: u64) -> u64 { @@ -50,32 +47,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); |