⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ConsoleDriver

Struct ConsoleDriver 

Source
pub struct ConsoleDriver { /* private fields */ }
Expand description

Console driver that manages multiple console devices

Implementations§

Source§

impl ConsoleDriver

Source

pub fn new() -> Self

Create a new console driver

Source

pub fn add_device(&mut self, device: Box<dyn ConsoleDevice>)

Add a console device

Source

pub fn set_active_device(&mut self, index: usize) -> Result<(), KernelError>

Set active console device

Source

pub fn get_active_device(&mut self) -> Option<&mut dyn ConsoleDevice>

Get active console device

Source

pub fn write_to_all(&mut self, s: &str)

Write to all console devices

Trait Implementations§

Source§

impl Default for ConsoleDriver

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Driver for ConsoleDriver

Source§

fn name(&self) -> &str

Get driver name
Source§

fn supported_classes(&self) -> Vec<DeviceClass>

Get supported device classes
Source§

fn supports_device(&self, device: &DeviceInfo) -> bool

Check if driver supports a device
Source§

fn probe(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>

Probe device
Source§

fn attach(&mut self, device: &DeviceInfo) -> Result<(), KernelError>

Attach to device
Source§

fn detach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>

Detach from device
Source§

fn suspend(&mut self) -> Result<(), KernelError>

Suspend device
Source§

fn resume(&mut self) -> Result<(), KernelError>

Resume device
Source§

fn handle_interrupt(&mut self, _irq: u8) -> Result<(), KernelError>

Handle interrupt
Source§

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>

Write to device
Source§

fn ioctl(&mut self, cmd: u32, arg: u64) -> Result<u64, KernelError>

Device control (ioctl)

Auto Trait Implementations§

§

impl Freeze for ConsoleDriver

§

impl !RefUnwindSafe for ConsoleDriver

§

impl Send for ConsoleDriver

§

impl Sync for ConsoleDriver

§

impl Unpin for ConsoleDriver

§

impl !UnwindSafe for ConsoleDriver

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.