The VikiD Truth

Knowledge base / Computing / Operating systems & hardware

computingFreedom | Build | Picolisp | Picolisp Machine | Pil Sources | Linux | BASH | C-Programmming | Operating Systems | Javascipt | Emacs | vim | Pharo Smalltalk | Computer Security | Python | The Compiler | Identifiers | Literals | storage_linkage |

Operating Systems

Here is a truth that took me far too long to see: an operating system is not the desktop, the icons or the start menu. It is a referee. It sits between hungry programs and one set of hardware and makes sure everyone gets a fair turn without trampling each other.

Everything else (the shell, the window manager, the app store) is furniture placed on top of that referee.

What it is, in plain words

An operating system (OS) is the layer of software that owns the machine. It has two jobs:

  1. Abstraction. It turns ugly hardware into tidy ideas. A spinning disk or an NVMe chip becomes files. A CPU becomes many processes, each thinking it has the machine to itself. A network card becomes sockets. Physical RAM becomes virtual memory.
  2. Arbitration. It decides who gets what, and when. Which process runs next on which core, who may read which file, how much memory each one may take, which packet goes to which program.

The part that does this with full hardware privilege is the kernel. On my Vikix box that is the Linux kernel (Void tracks recent stable releases, so in 2026 that means a 6.x kernel). Around it sits the userland: the C library (glibc or musl on Void), the init system (runit on Void, systemd on most other distros), core tools, and then whatever you run, like StumpWM, Emacs or pil.

flowchart TB
  A[Your programs: pil, emacs, firefox] --> B[System calls]
  B --> C[Kernel: scheduler, memory, filesystems, drivers, network]
  C --> D[Hardware: CPU cores, RAM, NVMe, NIC, GPU]

Programs never touch hardware directly. They ask the kernel through system calls (read, write, open, mmap, clone, execve and a few hundred more). The CPU itself enforces this: user code runs in an unprivileged mode, and only the kernel runs in the privileged one.

Why it matters

If you understand the OS, a lot of “magic” goes away:

It is also the place where freedom lives or dies. Whoever controls the OS controls what your machine will and will not do for you. That is why I care about computing freedom and run a system I can read top to bottom.

An everyday analogy: a busy restaurant

The hardware is the kitchen: a few stoves (CPU cores), counter space (RAM), a pantry (disk). The programs are customers with orders. The OS is the head waiter and the kitchen manager at once.

A hands-on example: watch the referee work

You can see every one of those jobs from a shell on Linux.

# Which kernel am I running?
uname -sr

# Processes: the "customers"
ps -eo pid,ppid,ni,stat,comm --sort=-pcpu | head

# Memory as the kernel sees it
free -h
cat /proc/meminfo | head -5

# Ask the kernel what a single process has mapped
pmap $$ | tail -3

# Watch the system calls a program makes
strace -c ls > /dev/null

That last one is the eye-opener. Even ls makes dozens of system calls: openat, getdents64, fstat, write. Every program you have ever used is a conversation with the kernel.

PicoLisp lets you poke the same layer from a REPL:

: (in '("uname" "-r") (line T))   # run a program, read its output
-> "6.12.10_1"
: (in "/proc/loadavg" (till " " T))   # read a kernel file directly
-> "0.42"

On Void you can check the init side too: sv status /var/service/* lists the runit services the system is supervising. See Simple Linux Configuration, Linux Processes and Memory and Linux Introspection for more of this.

Common misconceptions

Connections

The topics below are the classic chapters of any operating systems course, the same order as Tanenbaum’s Modern Operating Systems. I will fill them in over time.

Modern Operating Systems | The Minix Book | Virtualization

Last edited · 8 revisions

Tags: #Computing