The ClaraOS logo: a sun

A small operating system for x86_64 and AArch64, written to be read from the first instruction up.

Those two lines at the top are what the kernel prints when it takes over from the firmware. ClaraOS is a Lisp machine in the making: a C kernel small enough for one person to hold in their head, under a world written in Common Lisp. The plan is to boot into a window manager whose applications are Lisp programs. It is not a Unix, and it does not try to run Linux software.

The substrate is the C kernel. It brings up the processor, hands out memory, runs threads, takes interrupts, and holds the Lisp runtime itself: the reader, the evaluator and the garbage collector.

The world is Lisp: the console and the REPL, the logic of the drivers, the filesystem, the window manager and every application.

One address space, one heap, no user mode. Lisp code cannot forge a pointer, so protection comes from the language and not from page tables. An application that fails is a condition for the window manager to handle.

The Lisp is a subset of Common Lisp, chosen so that every file also loads under SBCL on an ordinary computer, where it is written and tested.

The image is the system. Booting will mean loading a saved heap from disk and carrying on where it stopped, with the window manager running.

Version 0.0.11. 10 of 16 milestones are finished, the latest being M7, Lisp in the driver's seat. A milestone counts as finished when the machine boots and passes its own checks on both architectures.

Substrate

  1. M0boot0.0.1
  2. M1console0.0.2
  3. M2physical memory0.0.3
  4. M3virtual memory0.0.4
  5. M4exceptions and interrupts0.0.6
  6. M5threads0.0.7

The Lisp runtime, in the substrate

  1. M6aobjects and reader0.0.8
  2. M6bevaluator0.0.9
  3. M6ccollector and conditions0.0.10
  4. M7Lisp in the driver's seat0.0.11

Devices and storage

  1. M8PCIe and virtio
  2. M9disk and files
  3. M10images

The world

  1. M11drawing
  2. M12the window manager
  3. M13applications

The roadmap says what each milestone holds and what was left open along the way.

The ClaraOS console at the end of a boot: the self-tests of the threads and of the Lisp runtime passing, then a session typed on the serial port, in which the kernel evaluates Lisp forms: an error is handled by the form around it, a cleanup runs on the way out of another, a loop without end is interrupted from the keyboard, and the prompt comes back each time, until the kernel halts with nothing more to do.
The screen after version 0.0.10 boots on AArch64 under QEMU and the boot test has typed its session.

On macOS with Homebrew. clang builds both architectures and QEMU boots them, with the same firmware UTM uses.

brew install llvm lld qemu
git clone https://github.com/the-clara-os/clara-os
cd clara-os
make test          # boot both architectures without a window
make run-aarch64   # a QEMU window, the serial port on your terminal: type a form

The README has the steps for running it in UTM.