Richard Bucker

Tiny Operating System

Posted at — Jun 15, 2021

The last few days I have been looking for a tiny os to fill the gap between BSD, Linux, chroot/jail, and virtual machines. I still do not have an answer as many of these tiny OS' have disappeared but then I’m also trying to describe what a tiny OS is … and I keep ending back at the starting point.

In the beginning there is the development environment. This can take on a couple of different flavors. I’m currently using two. The first is editing my code locally and running my code as myself. Second I have a deploy script that let’s me deploy my code locally on my development machine, however, this time it’s running from a safe folder under a different user and in a chroot. But I am running the code without going through a commit stage and in many cases I’m using my local dependencies.

Once I have committed the code to version control it can me deployed to at, qa, and prod. One of the missing parts here is some sort of a build running and some branching to indicate where the code is supposed to go and thus trigger the build. One key feature is that the EXACT code deployed to AT and “accepted” should be the same executable moved to production. (not recompiled)

push code up the tree and pull data down the tree

There is no reason that DEV is the same OS and environment as AT-prod. In my case I can cross compile in FreeBSD, OpenBSD, amd ClearLinux.

This model has been successful as I started designing this appserver in ChromeOS' linux, moved it to ClearLinux, and then did some testing on OpenBSD. As I started moving this project around I kept looking for the ideal way to deploy it. I’ve had some experience with Docker, swarm, K3S and K8S but at the end of the day it’s a cycle. For some reason the proponents of containers seem to rest on full OS installations in the container when it’s clear it should be a small subset. In fact Docker, as a container wrapper, looks a lot like FreeBSDs jail and that’s where it got it’s start but it’s a lot more complicated and not completely portable. But Jails are.

I’ve tried a few micro OS' too and they all stink. It’s not that they do not work but most are dead and the one or two I have seen solve a narrow problem set, slow cadence, lack documentation, and better off building my own… and so I and up back at chroot.

Lastly there is a question about upgrades, migration, boot time. With the right tooling most of the risks go away.

So I think that tiny is out and turbo is in.