mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Remove print_error and use normal println in exception handlers
(cherry picked from commit 9b83b2853e)
This commit is contained in:
@@ -23,9 +23,7 @@ pub fn init() {
|
|||||||
IDT.load();
|
IDT.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
use vga_buffer::print_error;
|
|
||||||
|
|
||||||
extern "C" fn divide_by_zero_handler() -> ! {
|
extern "C" fn divide_by_zero_handler() -> ! {
|
||||||
unsafe { print_error(format_args!("EXCEPTION: DIVIDE BY ZERO")) };
|
println!("EXCEPTION: DIVIDE BY ZERO");
|
||||||
loop {}
|
loop {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,18 +43,6 @@ 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)]
|
#[allow(dead_code)]
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
|
|||||||
Reference in New Issue
Block a user