Done
7 / 77 of 7 issues completedLabels
epicUmbrella milestone or multi-issue epic
Description
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
- Blocked by: [ISSUE] Separate driver implementations into a modular structure for out-of-tree builds #72 for Stages 2–5.
Architectural Guidelines
Core Platform / HAL Boundary (Stage 1)
- Keep existing early-boot
UARTConsole(0x09000000) andGicV2(0x08000000/0x08010000) foundations insidekernel//arch/as the core platform layer that backskernel/ddk/(PlatformServices::log,PlatformServices::register_irq). - Use
finalclasses where appropriate,privatem_*members, explicit lifecycle/accessor methods, and kernel RAII primitives (Sync::IrqGuard,RefPtr) with no rawstructmutation 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 againstinclude/ddk/and freestanding C++20 headers—no#includepaths intokernel/orarch/. - Dependency Injection & RAII: Replace direct kernel header usage (
Sync::IrqGuard,MM::PageFrameAllocator, raw MMIO pointers) withKernel::DDK::PlatformServicescapabilities and move-only RAII handles (MmioRegion,DmaBuffer,IrqHandle,IrqLock). - UAPI & ABI Separation: Keep any Linux
uapitypes (such asinput_event/ evdev structures) insidekernel/uapi/as standard-layoutextern "C"structs withstatic_assertlayout checks; DDK drivers expose cleanKernel::DDKdevice-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 mockPlatformServices(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 intokernel/ddk/.
DDK-Isolated Drivers (drivers/ via include/ddk/)
- Stage 2 (Display): QEMU
fw_cfg(0x09020000) &ramfbframebuffer (orvirtio-gpuonvirtio-mmioas an alternative) usingMmioRegionandDmaBuffer. - Stage 3 (Bus Layer): VirtIO MMIO transport (
0x0a000000–0x0a003e00) &SplitVirtqueuerefactored into a DDK bus/transport library (drivers/bus/virtio_mmio/) overPlatformServices. - Stage 4 (Input): VirtIO HID Input (
virtio-mmio, Device ID18) implemented against the DDK VirtIO bus and registered via DDK input device contracts. - Stage 5 (Network): VirtIO Ethernet NIC (
virtio-mmio, Device ID1) implemented against the DDK VirtIO bus with DMA ring buffers (DmaBuffer) and IRQ-driven packet handling (IrqHandle).
Verification
make allbuilds cleanly underaarch64-linux-gnu-g++(-std=c++20 -Werror)make export-ddkpackagesinclude/ddk/anddrivers/ddk.mkcleanly, and Stages 2–5 compile againstMILO_DDK_DIRwithout-Ikernelor-Iarchmake qualitypassesclang-format --dry-run --Werror,clang-tidy(lint-report), and host testsmake test-hostpasses host unit test suite (including mockPlatformServicesdriver tests) with ASan/UBSan and coverage reporting
Sub-issues
Collapse Sub-issuesSub-issues
Loading 7 sub-issues
Metadata
Metadata
Assignees
Labels
epicUmbrella milestone or multi-issue epic
Type
Projects
- StatusShow more project fieldsDone
Activity