Collapse OS

Bootstrap post-collapse technology

Winter is coming and Collapse OS aims to soften the blow. It is a Forth (why Forth?) operating system and a collection of tools and documentation with a single purpose: preserve the ability to program microcontrollers through civilizational collapse. It is designed to:

  1. Run on minimal and improvised machines.
  2. Interface through improvised means (serial, keyboard, display).
  3. Edit text and binary contents.
  4. Compile assembler source for a wide range of MCUs and CPUs.
  5. Read and write from a wide range of storage devices.
  6. Assemble itself and deploy to another machine.

Additionally, the goal of this project is to be as self-contained as possible. With a copy of this project, a capable and creative person should be able to manage to build and install Collapse OS without external resources (i.e. internet) on a machine of her design, built from scavenged parts with low-tech tools.

Features

Lives in Dusk OS

As of July 2023, the Collapse OS project lives in Dusk OS, an operating system designed to be maximally useful during what I call the first stage of collapse (Collapse OS is for the second stage).

It's still the same self-contained, self-hosting OS that it was before, it's just that instead of seeding its bootstrapping process from POSIX, it does so from Dusk OS (which itself bootstraps from POSIX).

Going through Dusk OS dispenses us from having to maintain a POSIX VM for Collapse OS because Dusk invokes Collapse OS' cross-compiling process through a thin compatibility layer (both are Forths with many semantics similarities).

Also, the "old" Collapse OS, due to how it cross-compiles itself, had to maintain a binary blob to kickstart the POSIX VM and that binary blob was sometimes quite a hassle to update properly (chicken and egg type of problems). This blob also irked bootstrapping purists. It doesn't exist anymore. Dusk doesn't have such a blob either, making Collapse OS bootstrapping process entirely blob-less.

You don't have to familiarize yourself with Dusk OS to build one of the Collapse OS ports (below). Each port's build process wraps the Dusk OS part in its Makefile and yields a Collapse OS image that has no relation to Dusk.

Ports

The code living in Dusk OS is an abstract core that doesn't really run on anything except emulators. Collapse OS is deployed to actual machines through ports, separate repositories that contain build procedures and hardware driver allowing Collapse OS to run on specific machines. This is the list of known ports, organized by CPU:

Getting started

The best place to start is with the RC2014 port of Collapse OS. It's the "canonical" machine-specific port of the project so it's the best maintained. The port has a built-in emulator so trying Collapse OS is one "make emul" away.

One thing that the RC2014 port doesn't have, however, is a Grid subsystem, so you can't use it to try applications like the Visual Editor. To do so, you can use the PC/AT port of Collapse OS. Emulation of that port is done with QEMU.

If you're looking for the old Collapse OS distribution, from when it wasn't living inside Dusk OS yet, you can download it here.

Documentation is in text files in Dusk's fs/doc/cos directory. Begin with intro.txt. Alternatively, James Stanley hosts an online Collapse OS documentation browser. However, at the time of this writing, this documentation was still generated from the "old" Collapse OS, so it's outdated.

Another interesting alternative for documentation is Michael Schierl's PDF export of it (code that generates it). It's a great way to print the whole thing at once. However, at the time of this writing, this documentation was still generated from the "old" Collapse OS, so it's outdated.

You can also try Collapse OS directly on your browser with Michael Schierl's JS Collapse OS emulator which is awesome but it isn't always up to date. The "Javascript Forth" version is especially awesome: it's not a z80 emulator, but a javascript port of Collapse OS!

Funding

You are inspired by Collapse OS and would like to fund its development? I don't do any kind of crowdfunding, but if you happen to be a rich philanthropist, maybe we can do something.

Discussion

My name is Virgil Dupras and I can be reached at hsoft@hardcoded.net.

Discussion about Collapse OS takes place on a private mailing list.

Related efforts

Here is a list of related efforts that I find noteworthy: