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

Module mmio

Module mmio 

Source
Expand description

Virtio MMIO transport (virtio 1.0 legacy-compatible)

Implements the virtio-over-MMIO transport layer as defined in the virtio specification, section 4.2. This is the transport used on AArch64 and RISC-V QEMU virt machines, where virtio devices are memory-mapped rather than behind PCI.

§Default MMIO Base Addresses

The DEFAULT_BASES array lists the first four virtio-mmio device regions for QEMU’s virt machine. Each region is 0x200 bytes (512 bytes) and contains the standard virtio-mmio register set at the offsets defined in the regs module. Valid register offsets range from 0x000 to 0x0A4. Device-specific configuration space starts at offset 0x100 (modern) or STATUS + 0x14 (legacy).

§Usage

This is a minimal implementation sufficient for virtio-blk using split virtqueues. For x86_64, the PCI transport in mod.rs is used instead. See super::VirtioTransport for the unified transport enum.

Structs§

VirtioMmioTransport
Handle for a single virtio-mmio device.

Constants§

DEFAULT_BASES
Fallback for other architectures (should not be reached; MMIO transport is only used on AArch64 and RISC-V).

Functions§

try_init_mmio_blk
Try to initialize a virtio-mmio block device at base.