Add ns16550a

This commit is contained in:
Yifan Wu 2022-02-18 13:09:03 -08:00
parent fef12c79f1
commit 704eae3bb0
16 changed files with 311 additions and 129 deletions

View file

@ -1,4 +1,4 @@
use crate::sbi::console_putchar;
use crate::drivers::chardev::{CharDevice, UART};
use core::fmt::{self, Write};
struct Stdout;
@ -6,7 +6,7 @@ struct Stdout;
impl Write for Stdout {
fn write_str(&mut self, s: &str) -> fmt::Result {
for c in s.chars() {
console_putchar(c as usize);
UART.write(c as u8);
}
Ok(())
}