Repository navigation
Releases
Releases · NguyenTrongPhuc552003/kdal
v0.2.0
KDAL v0.2.0, built by CI from 8596442 (run 45253065422): SDK tarballs for
Linux (x86_64, aarch64, riscv64) and macOS (aarch64, x86_64), the source, a deb, an rpm
and the VS Code extension; SHA256SUMS below.
Changes since v0.1.0. The language, compiler and editor plugins (lang/,
compiler/, editor/) are frozen since 2026-11-01; the kdality runtime
CLI (tools/) is maintained (README, "Layout"). The QEMU and Docker
integration for VS Code that v0.1.0 deferred to this release is not in it:
the editor plugins are frozen.
Added
- Devices report their resource demand (MMIO range, GIC INTIDs, SMMU and
StreamIDs) instruct kdal_demand;/sys/kernel/debug/kdal/demandprints
it as JSON with the FF-A partition manifest property names. The
device-tree backend fills it fromreg,interruptsandiommus
(audit K4). - KUnit suite
kdal-demand(2 cases). make KDAL_KUNIT=ybuilds the KUnit suites intokdal.ko(audit K12).- CI on GitHub Actions: smoke tests on Linux and macOS, lint, and a job that
buildskdal.koagainst Linux v6.18 arm64, runs its KUnit suites in QEMU
and checks the reported device demand (audit K1). - Local CodeQL runner (
scripts/dev/codeql.sh). - Issue templates and a pull request template.
Changed
- The KUnit test
find_driver_by_classchecks the driver class, not which
driver registers first (audit K11). - The project home moved to Codeberg on 2026-11-01 and back to GitHub on
2026-11-04; installer, release scripts, packaging and links point to
GitHub again. - README and docs: KDAL's scope in the HAVEN thesis, the CIX P1 target
platforms, the four drivers named example drivers, the KUnit suite table,
and which directories are maintained or frozen. - Compiler and
kdalityrefactors: parser statement handling split, compile
option parsing tightened, simulate expression dispatch, testgen parsing and
token enum numbering simplified. - Em-dashes replaced with ASCII hyphens; local CodeQL artifacts ignored.
- The guides (architecture, API, installation, language, porting, FAQ,
performance, upstreaming, thesis) live on the HAVEN docs site;docs/
keeps the records (docs/README.md).
Removed
website/(the Astro Starlight site): its pages are part of the ecosystem's
site in the haven-docs repository (docs-haven.vercel.app/kdal/), which also
copies this README and changelog at every build. Thewebsitetargets of
CMake andscripts/dev/, and the e2ewebsitesuite, are gone with it.
Fixed
- The module builds against Linux v6.18 with clang (
file_operationsand
accelerator op signatures) and loads without a crash: a driver is bound to
its device before probe. Out-of-tree builds default
CONFIG_KDAL_QEMU_BACKENDandCONFIG_KDAL_EXAMPLE_DRIVERSto y, as
Kconfig does (audit K7, K8, K9). - Registering an object that is already registered no longer resets its list
links and hangs the registry (audit K10). kdal_core_initruns the generic backend (SoC glue, platform backend,
device-tree scan), sokdal,devicenodes are found (audit K15).- Compiler and
kdality: input and output paths are validated (CodeQL
path-expression alerts), files are created with restricted permissions,
anddt-genandinitfile handling is hardened. - CI:
kernel-prepare.shaccepts a relative work directory; QEMU runs
without a network card. kdality initwrites a project that compiles, simulates, lints and
generates tests as written; every subcommand parses its arguments from
the first one after its name and refuses unknown options; absolute and
parent paths work and output directories are created;lintsees
register reads insidelet,logand conditions and bitfield paths,
and findskdal/stdlib/imports (docs/first-project-journey.md,
#38, #39).kdality simulate --traceshowslog("...")andwait(sig, ms)as
written (finding F2, #41).- The KUnit job's demand report goes through the kernel log, so KUnit's
own lines no longer land inside it (finding F3, #42; 0 failures in 200
stress boots, workflowkunit-stress.yml). - The e2e suites report a failing command as a failure and run in CI.
SHA256SUMS:
239bf207405e09e4a47cacb4be6b60e76ad7cce9e2d3696088f2a712a951bee4 kdal-0.2.0-1.fc45.x86_64.rpm
6bc2a793d845901dfb2bdc0ebf99b268c936e33ebdec3a1c03694990f7c5a482 kdal-debuginfo-0.2.0-1.fc45.x86_64.rpm
663dfe85f33146cfec405f9011b5cf1bee1ceb088c9022d93aa13da4be5a6e8d kdal-debugsource-0.2.0-1.fc45.x86_64.rpm
b6fbeb0e34152b3060270c45307bad196c7718f058e62815e78eddee9c666fb5 kdal-dev_0.2.0-1_amd64.deb
4781dd61900827f88e6310c1e9ea2286333288126e56d51f4e406a331d73c010 kdal-devel-0.2.0-1.fc45.x86_64.rpm
046d73b44098919f700edc725fe0d7267c7fccab293edc75797c35b30b9ca796 kdal-lang-0.2.0.vsix
46f04f180f4b52a06cca2604e7cf038e388dc88933f70fd8f32b0e6cb592b58b kdal-v0.2.0-darwin-aarch64.tar.gz
628170575331984603f0625db346e963561d3f02c783144c97f95174e8ea558d kdal-v0.2.0-darwin-x86_64.tar.gz
93a68ffa3d4b95d2a012c2ce1c1bc84b55aaf74bf9fa9fcf0a13626cfb8fe80c kdal-v0.2.0-linux-aarch64.tar.gz
22972b736871f07afc18432fc62a2e96a2b8d495e58ca5d40a7016cf051beb24 kdal-v0.2.0-linux-riscv64.tar.gz
d96859a20ba282eabdd733af35735aec4538c2f275375d802ef5a2ed58a7b462 kdal-v0.2.0-linux-x86_64.tar.gz
6fdbc486d3b6e48d3c2a5e98141d0fe346180559fe6a3642e222e761d980ba19 kdal-v0.2.0.tar.gz
302af74213e6e9e2cb6ac06c1018c19ba8d5fb966fee51ef726e77543c17cb50 kdal_0.2.0-1_amd64.deb
Run 45253065422: the SDK from the draft on Linux x86_64 and macOS aarch64: success.
v0.1.0
Added
Build System - CMake Migration
- Migrated from GNU Make to CMake 3.20+ as the unified build system
- Added convenience scripts:
build.sh,run.sh,test.shunderscripts/dev/ - Build output organization: all artifacts collected under
build/with subfolders build.shcollect_outputs()copies website dist →build/website/, vsix →build/editor/vscode/- CMake
uninstalltarget viainstall_manifest.txt - Vim/Neovim plugin install rule for editor/vim/vim-kdal/ subdirectories
Development Test Script
test.shwith numbered[N/M]PASS/FAIL test cases across 10 targets- CI-mirroring tests:
cppcheck,shellcheck,structurevalidation - Test report logging: saves results to
build/test/<target>_<YYYYMMDD_HHMMSS>.log
Compiler Improvements
- Block-based arena allocator (
kdal_arena_t) - linked-list of blocks, norealloc - Dotted name support in
driver ... for DEV.Nameclause (qualified identifiers) - Backend block no longer requires trailing semicolon (consistent with driver/device blocks)
Toolchain Subcommands
kdality init <name>- scaffold new driver projects (.kdh + .kdc + Makefile + README)kdality dt-gen <file.kdh>- generate Device Tree Source overlays from .kdh headerskdality simulate <file.kdc>- dry-run interpreter with register trace (no kernel needed)kdality test-gen <file.kdc>- auto-generate KUnit test stubs from driver handlerskdality lint <file>- static analysis with 9 rules (W001–W009) and --strict mode
VS Code Extension
- TextMate grammars for
.kdhand.kdcsyntax highlighting - Code snippets: device skeleton, driver skeleton, handler stubs, register access
- Language configuration with comment toggling and bracket matching
Core Runtime
- Module init/exit with full cascade (chardev → debugfs → backends → drivers)
- Registry with linked-list storage for backends, drivers, and devices
- Duplicate name prevention and find-by-name/class queries
- Device iterator (
kdal_for_each_device()) - Registry snapshot counters
- Circular event buffer (256 entries) with mutex and waitqueue
- Per-device power state management with event emission
Control Plane
- Character device
/dev/kdalviamisc_register() - Per-fd state with
kdal_file_ctxinfile->private_data - 6 ioctl commands: GET_VERSION, GET_INFO, SET_POWER, LIST_DEVICES, POLL_EVENT, SELECT_DEV
- Read/write dispatch to selected device's driver
- debugfs interface at
/sys/kernel/debug/kdal/with devices, version, snapshot files
Drivers
- UART driver with ring buffer allocation, baud/parity/stop config
- I2C driver with bus speed and slave address config
- SPI driver with clock/mode/bits-per-word config
- GPU driver with accelerator ops (queue/buffer/submit)
Backends
- QEMU backend with 4096-byte per-device ring buffer
- Virtio I/O readiness API stub
- Virtio accelerator readiness API stub
- MMIO helper with 8/16/32-bit read/write
- Generic platform device backend
- SoC glue layer stub for CIX P1
- Device Tree scanner (
CONFIG_OFguarded)
Userspace
kdalityCLI: version, list, info, power, read, write commands- Smoke test (
testapp): GET_VERSION, LIST_DEVICES, GET_INFO, loopback - Integration test (
kdaltest): multi-device, power cycling, error paths - Throughput benchmark with configurable parameters
Testing
- 38 KUnit test cases across 5 suites (core, registry, event, driver, accel)
- CI test script with 4-stage pipeline
Infrastructure
- QEMU workspace preparation (cloud image, cloud-init, 9p shared dir)
- Kernel cross-compilation script for Linux 6.6.80 aarch64
- QEMU launch and debug scripts
checkpatch.plwrapper- Static analysis (cppcheck, sparse, shellcheck)
- Coverage collection (gcov/lcov)
- Version bump script
- Changelog generator from conventional commits
- Dependency installer for macOS and Linux
- GitHub Actions CI workflows (build, test, lint, CodeQL, release)
Documentation
- Architecture: 6-layer diagram, data flow, init cascade, design decisions
- API Reference: all functions, ioctl table, types, contracts
- Installation: macOS/Linux setup, build, verification, troubleshooting
- Porting Guide: step-by-step backend implementation
- Performance: measurement methodology, planned metrics
- FAQ: 12 common questions
- Upstreaming: strategy, checklist, patch series plan
- Thesis: chapter mapping to repository artifacts
Language Ecosystem
- KDAL DSL with
.kdhdevice headers and.kdcdriver files - Compiler pipeline: lexer → parser → AST → semantic analysis → C codegen
- 7 standard library
.kdhfiles (UART, I2C, SPI, GPIO, GPU, NPU, generic) - 8 CMake modules for IDE integration and cross-compilation
kdality compilesubcommand linking libkdalc.a- Standalone
kdalccompiler binary - Language specification (
lang/spec.md) and design rationale (lang/DESIGN.md) - VS Code grammar stubs for
.kdhand.kdcsyntax highlighting
Examples
- Minimal third-party driver (out-of-tree kernel module template)
- GPU accelerator demo (userspace)
- NPU accelerator demo (userspace)
- KDAL DSL driver examples (
examples/kdc_hello/uart_hello.kdc,examples/kdc_hello/i2c_sensor.kdc)
Fixed
Compiler - Critical Parser Bug
- Fixed buffer overflow in
kdal_ast_new()- LET_STMT and FOR_STMT now allocatesizeof(kdal_expr_node_t)(72 bytes) instead ofsizeof(kdal_ast_t)(32 bytes) - Refactored arena allocator from single-buffer
reallocto block-based linked list (pointers remain stable across allocations) - Removed incorrect trailing semicolon requirement after backend
{ }block - Added dotted identifier consumption for
driver X for DEV.Namesyntax
Static Analysis (cppcheck)
- Fixed
constParameterwarnings in 6 kdality subcommand files (argv[]→*const argv[]) - Fixed
constVariablePointerwarnings forstrchr()return values in dtgen.c, lint.c, simulate.c - Fixed
scanfformat specifier (%li→%lu) forunsigned longin simulate.c - Fixed
variableScopewarnings by moving declarations into narrower scopes - Fixed
constParameterPointerin benchmark.c time_diff_ms function
Build System
- Created
compiler/CMakeLists.txt- buildskdalc_libstatic library andkdalcbinary - Fixed top-level
CMakeLists.txt- added all 8 kdality source files, linked kdalc_lib, removed brokeninclude(KDALConfig) - Fixed kdality CMake target include paths for both
include/andcompiler/include/
E2E Test Fixes
- Fixed
test_user_journey.sh- corrected kdality binary path to$BUILD_DIR/kdality - Fixed
test_user_journey.sh- replacedmake uninstallwithinstall_manifest.txt-based uninstall - Fixed CMake module count assertion (1 → 7)
- Added shellcheck directive suppressions across 8 E2E scripts
- Added trailing newlines to 8 C source files
Stale References
- Renamed all
kdaltoolreferences tokdalityacross CI workflows, docs, and source - Fixed stale
scripts/qemu/run.shpath toscripts/setupqemu/run.sh - Replaced placeholder
blink.kdc/sensor.kdcexample paths with actualuart_hello.kdc/i2c_sensor.kdc - Updated
your-org/kdalandexample/kdalplaceholder URLs to actual GitHub repository
Notes
- Tested on: macOS aarch64 (host build + toolchain), QEMU aarch64 virt machine (kernel module)
- No real hardware validation - SoC glue layer is
CONFIG_OF-guarded and a no-op on QEMU - QEMU/Docker VS Code integration deferred to v0.2.0