pub mod colors; pub mod buffer; use core::fmt; use lazy_static::lazy_static; use spin::Mutex; lazy_static! { pub static ref WRITER: Mutex = Mutex::new(buffer::Writer { column_position: 0, color_code: colors::ColorCode::new(colors::Color::Yellow, colors::Color::Black), buffer: unsafe { &mut *(0xb8000 as *mut buffer::Buffer) }, }); } #[macro_export] macro_rules! println { () => (print!("\n")); ($($arg:tt)*) => (print!("{}\n", format_args!($($arg)*))); } #[macro_export] macro_rules! print { ($($arg:tt)*) => ($crate::io::vga::_print(format_args!($($arg)*))); } #[doc(hidden)] pub fn _print(args: fmt::Arguments) { use core::fmt::Write; WRITER.lock().write_fmt(args).unwrap(); }