danos/system/kernel
Daniel Samson 6e0e0a62c6
virtio-gpu: a modern virtio 1.0 display driver, bring-up to a flushed frame (v2 V3)
The first native scanout backend's driver half. The device manager matches the
virtio-gpu PCI function by its Display/Other class triple and spawns the driver,
which claims the device, confirms vendor 0x1AF4/device 0x1050 from config space,
enables memory-space + bus mastering, and walks the virtio vendor capabilities to
find the common-config and notify structures in its BAR.

From there it is the standard modern-virtio bring-up: reset, negotiate VERSION_1,
stand up the control virtqueue in coherent DMA, then drive the GPU end to end —
RESOURCE_CREATE_2D, ATTACH_BACKING (a coherent DMA buffer; V4 swaps in the shm-
shared surface), SET_SCANOUT, paint a known pattern, TRANSFER_TO_HOST_2D,
RESOURCE_FLUSH, and wait for the device's used-ring ack. Reading the backing back
proves it is CPU-visible RAM; the ack proves the device consumed the frame —
together the automated stand-in for "it's on screen", no screenshot.

- system/drivers/virtio-gpu/: the driver, plus virtio-gpu-protocol.zig (control
  commands) and virtio-pci.zig (the 1.0 PCI transport + split-virtqueue), both with
  host-tested struct sizes.
- device-manager matches the display/other class triple to "virtio-gpu"; the driver
  self-confirms the vendor/device id, since the class alone cannot distinguish it.
- ServiceId.scanout (11): the driver registers it so the compositor finds it in V4.

Gate: python3 test/qemu_test.py virtio-gpu (QEMU -device virtio-gpu-pci) — the
device-manager stack discovers the function, the driver brings up a 640x480 scanout
and flushes a test pattern: "virtio-gpu: scanout 640x480 online" + "flush acked,
pixel check ok". host tests, display-service, shm, and device-list still pass.

Note: the pre-existing pci-scan case triple-faults on main (verified at 88ad432,
before this change); it is unrelated and tracked separately.
2026-07-14 11:29:53 +01:00
..
architecture/x86_64 kernel: shm cross-process shared memory capability (v2 V2) 2026-07-14 10:57:14 +01:00
console.zig kernel: route routine status to the log, not the framebuffer console 2026-07-14 08:26:55 +01:00
devices-broker.zig display: framebuffer handoff primitive + service design (D1) 2026-07-14 00:54:56 +01:00
font.psf Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
heap.zig Split the `system` contract into boot-handoff / abi / device-abi 2026-07-10 18:08:51 +01:00
ipc-synchronous.zig kernel: shm cross-process shared memory capability (v2 V2) 2026-07-14 10:57:14 +01:00
ipc.zig Re-organize the source tree as a monorepo mirroring the FHS 2026-07-10 12:55:56 +01:00
irq.zig M15: interrupts for PCI devices (ECAM config space + MSI) 2026-07-10 19:59:09 +01:00
kernel.zig kernel: contain a fatal fault — name the task, release the BKL before halt 2026-07-14 09:05:10 +01:00
log.zig Persist the kernel boot log to the USB FAT volume 2026-07-13 18:18:34 +01:00
pmm.zig M14b: DMA memory (dma_alloc / dma_free) 2026-07-10 19:43:59 +01:00
process.zig kernel: shm cross-process shared memory capability (v2 V2) 2026-07-14 10:57:14 +01:00
scheduler.zig kernel: shm cross-process shared memory capability (v2 V2) 2026-07-14 10:57:14 +01:00
sync.zig kernel: contain a fatal fault — name the task, release the BKL before halt 2026-07-14 09:05:10 +01:00
tests.zig virtio-gpu: a modern virtio 1.0 display driver, bring-up to a flushed frame (v2 V3) 2026-07-14 11:29:53 +01:00
wall-clock.zig Phase 2d (i): a kernel wall-clock from the CMOS RTC 2026-07-13 20:35:03 +01:00