lkuser is an overlay repository on top of:
- LK (
lk/submodule) for kernel and base build system - external libc (
newlib/submodule, currently)
The repository adds user-space integration and extension code, especially lib/lkuser, while reusing LK's modular build flow.
- Extends LK with extra functionality in
lib/lkuser - Builds both kernel-side and user-space artifacts
- Coordinates cross-repo build steps through top-level make targets
The top-level makefile orchestrates sub-makes and generated output trees.
Architecture is controlled by ARCH (default: riscv in the top-level makefile).
Agent guidance: do not assume host architecture; always check/propagate ARCH when invoking build or test targets.
Typical flow:
- build libc/toolchain pieces (
newlib/and related output dirs) - build LK kernel/app modules (via
lk/and LK make system) - produce combined artifacts in
build-*directories
Primary entrypoint is the top-level makefile in this repository.
lk/: LK kernel source and build system (git submodule)newlib/: libc source (git submodule)lib/lkuser/: overlay library added by this repoapps/,sys/: user-space and integration codebuild-*directories: generated outputs (do not treat as source)
- Prefer editing overlay code in this repo first (
lib/lkuser,apps,sys). - Treat
lk/andnewlib/as upstream submodules unless intentional submodule changes are required. - Avoid committing generated files from
build-*,install-*, or tool output unless explicitly needed. - Preserve compatibility with LK module conventions (
rules.mk,MODULE_DEPS, etc.) when adding new code.
Run from repository root:
make
make clean
make spotless
make testUse specific top-level targets as defined in makefile for libc/toolchain/kernel variants.
make spotless: removes all local build outputs, including the newlib build/install trees.make test: builds LK + user-space artifacts, generates a FAT filesystem image, and starts QEMU.
For make test, QEMU launch is architecture-specific in the top-level makefile:
ARCH=arm->qemu-system-armARCH=riscv->qemu-system-riscv64
If adding a new architecture, update top-level test handling and any architecture-specific toolchain/newlib settings under arch/<arch>/.