1
0
Fork 0
forked from AbleOS/ableos
ableos-idl/ableos/src/stdio.rs

35 lines
636 B
Rust
Raw Normal View History

use core::fmt::Arguments;
use core::fmt::Error;
use core::fmt::Write;
use crate::kprintln;
#[derive(Debug, Clone, Copy)]
pub enum Device {
VTerm,
Serial,
}
#[derive(Debug, Clone, Copy)]
pub struct StdIO {
device: Device,
}
impl StdIO {
pub fn new(device: Device) -> StdIO {
StdIO { device }
}
pub fn write(&mut self) {
match self.device {
Device::VTerm => {
println!("Hello, world!");
}
Device::Serial => {
serial_println!("Hello, world!");
}
}
}
pub fn read(&mut self) {
todo!();
}
}