Zainium Dynamics
Docs / How it works

Architecture

How Zainium OS is put together — the layers, how the system view is built at boot, and how libraries are found.

The layers

LayerPathContentsChanged by
Base/overlayer/syshubThe complete OS: musl, toolchain, systemd, desktop, driversBase upgrades only, applied at boot
Userland/overlayer/zexlib/unionSoftware installed with zexzex install, remove, update
Boot/overlayer/zaisysKernel, initramfs, boot loader (read-only)Base upgrades, the installer
Agents/overlayer/agentsInstructions and skills for AI coding agentsAdmin

The base never receives a file from the userland. If the userland is deleted, the base still boots on its own.

How the system view is built at boot

  1. Limine (UEFI or BIOS) loads the kernel linux-zainium and quantra-ramfs.img.
  2. quantra-ramfs starts the Plymouth splash, waits for devices and mounts the root: the root partition on an installed system, or the read-only EROFS image zaisys/zairoot.img on the live ISO.
  3. If a base upgrade is staged in /overlayer/.syshub-pending, it is applied to /overlayer/syshub now, before anything uses it, with a journal: a failed upgrade is undone, or the boot stops. A requested rollback undoes the last applied upgrade instead. Then every system file is checked to be sealed with fs-verity.
  4. The system view is mounted with OverlayFS at /overlayer/syshub, read-only and sealed: the base as the lower layer, zexlib/union as the upper layer. Root cannot write to it or remount it writable, and a package zex installs into zexlib/union appears in /overlayer/syshub/bin at once. Its etc and var are writable layers of their own, kept in zexlib/union/etc and zexlib/union/var.
  5. zaisys gets its own read-only mount that root cannot remount writable; zexlib and agents are mounted at their own paths; /home and /root come from the disk. There is no /var at the root.
  6. The root is switched and systemd starts. It runs greetd with cosmic-greeter, which starts the COSMIC desktop.

Live ISO and installed system

Live ISOInstalled
Rootzaisys/zairoot.img, read-only EROFSdisk partition
Installed softwarein memory, lost at rebooton disk
/home, /rootin memory over the imageon disk
Base upgradesnot availablestaged, applied at the next boot

Programs and libraries

The base is built against musl with the x86_64-zainium-linux-musl toolchain. Every program records the musl loader /overlayer/syshub/x86_64-zainium-linux-musl/lib/ld-musl-x86_64.so.1 in its ELF header. The loader searches /overlayer/syshub/lib, the musl directory and /overlayer/zexlib/union/lib, in that order.

glibc is an optional package in its own directory; see musl and glibc. Software written for other distributions keeps working through path resolution.

How the OS is built

Zainium OS is built from scratch. Every package is built from source from a recipe (ZEXBUILD and manifest.toml): the base in syshub-recipes, community packages in userland-recipes. CI builds each recipe in a container against the Zainium musl toolchain, checks that every program uses the Zainium loader, signs the package and publishes it to archive.zainiumdynamics.tech. The ISO packs the root into a zstd-compressed EROFS image and boots with Limine on UEFI and BIOS.

All documentation