diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2026-09-06 21:11:34 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2026-09-06 21:11:34 +0800 |
| commit | 2430b7b2a7354c31a9b58b553a75c3a685b2e2ce (patch) | |
| tree | ea9afc5d5febe93b923b451b90088c0d843682dd /kernel/src/init | |
| parent | d1128b8b4c210acbc48ead1303adb1e7c360359a (diff) | |
uart: more elegant init
earlyprintk: actually init COM1, not sure why the other coms arent
working
Diffstat (limited to 'kernel/src/init')
| -rw-r--r-- | kernel/src/init/earlyprintk.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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<Option<Mutex<Uart16550>>> = - LazyLock::new(|| match unsafe { Uart16550::init([const { None }; 4]) } { +pub static EARLY_PRINTK_SERIAL: LazyLock<Option<Mutex<Uart16550>>> = 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 |
