Log on tty (serial and vga)
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut};
|
||||
use crate::io;
|
||||
|
||||
#[path = "unsupported.rs"]
|
||||
mod unsupported;
|
||||
pub use self::unsupported::{STDIN_BUF_SIZE, Stderr, Stdin, is_ebadf};
|
||||
pub use self::unsupported::{STDIN_BUF_SIZE, Stderr, is_ebadf};
|
||||
|
||||
pub struct Stdout;
|
||||
// pub struct Stdin;
|
||||
pub struct Stdin;
|
||||
|
||||
impl Stdout {
|
||||
pub const fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
// impl Stdin {
|
||||
// pub const fn new() -> Self {
|
||||
// Self
|
||||
// }
|
||||
// }
|
||||
impl Stdin {
|
||||
pub const fn new() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
||||
impl io::Write for Stdout {
|
||||
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
|
||||
unsafe { Ok(write(1, buf) as usize) }
|
||||
Ok(write(1, buf) as usize)
|
||||
}
|
||||
|
||||
fn flush(&mut self) -> io::Result<()> {
|
||||
@@ -29,12 +29,11 @@ impl io::Write for Stdout {
|
||||
}
|
||||
}
|
||||
|
||||
// impl io::Read for Stdin {
|
||||
// fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
// Ok(0)
|
||||
// // unsafe { Ok(read(0, buf) as usize) }
|
||||
// }
|
||||
// }
|
||||
impl io::Read for Stdin {
|
||||
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
|
||||
Ok(read(0, buf) as usize)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn panic_output() -> Option<impl io::Write> {
|
||||
// Todo, use Stderr
|
||||
|
||||
Reference in New Issue
Block a user