This is cool, but I think it's misleading to call it an operating system. It's Tetris that runs <i>without</i> an operating system, which is to say, on bare metal, old school. Writing programs that run on bare metal is a cool and worthwhile thing to do, but calling any such program an "operating system" is confusing.<p>This probably sounds like I'm picking a nit, but I think it matters for the sake of newbies just starting to climb the learning curve and trying to understand what an "operating system" actually <i>is</i>. IMHO, the <i>defining characteristic</i> of an operating system is that it provides an environment in which to run other programs, ones that are not part of the operating system, and which may not even exist at the time that the operating system starts to run.
I made one too, 20 years ago!
<a href="http://pliki.danieljanus.pl/btetris.bin" rel="nofollow">http://pliki.danieljanus.pl/btetris.bin</a><p>(Use qemu-system-i386 -fda btetris.bin if you want to try it out.)<p>Not really an OS, I just squeezed an implementation of Tetris into a 512-byte boot sector. I remember that a first draft had ~600 bytes and I was cutting away bytes, here replacing mov ax,0 with xor ax,ax, there reusing code as data, until I arrived at that size.<p>I've lost the source code, but ndisasm should help out.<p>I remember I encoded tetromino shapes as a 4x4 1bpp bitmaps taking up 2 bytes each, and there's a 56 41 59 41 52 01 56 01 15 48 52 41 59 in the hexdump, which in ASCII reads VAYAR^AV^A^UHRAY. I've been meaning to write a short story featuring a Vayar V. Hray as a protagonist, but never got around to it.
“In the 1980s with things like the Amiga computer, for example, every game was a boot disk. It booted into its own customized version of an operating system that ran what it needed to run to make its game work well and be performant and reliable. … We know that in the past, hardware that was very capable and very interesting made it so easy to create an operating system that literally everybody did it. Not a few people. Not even most people. But literally everybody.”<p>– Casey Muratori in “The Thirty Million Line Problem”
<a href="https://youtu.be/kZRE7HIO3vk?t=1205" rel="nofollow">https://youtu.be/kZRE7HIO3vk?t=1205</a>
Youtube video that goes over the developer's experience making it: <a href="https://www.youtube.com/watch?v=FaILnmUYS_U" rel="nofollow">https://www.youtube.com/watch?v=FaILnmUYS_U</a>
There are also Tetris clones in BIOS: <a href="https://www.basicinputoutput.com/2018/11/the-great-tetris-renaissance-in-bios.html" rel="nofollow">https://www.basicinputoutput.com/2018/11/the-great-tetris-re...</a>
There is a similar project for Space Invaders here: <a href="http://www.erikyyy.de/invaders/" rel="nofollow">http://www.erikyyy.de/invaders/</a>
> Soundblaster 16 driver<p>This brings back memories for those wretched days when you needed floppy drivers for the most casual of peripherals. Life was simpler back then (and also much more complex)
If Tetris (with an infinite board) is Turing complete, then how about building an OS from Tetris?<p>(It seems for certain problems it is NP-complete!)
<a href="https://liacs.leidenuniv.nl/~kosterswa/tetris/tot.pdf" rel="nofollow">https://liacs.leidenuniv.nl/~kosterswa/tetris/tot.pdf</a>
Damn that’s probably some good Tetris performance with it being so close to bare metal.<p>Edit: having read the readme, it looks like performance is locked at 60fps.
Would be interesting to make a bootloader and “OS” that you could wrap any game with, including GPU driven games like Crysis. I wonder how much more performance we could eek out of our hardware by removing extra overhead.
> This has only been tested in an emulator. Real hardware might not like it.<p>?! So this is just a stand-alone binary with an awkward loader then.<p>The real trick (and challenge) comes when you want to run your stuff on actual bare metal.
Like the last bit. As many have observed a good movie is more about the sound than the sight.<p>But has it actually run on bare metal or just qemu I wonder. Anyway good music.
Do you know that effect? Once you touch a topic, it appears to show up everywhere! :-) I recently wrote a tetris clone for braille users. <a href="https://news.ycombinator.com/item?id=26790812" rel="nofollow">https://news.ycombinator.com/item?id=26790812</a>