The KDOS Book
A complete description of KDOS: what it is, how to install and run it, how it works from firmware
handoff to the Plasma desktop, how it is built from source, and how to extend it. This page is the
book’s front matter: a preface, reading paths for four kinds of reader, and the full table of
contents. Every chapter it lists describes the system as it is in this source tree.
Preface
KDOS is a Linux distribution for 64-bit PCs (x86_64). Its programs are compiled in this
repository from upstream source (firmware and a few bootstrap binaries are taken prebuilt), and three choices set it apart from most distributions: the C
library is musl rather than glibc, the init system is sysvinit rather than systemd, and there is
no Xorg server.
The desktop is KDE Plasma 6.8 with KDE Gear, the KDE application suite (all but five of its
modules, which cannot run here). KDE’s code is built as upstream releases it, not forked. What
makes it KDOS is added beside it: KDOS’s own settings pages, desktop widgets, KWin effects, a
Discover backend, a visual look and an update system, plus a small set of patches, each explained
in the note that sits beside its port. The graphical applications people expect are either ported
natively, each with the toolkit it is written in (Qt, KDE Frameworks, GTK, wxWidgets, FLTK or Tk),
or run beside them in containers that KDOS calls boxes.
A release has two parts:
- a live ISO carrying the base system: Plasma, the core KDE applications, Firefox ESR, networking,
printing, the box stack and the KDOS tools, but no compiler;
- a signed package store, the binhost, holding every other
one of KDOS’s about 2,400 native ports, prebuilt.
An installed machine can add any port from Discover or with kdos update install, can build any
port itself from its recipe, and can take what KDOS does not port from a catalogue of boxed Debian
applications.
The book is written for anyone deciding whether to try KDOS, installing it, looking after a
machine that runs it, or building and changing it. It assumes a working knowledge of Linux (a
shell, files and permissions, what a kernel, a boot loader and a package manager are) and nothing
about KDOS itself. The chapters for developers also assume that you can read C and shell, and that
you have compiled a program from source before.
This is the first of KDOS’s two books. It explains what each mechanism is and why it was chosen.
The second, KDOS from Scratch, gives the commands: the build phase by phase,
a page for every package, and the tasks of running a machine. Where the two meet, the second links
here rather than repeating it.
The book moves from a bird’s-eye view to depth. Part I says what KDOS is, how it differs from other
distributions and why it chose differently. Part II uses the system as a person sitting at it
would. Part III opens the running system and explains each mechanism, starting with a map of the
whole. Part IV documents, one chapter each, the programs KDOS writes itself. Part V turns to the
build: it tells the story of a build from git clone to a bootable image once, then documents each
part of the build machinery, the recipe format, the libraries and the test harnesses. Part VI is
reference: lookup tables, statements of state and the glossary.
Each chapter opens with a paragraph that says what it covers, who it is for and what to read
first, and closes with a See also list. Within a chapter the order runs from concept to
mechanism to detail, so a reader can stop at the depth they need. The conventions the book follows
are listed under Conventions below.
How to read this book
Four paths through the book, depending on why you are here. Each names its chapters in the order
that suits that job; the numbers are the chapter numbers in the Contents.
Understanding the whole system
For a newcomer who wants to go from what KDOS is to how every part of it works, read the book
front to back. The shortest route that still covers the whole system is:
- Ch 1, Why KDOS, and ch 2, How KDOS differs
- Ch 3, Principles, and ch 4, Decisions
- Ch 7, The desktop, and ch 8, Applications
- Ch 12, Architecture overview, then chapters 13 to 19 in order
- Ch 20, The programs, and any program chapter that interests you
- Ch 30, How KDOS is built
- Ch 44, Status, and ch 43, Known gaps
Installing and using KDOS
For someone who wants an image on hardware and a working desktop:
- Ch 1, Why KDOS: what the system is and what it deliberately lacks
- Ch 5, Getting started: download the ISO, write a medium, boot it
- Ch 6, Installation: the installer, page by page
- Ch 7, The desktop: the desks, the panel, KRunner, windows and
keyboard shortcuts
- Ch 8, Applications: the three ways to get software: prebuilt,
built on the machine, and boxed
- Ch 9, Theming, and ch 11, Accessibility
- Ch 43, Known gaps: what does not exist, before you depend on it
Administering a KDOS machine
For the person who looks after an installed machine: services, hardware, updates and diagnosis.
- Ch 10, Administration: the tasks, each as a command or a file
- Ch 28, The kdos command: status, doctor and the other subcommands
- Ch 13, Boot and init: which program owns each step of a boot
- Ch 15, Packaging: what
kpkg does, the binary host and updates
- Ch 16, Packs and boxes: what installing an application does
- Ch 17, The security model: what is protected, and what is not
- Ch 26, The daemons: the root daemons and what each allows
- Ch 40, Configuration, and ch 41, Filesystem and IPC
Building and extending KDOS
For a developer who builds the distribution, adds or changes a port, or writes desktop software:
- Ch 3, Principles: the rules every change is judged against
- Ch 12, Architecture overview: how the pieces fit together
- Ch 30, How KDOS is built: the build as one story
- Ch 31, Developing: the first build, and the loops that avoid one
- Ch 32, The build system: phases, the chroot, snapshots, build plans
- Ch 33, Writing ports, and ch 34, Build troubleshooting
- Ch 36, Writing desktop software, and ch 18, The design language
- Ch 35, The C libraries: the
libk* libraries the daemons and tools share
- Ch 37, Testing: what each harness proves, and what it cannot
- Ch 42, Repository layout, and ch 38, The ports catalogue
Contents
Forty-five chapters in six parts.
Part I — Introduction
What KDOS is and who it is for, how it compares with the ways other distributions solve the same
problems, the rules every part of it is built to, and the close choices argued in full. These
chapters stay at the level of ideas and link to the chapters that describe each mechanism.
- Why KDOS: what KDOS is, the four properties that define it, who
should run it, the trade you accept, what is deliberately absent, and what is not built from
source
- How KDOS differs: KDOS compared point by point with other
distributions: the C library, the userland, init, the display stack, packages, reproducibility,
applications, updates and hardware support
- Principles: the rules that constrain every change, each with the
failure it prevents and the price it charges
- Decisions: the choices where an alternative was reasonable
(Plasma as the desktop, elogind, SDDM, slot-image updates, a base image with every port
prebuilt beside it, packs, musl, the source archive,
-march and more), and why the alternative lost
Part II — Using KDOS
Getting a machine running and living on it: downloading and booting the ISO, installing it, the
desktop, applications, the look of the system, administration and accessibility. These chapters
are written for the person at the keyboard and name the file behind each behaviour.
- Getting started: from a download to a running desktop:
checking the ISO, trying it in a virtual machine, writing a medium, booting, the live session,
installing, and building an image from source
- Installation: the installer page by page, the root filesystem,
encryption, A/B root slots, unattended installs and every file the installer writes
- The desktop: the Plasma desktop as KDOS ships it: the desks, the
panel, the Start menu, KRunner, windows and workspaces, keyboard shortcuts, notifications, files,
the clipboard, locking, displays, removable media and the privacy lamps
- Applications: installing native ports prebuilt or built on the
machine, one at a time or as a group, then finding, installing, launching, updating and
removing boxed applications, carrying a set to another machine, and managing boxes
- Theming: the eight accents and what switching one changes,
Konsole, the boot menu and consoles, Phosphor mode, wallpaper, sounds, fonts, and theming native
applications and applications inside a box
- Administration: services, users, storage, networking, the
firewall, hardware, updates and diagnosis, then each user’s backups, mail, passwords and input
methods
- Accessibility: the screen reader, braille and speech at a
text console, the magnifier, larger text, keyboard aids, the on-screen keyboard, colour and
motion, and boxed applications
Part III — Architecture
How the running system is put together, from a map of the whole to each mechanism in turn: the
boot path, the session, host packaging, packs and boxes, security, the visual specification and
the window model. The overview comes first because every later chapter in the part expands one
region of it.
- Architecture overview: the three rings, power-on to a drawn
window, the host and a box, a running process map, the root daemons, the two packaging systems
and where state lives
- Boot and init: Limine, microcode, the initramfs and its
splash, A/B slot selection, unlocking an encrypted root,
rcS, the display manager and the
console
- The session: what a login starts: the Plasma session, the
user’s services and the session bus, audio, portals, capture, the clipboard, input methods and
a box’s environment
- Packaging: the ports tree, its shelves and its phases, where
sources come from,
kpkg, what a build verifies, reproducible packages, the binary host,
deltas and vulnerability tracking
- Packs and boxes: the two lanes, the catalogue, the pack
format, installing and mounting, composition, the box, grafts and data packs
- The security model: setuid binaries, system accounts,
root daemons, the firewall, polkit, containers, signing, untrusted bytes, and what is not
protected
- The design language: KDOS’s identity on Plasma: colour,
type, the pieces of the look, one look from power-on to the lock screen, motion, Phosphor mode,
the desks, and the text tools’ glyph tiers
- The window model: KWin as KDOS sets it: focus, placement,
window memory, snapping and tiles, auto-tiling, workspaces, the window rules KDOS writes and
more than one screen
Part IV — Programs
What KDOS adds to the KDE programs it extends most, and a chapter for each program KDOS writes
itself, from the box tools and the root daemons to the installer and the command-line front door.
Software built from upstream ports is documented by its upstream; these chapters cover only what
this repository writes or changes.
- The programs: every KDOS program and desktop component, what it does,
and every name it answers to
- KWin: the compositor as KDOS ships it: its defaults, the carried patches,
shortcuts, the key card, window memory, tiling, boxes at the compositor, Phosphor mode, idle and
lock, and debugging
- The Plasma shell: the three desks, the Start menu, the tray and
its privacy lamps, the KDOS runner in KRunner, notices, the kded module, the welcome tour, System
Monitor’s KDOS sensors and the offline library
- KDOS settings pages: the Boxes, Firewall, Health, KDOS Look,
System Versions and Backups pages, and the daemon behind KDE’s date, time and language pages
- Discover: the KDOS backend for ports, packs and boxes, what keeps
Discover offline, system updates through
kdos-sysupdated, the update notifier and firmware
- kdos-appbox:
kdos-appbox, kdos-box and xdg-open: the launch
path, launcher generation, the open path, box profiles, warmup and storage drivers
- The daemons: the six root daemons,
kdos-mdnsd, the per-box Wayland
socket, the other services ksvc runs, and how to add a root daemon
- kinstall: the installer’s reference: keys, pages, install steps,
answer files, dry-run dumps, LVM, encryption, the applications step and its design
- The kdos command: the front door to a KDOS machine, every
subcommand, and the eleven other names the same binary answers to
- kdos-bb: the forked AAlib demo: running it, and what it establishes
about frame pacing, synchronized output, timing to music and audio
Part V — Building and developing
How KDOS comes into existence and how to change it. The part opens with the whole build told as
one story, then documents the everyday commands, the build orchestrator, the recipe format, the
failures that recur, the C libraries, desktop software and the test harnesses.
- How KDOS is built: the build as one continuous story, from
git clone through fetching, the cross toolchain, the phases and the chroot, to a bootable ISO
- Developing: what a development machine needs, the first build,
every make target, rebuilding one thing, working without a build, and cutting a release
- The build system: the thirteen phases and their package
lists, where
kpkg looks for a port, the phase environment, the chroot, syncing fs/, the
orphan sweep, the packaging steps, snapshots, build plans and kdosbuild
- Writing ports: the recipe format, canonical build shapes, a
worked example, adding a port end to end, vendoring, checking for new versions and publishing
sources
- Build troubleshooting: recurring fetch, build and push
failures, indexed by the message you see, each with its cause and fix
- The C libraries: the nine
libk* libraries, the
dependency direction, and the invariants each one keeps
- Writing desktop software: KDOS’s Plasma code:
settings modules, widgets, the runner, KWin effects and scripts, names, the toolkit rule,
conventions, and the Qt test suite
- Testing: preflight, the self-test, the Qt suite, fixtures, the QEMU
rig and its Plasma harnesses, AT-SPI goldens, checking the sources, the book checks, measuring
frame rate, and what is not tested
Part VI — Reference
Lookup tables and statements of state: every port, command, configuration key, path and socket,
the layout of the source tree, what does not exist, how mature each part is, and the vocabulary of
the book.
- The ports catalogue: every port KDOS can build, by shelf
and by
src/ area, with the phase that builds it, the libraries shipped as the
application-developer platform, and the ports named in more than one list
- Command index: every command the tree installs, where it lives
and which chapter documents it
- Configuration: every configuration file and key, with its
default and when a change takes effect
- Filesystem and IPC: KDOS-owned paths, every socket and
its verbs, the D-Bus names KDOS serves, files used as an interface, and environment variables
- Repository layout: the source tree directory by
directory: the port repositories, the shelves of
ports/core and the areas of src/, the
script/ directory, the library rule, where upstream sources are, and what git ignores
- Known gaps: what KDOS does not do, or has not been shown to do,
and what to do instead
- Status: the maturity of each subsystem and the evidence behind each
verdict
- Glossary: the vocabulary the book uses, defined once, and the words
it avoids
Conventions
Links between chapters are relative, so the book reads the same in a clone, in a pager and on a
web forge. Every chapter opens with a paragraph saying what it covers, who it is for and what to
read first, and closes with a See also list. Terms carry the meaning the
glossary gives them; a chapter defines a term at first use or links
the glossary entry.
Commands are shown in fenced code blocks, and paths, keys, flags and program names in code.
Tables hold lookup data; prose holds explanation. Where a chapter states a count or a measurement,
it says what was counted or measured, and the number is measured from this source tree. The book
describes the system as it is: it records no history, and a behaviour that changes changes its
page in the same commit.
This book states the KDOS version in two places: the repository README, which
names the release line, and Status, which says what that
line delivers and what it does not promise. A running system reports its version in
/etc/os-release, installed from fs/etc/os-release in the source tree. Any other
version number in the book belongs to an upstream component, except a release tag shown as an
example in a command.
See also
- Repository README: the front door, and the shortest path to a running system;
the same page as kdos.dev’s homepage
- KDOS from Scratch: the companion book: the build phase by phase, a page for
every package, and the tasks of running a machine
- Why KDOS: the first chapter, for a reader starting at the beginning
- Glossary: every term the book uses, defined once