The bundle (unkernel.wasm) carries a small busybox initramfs that mounts a
distro image labelled kwroot under an overlay root, or starts the base shell
without one. guest/ replaces kernel/guest/: base/, distro/NAME/, shared lib/
and tools/. Images are laid out for their boot by a patched mkfs.erofs and a
recorded boot file list, with a prefetch hint in the image header. Debian
bakes its apt lists and cache, a set of everyday packages and a
command-not-found installer.
Ubuntu 25.10 and later were out of reach on riscv64 (RVA23 with V); the
arm64 baseline is ARMv8.0, so the newest release runs. Pin
ubuntu-base-26.10-base-arm64.tar.gz from its versioned release directory
for kernel/build.sh ubuntu and the page's Ubuntu demo, which was still
fetching the riscv64 24.04.5 tarball. The demo re-extracts a tree whose
bash is not an aarch64 program, and skips the page's download only for
an aarch64 tree.
Checked 2026-11-18: the disk boots to kw-init's shell (glibc 2.44, apt
3.3.3), apt-get update and installs work, systemd 261 boots to running
with no failed units, and the demo's chroot runs apt from the pushed and
from a self-fetched tarball.
User space is now unmodified aarch64 Linux ELF. kwemu gets an A64
interpreter (src/a64): integer, scalar and vector floating point,
AdvSIMD, exclusives and load-acquire/store-release, the EL0 system
registers, AES, PMULL, SHA1, SHA256 and CRC32. The kernel runs arm64
user space (signal frames, HWCAP, ptrace regsets, the arm64 syscall ABI),
and the guest image, the bundle, kwtest and the page's texts are built
for aarch64.
kernel/build.sh smp builds the SMP kernel (kw_defconfig + kw_smp.config,
kwemu with atomics) from the same tree into vendor/build/kernel-smp; all
builds both kernels, and every bundle refresh adds the UP-to-SMP patch
when the SMP kernel is the same build of the tree (KW_SMP=1 requires it,
KW_SMP=0 leaves it out). kernel stays the UP-only quick loop. The patch is
cached in kernel-smp/up.kwpatch. Fixed build stamps (user, host, a build
id hashed from the tree and kwemu sources, the tree's newest commit date)
make kernels and patch reproducible while every other build keeps its own
banner for snapshot matching. Configs are checked against their fragments
after a reconfigure. KW_BUILD, KOUT_SMP, KWEMU_SMP and LINUX_REPO make the
script runnable against another tree and output root.
bundle.mjs --smp refuses two kernels that are not the UP and SMP builds
of one tree (banner, KW_ABI_VERSION, wasm_cpu_start, memory type), with
--smp-optional to warn instead and --smp-patch to reuse a cached patch.
The release workflow builds both kernels, runs kwtest on 2 CPUs and the
kernel patch tests (unexercised).
kernel/tools/bundle.mjs --smp adds unkernel.kernel.smp.kwpatch: a
bsdiff-style patch (kwdiff.mjs) from the bundle's kernel to the SMP
build, after renumbering the base's function, global and type indices
and moving its data addresses to the target's (kwremap.mjs,
js/core/kremap.ts). With more than one CPU asked, loadKernelModule()
and the CLI derive the SMP kernel from it (js/core/kpatch.ts, hashes
checked); one CPU or a bundle without the section behaves as before.
test/kpatch.test.ts round-trips synthetic data and, given KPATCH_UP and
KPATCH_SMP, the real kernels.