pub struct ConsoleDriver { /* private fields */ }Expand description
Console driver that manages multiple console devices
Implementations§
Source§impl ConsoleDriver
impl ConsoleDriver
Sourcepub fn add_device(&mut self, device: Box<dyn ConsoleDevice>)
pub fn add_device(&mut self, device: Box<dyn ConsoleDevice>)
Add a console device
Sourcepub fn set_active_device(&mut self, index: usize) -> Result<(), KernelError>
pub fn set_active_device(&mut self, index: usize) -> Result<(), KernelError>
Set active console device
Sourcepub fn get_active_device(&mut self) -> Option<&mut dyn ConsoleDevice>
pub fn get_active_device(&mut self) -> Option<&mut dyn ConsoleDevice>
Get active console device
Sourcepub fn write_to_all(&mut self, s: &str)
pub fn write_to_all(&mut self, s: &str)
Write to all console devices
Trait Implementations§
Source§impl Default for ConsoleDriver
impl Default for ConsoleDriver
Source§impl Driver for ConsoleDriver
impl Driver for ConsoleDriver
Source§fn supported_classes(&self) -> Vec<DeviceClass>
fn supported_classes(&self) -> Vec<DeviceClass>
Get supported device classes
Source§fn supports_device(&self, device: &DeviceInfo) -> bool
fn supports_device(&self, device: &DeviceInfo) -> bool
Check if driver supports a device
Source§fn probe(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
fn probe(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
Probe device
Source§fn attach(&mut self, device: &DeviceInfo) -> Result<(), KernelError>
fn attach(&mut self, device: &DeviceInfo) -> Result<(), KernelError>
Attach to device
Source§fn detach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
fn detach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>
Detach from device
Source§fn suspend(&mut self) -> Result<(), KernelError>
fn suspend(&mut self) -> Result<(), KernelError>
Suspend device
Source§fn resume(&mut self) -> Result<(), KernelError>
fn resume(&mut self) -> Result<(), KernelError>
Resume device
Source§fn handle_interrupt(&mut self, _irq: u8) -> Result<(), KernelError>
fn handle_interrupt(&mut self, _irq: u8) -> Result<(), KernelError>
Handle interrupt
Source§fn read(
&mut self,
_offset: u64,
_buffer: &mut [u8],
) -> Result<usize, KernelError>
fn read( &mut self, _offset: u64, _buffer: &mut [u8], ) -> Result<usize, KernelError>
Read from device
Source§fn write(&mut self, _offset: u64, data: &[u8]) -> Result<usize, KernelError>
fn write(&mut self, _offset: u64, data: &[u8]) -> Result<usize, KernelError>
Write to device
Source§fn ioctl(&mut self, cmd: u32, arg: u64) -> Result<u64, KernelError>
fn ioctl(&mut self, cmd: u32, arg: u64) -> Result<u64, KernelError>
Device control (ioctl)