Skip to content

KDAL

KDAL is a hardware-agnostic abstraction framework for the Linux kernel. Describe your device in .kdh, implement your driver in .kdc, and let the compiler generate the kernel module’s C (the generated module does not build yet: open finding O7). In this ecosystem, KDAL’s module runs in Linux inside HAVEN’s partition A on HAVEN pull requests that change code, at the KDAL commit HAVEN pins.

Start with the introduction, then install it; the source is on GitHub.

flowchart TB US["User space<br/>kdality (CLI), testapp and benchmark (tests/userspace),<br/>kdaltest (tests/integration)<br/>(implemented)"] CP["Control plane: src/core/<br/>chardev.c: /dev/kdal, ioctl dispatch<br/>debugfs.c: introspection and the demand report"] CORE["Core runtime: src/core/<br/>registry, event, power, demand, kdal, module"] DRV["Example drivers: src/drivers/example/<br/>uart, i2c, spi, gpu (accelerator ops)"] BE["Backends: src/backends/<br/>generic: devicetree, platdev, socglue<br/>qemu: qemubackend, virtioio, virtioaccel, mmio"] HW["Devices: MMIO, platform devices,<br/>device tree nodes, virtio"] US -->|ioctl, read, write| CP CP --> CORE CORE --> DRV DRV --> BE BE --> HW classDef observed stroke:#0ca30c,stroke-width:2px classDef implemented stroke:#fab219,stroke-width:2px class CP,CORE,DRV,BE observed class US implemented

The same diagram as KDAL’s README (key: Start here, Reading the diagrams): green parts are built into kdal.ko, which CI loads and tests with its KUnit suites; the user-space programs build, but CI does not run them against the module.

Part State
Kernel module (src/, include/) and the kdality CLI Active: the device-access driver inside HAVEN’s Linux partition
Language, kdalc compiler, editor plugins Frozen since 2026-11-01: kept, still built and checked by CI

Declarative Device Headers

Describe registers, signals, power states, and capabilities in .kdh files, a purpose-built DSL; kdality lint warns about accesses the header does not allow (the compiler does not reject them yet).

Imperative Driver Logic

Write event handlers in .kdc files with familiar control flow. The compiler generates Linux kernel C; the generated module does not build yet (O7).

Backend-Agnostic

A design goal: one driver across QEMU, MMIO, platform devices, Device Tree and VirtIO. Today the example drivers are written against the QEMU backend, and the compiler does not use a driver’s backend.

Full Toolchain

kdalc compiler, kdality CLI (init, lint, simulate, compile, dt-gen, test-gen), VS Code extension, Vim plugin - everything you need.

Terminal window
curl -fsSL https://raw.githubusercontent.com/NguyenTrongPhuc552003/kdal/main/scripts/installer/install.sh | sh

Or install the packages from the v0.2.0 release (there is no Homebrew tap and no distribution repository yet):

Terminal window
# Debian / Ubuntu (x86_64)
sudo apt install ./kdal_0.2.0-1_amd64.deb ./kdal-dev_0.2.0-1_amd64.deb
# Fedora (x86_64)
sudo dnf install ./kdal-0.2.0-1.fc45.x86_64.rpm ./kdal-devel-0.2.0-1.fc45.x86_64.rpm

The release also has archives for macOS (aarch64, x86_64) and Linux (aarch64, riscv64, x86_64), a source archive, the VS Code extension (kdal-lang-0.2.0.vsix) and SHA256SUMS.

Platform Architecture Status
Linux (QEMU aarch64) ARM64 Primary target: module and KUnit in CI (Linux 6.18)
Linux (native x86_64) x86_64 Development host
Linux (RISC-V) riscv64 Host tools only (release archive); module not tested
macOS (Apple Silicon) ARM64 Toolchain only