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

AtaDriver

Struct AtaDriver 

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

ATA (IDE) driver implementation

Implementations§

Source§

impl AtaDriver

Source

pub fn new( name: String, base_port: u16, is_master: bool, device_info: DeviceInfo, ) -> Self

Create a new ATA driver

Source

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

Initialize ATA device

Trait Implementations§

Source§

impl Driver for AtaDriver

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)
Source§

impl StorageDevice for AtaDriver

Source§

fn name(&self) -> &str

Get device name
Source§

fn get_info(&self) -> StorageInfo

Get device information
Source§

fn get_stats(&self) -> StorageStats

Get device statistics
Source§

fn reset_stats(&mut self)

Reset statistics
Source§

fn read_sectors( &mut self, lba: u64, count: u32, buffer: &mut [u8], ) -> Result<u32, KernelError>

Read sectors
Source§

fn write_sectors( &mut self, lba: u64, count: u32, data: &[u8], ) -> Result<u32, KernelError>

Write sectors
Source§

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

Flush cache
Source§

fn is_ready(&self) -> bool

Check if device is ready
Source§

fn max_transfer_sectors(&self) -> u32

Get maximum transfer size in sectors

Auto Trait Implementations§

§

impl !Freeze for AtaDriver

§

impl !RefUnwindSafe for AtaDriver

§

impl Send for AtaDriver

§

impl Sync for AtaDriver

§

impl Unpin for AtaDriver

§

impl UnwindSafe for AtaDriver

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.