Installation
Quick Install (Recommended)
Section titled “Quick Install (Recommended)”Install the KDAL SDK with one command:
curl -fsSL https://raw.githubusercontent.com/NguyenTrongPhuc552003/kdal/main/scripts/installer/install.sh | shThis installs kdalup, the KDAL version manager, in ~/.kdal/bin/ and
runs kdalup install, which downloads the latest release. The default
profile, minimal, installs kdalc, kdality and the standard library:
enough for driver development. kdalup install --profile full adds the
kernel headers, the CMake package and the Vim syntax files.
After install, restart your shell or run:
export PATH="$HOME/.kdal/bin:$PATH"Managing the SDK
Section titled “Managing the SDK”kdalup version # Show installed versionkdalup list # List all componentskdalup update # Update to latest releasekdalup self-update # Update kdalup itselfkdalup install v0.2.0 # Install a specific versionkdalup uninstall # Remove everythingCustom install location
Section titled “Custom install location”KDAL_HOME=/opt/kdal curl -fsSL .../install.sh | shRelease packages
Section titled “Release packages”Or install the packages from the v0.2.0 release (there is no Homebrew tap and no distribution repository yet):
# 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.rpmThe 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.
Build from Source
Section titled “Build from Source”Prerequisites
Section titled “Prerequisites”- macOS (M1/M2/M3/M4) or Linux (x86_64 or aarch64)
- QEMU with aarch64 system emulation
- Cross-compiler for aarch64 (if host is not aarch64)
- Linux 6.6 LTS kernel source for the module build (
scripts/env/kernel.shfetches 6.6.80; KDAL’s CI builds the module against Linux 6.18)
Platform Dependencies
Section titled “Platform Dependencies”brew install qemu aarch64-elf-gcc dtc cppchecksudo apt install build-essential bc flex bison libelf-dev libssl-dev \ gcc-aarch64-linux-gnu qemu-system-arm device-tree-compiler \ cppcheck sparseBuild Steps
Section titled “Build Steps”- Install host dependencies:
./scripts/env/dependencies.sh- Prepare QEMU environment:
./scripts/env/prepare.sh- Build guest kernel with KUnit and module support:
./scripts/env/kernel.sh- Build compiler, CLI, docs, and editor artifacts:
./scripts/dev/build.sh --variant release all- Build the kernel module against your prepared kernel tree:
KDAL_KERNEL_DIR=$HOME/kdal-qemu/kernel/linux-6.6.80 \./scripts/dev/build.sh --variant debug module- Run smoke tests and local validation:
./scripts/ci/test.sh./scripts/dev/test.sh --variant release all- Launch QEMU and load module:
cp kdal.ko $HOME/kdal-qemu/shared/modules/./scripts/env/run.shInside the QEMU guest:
mount -t 9p -o trans=virtio kdal-share /mntinsmod /mnt/modules/kdal.koBuild Commands Reference
Section titled “Build Commands Reference”| Command | Description |
|---|---|
./scripts/dev/build.sh --variant release all |
Build compiler + CLI + website + VS Code extension |
./scripts/dev/build.sh --variant debug module |
Build kernel module (requires KDAL_KERNEL_DIR) |
./scripts/dev/build.sh --variant debug kdalc |
Build kdalc compiler with symbols |
./scripts/dev/build.sh --variant release kdality |
Build kdality CLI |
./scripts/dev/test.sh --variant release all |
Run local validation suite |
./scripts/ci/test.sh |
Run the CI smoke-test contract locally |
./scripts/dev/build.sh --variant asan clean |
Remove ASan build artifacts |
For normal local development, prefer --variant release|debug|asan. Reserve --preset for automation-only trees such as ci-release, nightly, and release-matrix.
Verifying the Installation
Section titled “Verifying the Installation”# Check the compilerkdalc --version
# Check the CLI toolkdality version
# List installed componentskdalup listOnce QEMU is running with the module loaded:
lsmod | grep kdalls -la /dev/kdalcat /sys/kernel/debug/kdal/versioncat /sys/kernel/debug/kdal/devicesTroubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
/dev/kdal not found |
Check `dmesg \ |
| Module won’t load | Verify kernel version matches build headers |
ENODEV on device ops |
Ensure backend initialized before drivers |
| Permission denied | Use sudo or set udev rules for /dev/kdal |