zodiac 0.1.0

Rust OS framework that offers safe interfaces for kernel development
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use spin::{Lazy, Mutex};
use uart_16550::SerialPort;

static SERIAL_PORT: Lazy<Mutex<SerialPort>> = Lazy::new(|| {
    Mutex::new(unsafe {
        let mut port = SerialPort::new(0x3f8);
        port.init();
        port
    })
});

pub(crate) fn send(data: u8) {
    SERIAL_PORT.lock().send(data);
}