From 041aa2bfe631b314755393b423cca6ac06cd9b35 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 26 Oct 2016 09:08:27 +0200 Subject: [PATCH] Remove print_error and use normal println in exception handlers (cherry picked from commit 9b83b2853e7182294107612514953a840aa2b149) --- src/interrupts/mod.rs | 4 +--- src/vga_buffer.rs | 12 ------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/interrupts/mod.rs b/src/interrupts/mod.rs index 99b850fa..fa6a93ab 100644 --- a/src/interrupts/mod.rs +++ b/src/interrupts/mod.rs @@ -23,9 +23,7 @@ pub fn init() { IDT.load(); } -use vga_buffer::print_error; - extern "C" fn divide_by_zero_handler() -> ! { - unsafe { print_error(format_args!("EXCEPTION: DIVIDE BY ZERO")) }; + println!("EXCEPTION: DIVIDE BY ZERO"); loop {} } diff --git a/src/vga_buffer.rs b/src/vga_buffer.rs index 1d9d117e..e3cc06cc 100644 --- a/src/vga_buffer.rs +++ b/src/vga_buffer.rs @@ -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)] #[derive(Debug, Clone, Copy)] #[repr(u8)]