From 2430b7b2a7354c31a9b58b553a75c3a685b2e2ce Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 6 Sep 2026 21:11:34 +0800 Subject: uart: more elegant init earlyprintk: actually init COM1, not sure why the other coms arent working --- kernel/src/init/earlyprintk.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kernel/src/init') diff --git a/kernel/src/init/earlyprintk.rs b/kernel/src/init/earlyprintk.rs index a217a92..1748620 100644 --- a/kernel/src/init/earlyprintk.rs +++ b/kernel/src/init/earlyprintk.rs @@ -3,11 +3,12 @@ use spin::{lazylock::LazyLock, mutex::Mutex}; use crate::io::output::serial::uart_16550::Uart16550; // TODO: use linkme instead -pub static EARLY_PRINTK_SERIAL: LazyLock>> = - LazyLock::new(|| match unsafe { Uart16550::init([const { None }; 4]) } { +pub static EARLY_PRINTK_SERIAL: LazyLock>> = LazyLock::new(|| { + match unsafe { Uart16550::init([Some(Default::default()), None, None, None]) } { Ok(o) => Some(Mutex::new(o)), Err(_) => None, - }); + } +}); #[macro_export] // TODO: configurable via option or arguments -- cgit v1.2.3