|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
use super::driver::serial::*;
|
|
|
|
|
use super::driver::vga::VGA_WRITER;
|
|
|
|
|
use core::fmt::{Arguments, Write};
|
|
|
|
|
|
|
|
|
|
pub fn getchar() -> char {
|
|
|
|
@ -7,6 +8,14 @@ pub fn getchar() -> char {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn putfmt(fmt: Arguments) {
|
|
|
|
|
unsafe { COM1.force_unlock(); }
|
|
|
|
|
COM1.lock().write_fmt(fmt).unwrap()
|
|
|
|
|
#[cfg(feature = "nographic")]
|
|
|
|
|
{
|
|
|
|
|
unsafe { COM1.force_unlock(); }
|
|
|
|
|
COM1.lock().write_fmt(fmt).unwrap();
|
|
|
|
|
}
|
|
|
|
|
#[cfg(not(feature = "nographic"))]
|
|
|
|
|
{
|
|
|
|
|
unsafe { VGA_WRITER.force_unlock(); }
|
|
|
|
|
VGA_WRITER.lock().write_fmt(fmt).unwrap();
|
|
|
|
|
}
|
|
|
|
|
}
|