From 66b783de2121b05c0d4b013875c0dd8524311626 Mon Sep 17 00:00:00 2001 From: PanQL Date: Fri, 10 May 2019 14:56:14 +0800 Subject: [PATCH] should not be so rude --- kernel/src/arch/x86_64/io.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/kernel/src/arch/x86_64/io.rs b/kernel/src/arch/x86_64/io.rs index a25c655..c59ac60 100644 --- a/kernel/src/arch/x86_64/io.rs +++ b/kernel/src/arch/x86_64/io.rs @@ -10,18 +10,22 @@ pub fn getchar() -> char { } pub fn putfmt(fmt: Arguments) { - //#[cfg(feature = "nographic")] - //{ + #[cfg(feature = "nographic")] + { + unsafe { + COM1.force_unlock(); + } + COM1.lock().write_fmt(fmt).unwrap(); + } + #[cfg(not(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(); - //} + } }