Lisa<p>So I started writing yet another pointless Unix system.</p><p>The idea being "what if I could have a kernel that's a program for another OS, and a filesystem in a single file, then put it all on a USB stick and have an OS that would run basically anywhere on top of whatever else is already running?"</p><p>Then I figured that meant the userspace programs would need to be running on an emulator of some kind, so they would work on any architecture.</p><p>So I invented a CPU architecture, wrote an emulator and an assembler for it, built the beginnings of a Unix kernel around that so that anything userspace runs on the emulator, then wrote a test program to see if it all works.</p><p>It does.</p><p>Oh there's also a simple VGA emulator running inside a window so that there's something to write a console, and thus a tty, around.</p><p>It boots:<br>Grabs a nice chunk of memory, maps the VGA emulator into it, divides it into pages, manages it's own heap, has a basic tty, a simple filesystem with all the IO needed to use it, some basics in /dev, maps the keyboard back to scancodes then handles its own keyboard mapping, manages multiple processes inside it's emulator, each with their own page table so that they each see their own flat memory space where there is none, then PID 1 spawns in and currently just reads from the tty till I press escape, causing it to exit which triggers system halt.</p><p>Amazing how complex basically doing nothing can be.</p><p>Here it is booting then shutting down, and also a screenshot of the source for the "wait for escape" test program.</p><p><a href="https://twoot.site/tags/UNIX" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>UNIX</span></a> <a href="https://twoot.site/tags/programming" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>programming</span></a> <a href="https://twoot.site/tags/coding" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>coding</span></a> <a href="https://twoot.site/tags/ThingsIDoWhenBored" class="mention hashtag" rel="nofollow noopener noreferrer" target="_blank">#<span>ThingsIDoWhenBored</span></a></p>