Skip to main content

Module blkdev_scheme

Module blkdev_scheme 

Source
Expand description

Block-device scheme : exposes raw disk devices under /dev.

§Namespace layout

/dev/          : directory listing (this scheme root)
/dev/sda       : first SATA disk (AHCI port 0), raw byte-addressable

§I/O model

The AHCI driver operates on 512-byte sectors. This scheme accepts arbitrary byte offsets and lengths and performs the necessary sector-aligned read/modify/write internally using a stack-allocated 512-byte bounce buffer.

§VFS wiring

BlkDevScheme implements the kernel Scheme trait so it can be mounted with vfs::mount::mount("/dev", Arc::new(BlkDevScheme)) during vfs::init().

Structs§

BlkDevScheme
Kernel scheme that serves raw block devices as files under /dev.

Constants§

FID_NULL 🔒
FID_RANDOM 🔒
FID_ROOT 🔒
FID_SDA 🔒
FID_URANDOM 🔒
FID_VDA 🔒
FID_ZERO 🔒
RDEV_NULL 🔒
RDEV_RANDOM 🔒
RDEV_SDA 🔒
RDEV_URANDOM 🔒
RDEV_VDA 🔒
RDEV_ZERO 🔒

Statics§

PRNG_STATE 🔒

Functions§

prng_fill 🔒
Performs the prng fill operation.
sector_read 🔒
Read buf.len() bytes from the block device starting at byte offset.
sector_write 🔒
Write data bytes to the block device starting at byte offset.
try_direct_async_request 🔒