Skip to content

Epic: Modular QEMU AArch64 (virt) Driver Bring-Up #157

Done
7 of 7 issues completed
Done

Description

@marcobuschini

Summary

Add modular C++20 device drivers for the QEMU virt (aarch64) platform across early boot, display, VirtIO MMIO transport, input, and networking. Stage 1 establishes core platform/HAL interrupt and early console foundations inside the kernel, while Stages 2–5 implement decoupled, out-of-tree-ready device drivers targeting Kernel::DDK (include/ddk/).

Dependencies

Architectural Guidelines

Core Platform / HAL Boundary (Stage 1)

  • Keep existing early-boot UARTConsole (0x09000000) and GicV2 (0x08000000 / 0x08010000) foundations inside kernel/ / arch/ as the core platform layer that backs kernel/ddk/ (PlatformServices::log, PlatformServices::register_irq).
  • Use final classes where appropriate, private m_* members, explicit lifecycle/accessor methods, and kernel RAII primitives (Sync::IrqGuard, RefPtr) with no raw struct mutation by external subsystems.

DDK Driver Boundary (Stages 2–5)

  • Strict Header Isolation: All drivers in Stages 2–5 must reside under drivers/ and compile strictly against include/ddk/ and freestanding C++20 headers—no #include paths into kernel/ or arch/.
  • Dependency Injection & RAII: Replace direct kernel header usage (Sync::IrqGuard, MM::PageFrameAllocator, raw MMIO pointers) with Kernel::DDK::PlatformServices capabilities and move-only RAII handles (MmioRegion, DmaBuffer, IrqHandle, IrqLock).
  • UAPI & ABI Separation: Keep any Linux uapi types (such as input_event / evdev structures) inside kernel/uapi/ as standard-layout extern "C" structs with static_assert layout checks; DDK drivers expose clean Kernel::DDK device-class interfaces that the kernel bridges to UAPI at the syscall/VFS boundary.
  • Dual-Target Verification: Every DDK driver must support both cross-compiled QEMU targets (make all) and host-side Catch2 unit testing via mock PlatformServices (make test-host).

Phased Sub-Issues

Core Kernel / HAL Bring-Up

  • Stage 1 (Early Boot — In-Kernel HAL): PL011 UART console (0x09000000) & GICv2 interrupt controller (0x08000000 / 0x08010000), wiring IRQ dispatch and logging into kernel/ddk/.

DDK-Isolated Drivers (drivers/ via include/ddk/)

  • Stage 2 (Display): QEMU fw_cfg (0x09020000) & ramfb framebuffer (or virtio-gpu on virtio-mmio as an alternative) using MmioRegion and DmaBuffer.
  • Stage 3 (Bus Layer): VirtIO MMIO transport (0x0a000000–0x0a003e00) & SplitVirtqueue refactored into a DDK bus/transport library (drivers/bus/virtio_mmio/) over PlatformServices.
  • Stage 4 (Input): VirtIO HID Input (virtio-mmio, Device ID 18) implemented against the DDK VirtIO bus and registered via DDK input device contracts.
  • Stage 5 (Network): VirtIO Ethernet NIC (virtio-mmio, Device ID 1) implemented against the DDK VirtIO bus with DMA ring buffers (DmaBuffer) and IRQ-driven packet handling (IrqHandle).

Verification

  • make all builds cleanly under aarch64-linux-gnu-g++ (-std=c++20 -Werror)
  • make export-ddk packages include/ddk/ and drivers/ddk.mk cleanly, and Stages 2–5 compile against MILO_DDK_DIR without -Ikernel or -Iarch
  • make quality passes clang-format --dry-run --Werror, clang-tidy (lint-report), and host tests
  • make test-host passes host unit test suite (including mock PlatformServices driver tests) with ASan/UBSan and coverage reporting

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. added
    epic
    on Nov 27, 2026
  2. moved this from Backlog to Ready in kernelite/miloon Nov 27, 2026
  3. moved this from Ready to Backlog in kernelite/miloon Nov 27, 2026
  4. moved this from Backlog to Ready in kernelite/miloon Nov 27, 2026
  5. moved this from Ready to In progress in kernelite/miloon Nov 27, 2026
  6. moved this from In progress to Ready in kernelite/miloon Nov 27, 2026
  7. moved this from Ready to In progress in kernelite/miloon Nov 30, 2026
  8. moved this from In progress to Done in kernelite/miloon Nov 30, 2026
  9. closed this as completedby moving to Done in kernelite/miloon Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

epic

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions