diff options
author | Dennis Kobert <dennis@kobert.dev> | 2019-10-31 12:46:53 +0100 |
---|---|---|
committer | Dennis Kobert <dennis@kobert.dev> | 2019-10-31 12:46:53 +0100 |
commit | 5a00ecaa8bdc60e1849de1df8c1655fa84faf984 (patch) | |
tree | ae99d93fc28983cb2f8e9114dc4a52db638b82a7 | |
parent | 62cce51eff15b648179a3ad8c77a0885e9394a10 (diff) |
Fix typo in panic screen
-rw-r--r-- | kernel/src/lib.rs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index 8d2eee2..92ce010 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -8,7 +8,6 @@ mod vga_text; use core::fmt::Write; - #[no_mangle] pub extern "C" fn _start() -> ! { let mut stdout = vga_text::OStream::new(); @@ -19,9 +18,7 @@ pub extern "C" fn _start() -> ! { panic!("i has panicing"); core::iter::successors(Some(0), |n| Some(n + 1)) - .for_each(|n| - write!(&mut stdout, "hello world {}!", n).unwrap() - ); + .for_each(|n| write!(&mut stdout, "hello world {}!", n).unwrap()); loop {} } @@ -31,19 +28,26 @@ pub extern "C" fn _start() -> ! { pub extern "C" fn panic_handler(_info: &core::panic::PanicInfo) -> ! { let mut stderr = vga_text::OStream::new(); stderr.set_state(vga_text::CharState::from_colors( - vga_text::Color::LightRed, vga_text::Color::Red)); + 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)); + vga_text::Color::White, + vga_text::Color::Red, + )); stderr.print_centered(b"<kernel panic>"); stderr.set_row(14); - let text = _info.payload() + let text = _info + .payload() .downcast_ref::<&str>() - .unwrap_or(&"no panic informations are obtainable"); + .unwrap_or(&"no panic information is obtainable"); stderr.set_state(vga_text::CharState::from_colors( - vga_text::Color::Cyan, vga_text::Color::Red)); + vga_text::Color::Cyan, + vga_text::Color::Red, + )); stderr.print_centered(text.as_bytes()); loop {} } |