From a86f59b32eb86a1ccb94bf1e627c1115c3b6b217 Mon Sep 17 00:00:00 2001 From: Tianhao Wang Date: Thu, 6 Jun 2024 00:02:53 +0200 Subject: io: add serial output through port 0x3f8 (qemu) not yet wrapped with fmt macros because I want some thing stateless. (i.e. I don't want to pass `&mut self` to write_str...). --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 99478be..185014d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -9,7 +9,6 @@ mod ds; mod io; mod machine; mod mm; -use crate::machine::key::Modifiers; mod proc; extern crate alloc; use alloc::vec::Vec; @@ -19,7 +18,9 @@ use arch::x86_64::interrupt::pic_8259::PicDeviceInt; use core::panic::PanicInfo; use defs::*; use machine::cgascr::CGAScreen; +use machine::key::Modifiers; use machine::multiboot; +use machine::serial::Serial; #[cfg(not(test))] #[panic_handler] @@ -61,6 +62,7 @@ pub extern "C" fn _entry() -> ! { for s in test_vec.iter() { println!("{s}"); } + Serial::print("hello from serial"); loop { io::KBCTL_GLOBAL.lock().fetch_key(); if let Some(k) = io::KBCTL_GLOBAL.lock().consume_key() { -- cgit v1.2.3-70-g09d2