Expand description
VirtIO block device driver VirtIO block device driver for boot partition access.
Minimal read-only driver for reading modules from the FAT32 boot partition. Supports VirtIO MMIO transport (common on RISC-V/ARM64 QEMU) with a working virtqueue-based block read implementation.
Uses the kernel frame allocator (available after buddy init) to allocate physically-contiguous vring and bounce-buffer memory.
Structsยง
- Boot
Block ๐Header - VirtIO block request header (must match device layout exactly).
- Boot
Virtqueue ๐ - Minimal boot-time virtqueue with a static vring allocation.
- Virtio
BlkDevice - VirtIO block device (boot-time MMIO transport)
- Vring
Avail ๐ - Available ring header (followed by
queue_sizeu16 ring entries + optional used_event). - Vring
Desc ๐ - VRING descriptor (16 bytes).
- Vring
Used ๐ - Used ring header (followed by
queue_sizeVringUsedElem entries + optional avail_event). - Vring
Used ๐Elem - Used ring element (8 bytes).
Enumsยง
- Boot
Block ๐Status - VirtIO block request status byte.
Constantsยง
- BOOT_
QUEUE_ ๐SIZE - Small queue size is enough for single-block boot reads (header+data+status = 3 descs).
- REG_
CAPACITY ๐ - REG_
DEVICE_ ๐FEATURES - REG_
DRIVER_ ๐FEATURES - REG_
QUEUE_ ๐ALIGN - REG_
QUEUE_ ๐NOTIFY - REG_
QUEUE_ ๐NUM - REG_
QUEUE_ ๐NUM_ MAX - REG_
QUEUE_ ๐PFN - REG_
QUEUE_ ๐SEL - REG_
STATUS ๐ - REQ_
TYPE_ ๐IN - STATUS_
ACK ๐ - STATUS_
DRIVER ๐ - STATUS_
DRIVER_ ๐OK - STATUS_
FAILED ๐ - STATUS_
FEATURES_ ๐OK - VRING_
DESC_ ๐F_ NEXT - VRING_
DESC_ ๐F_ WRITE