|
|
@ -1,7 +1,14 @@
|
|
|
|
use core::fmt;
|
|
|
|
use core::fmt;
|
|
|
|
use core::ptr::Unique;
|
|
|
|
use core::ptr::Unique;
|
|
|
|
|
|
|
|
use spin::Mutex;
|
|
|
|
use volatile::Volatile;
|
|
|
|
use volatile::Volatile;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub static WRITER: Mutex<Writer> = Mutex::new(Writer {
|
|
|
|
|
|
|
|
column_position: 0,
|
|
|
|
|
|
|
|
color_code: ColorCode::new(Color::LightGreen, Color::Black),
|
|
|
|
|
|
|
|
buffer: unsafe { Unique::new_unchecked(0xb8000 as *mut _) },
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
|
|
|
#[allow(dead_code)]
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
|
|
#[repr(u8)]
|
|
|
|
#[repr(u8)]
|
|
|
@ -116,17 +123,3 @@ impl fmt::Write for Writer {
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn print_something() {
|
|
|
|
|
|
|
|
use core::fmt::Write;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let mut writer = Writer {
|
|
|
|
|
|
|
|
column_position: 0,
|
|
|
|
|
|
|
|
color_code: ColorCode::new(Color::LightGreen, Color::Black),
|
|
|
|
|
|
|
|
buffer: unsafe { Unique::new(0xb8000 as *mut _) },
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writeln!(writer, "Hello!");
|
|
|
|
|
|
|
|
writeln!(writer, "The numbers are {} and {}", 42, 1.0/3.0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|