mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-17 06:47:49 +00:00
Add a print_error function, which works for exceptions inside println
This commit is contained in:
@@ -38,6 +38,19 @@ pub fn clear_screen() {
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn print_error(fmt: fmt::Arguments) {
|
||||
use core::fmt::Write;
|
||||
|
||||
let mut writer = Writer {
|
||||
column_position: 0,
|
||||
color_code: ColorCode::new(Color::Red, Color::Black),
|
||||
buffer: Unique::new(0xb8000 as *mut _),
|
||||
};
|
||||
writer.new_line();
|
||||
writer.write_fmt(fmt);
|
||||
}
|
||||
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[repr(u8)]
|
||||
pub enum Color {
|
||||
|
||||
Reference in New Issue
Block a user