<story><title>Tetris-OS: An operating system that only plays Tetris</title><url>https://github.com/jdah/tetris-os</url></story><parent_chain><item><author>lisper</author><text>This is cool, but I think it&amp;#x27;s misleading to call it an operating system.  It&amp;#x27;s Tetris that runs &lt;i&gt;without&lt;/i&gt; 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 &amp;quot;operating system&amp;quot; is confusing.&lt;p&gt;This probably sounds like I&amp;#x27;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 &amp;quot;operating system&amp;quot; actually &lt;i&gt;is&lt;/i&gt;.  IMHO, the &lt;i&gt;defining characteristic&lt;/i&gt; 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.</text></item></parent_chain><comment><author>userbinator</author><text>Alternatively, it&amp;#x27;s Tetris with bits of a minimal OS mixed in, just enough to support it, which is not unlike what a lot of OSs in embedded systems are like.&lt;p&gt;A lot of software was written in this format several decades ago, including many games:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Self-booting_disk&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Self-booting_disk&lt;/a&gt;&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;List_of_PC_booter_games&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;List_of_PC_booter_games&lt;/a&gt;&lt;p&gt;I think the boundaries are quite fuzzy; while something like the mask-ROM firmware in a 4-function calculator or microwave would probably not be called an OS by the majority of people, how about a router running Linux, or the RTOS used in a car&amp;#x27;s ECU? Moving up from there, DOS is clearly in the realm of an actual OS, then we have the locked-down mobile devices, and at the far end are the general-purpose PCs running Windows, Linux, macOS, and such.&lt;p&gt;Even at the &amp;quot;small end&amp;quot;, a microcontroller running a firmware containing a single infinite loop that does stuff with the peripherals seems unlikely to classify as an OS; but what if you start adding dynamic memory allocation, coroutines&amp;#x2F;cooperative multithreads, filesystem code, etc.?</text></comment>
<story><title>Tetris-OS: An operating system that only plays Tetris</title><url>https://github.com/jdah/tetris-os</url></story><parent_chain><item><author>lisper</author><text>This is cool, but I think it&amp;#x27;s misleading to call it an operating system.  It&amp;#x27;s Tetris that runs &lt;i&gt;without&lt;/i&gt; 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 &amp;quot;operating system&amp;quot; is confusing.&lt;p&gt;This probably sounds like I&amp;#x27;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 &amp;quot;operating system&amp;quot; actually &lt;i&gt;is&lt;/i&gt;.  IMHO, the &lt;i&gt;defining characteristic&lt;/i&gt; 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.</text></item></parent_chain><comment><author>skissane</author><text>I don&amp;#x27;t think it is essential that there be a clear boundary between an OS and programs.&lt;p&gt;For example, you can have a Smalltalk-based OS, written in Smalltalk. The OS components are simply Smalltalk classes and methods. Your programs&amp;#x2F;utilities&amp;#x2F;applications would also be Smalltalk classes and methods. There needn&amp;#x27;t be any clear boundary between the classes&amp;#x2F;methods that belong to the OS and those that belong to programs&amp;#x2F;applications&amp;#x2F;utilities.&lt;p&gt;If you look at library operating systems, the operating system is just a library which you link into your application. Such an operating system can only run one program, and you have to rebuild the operating system whenever you want to change the single program it runs. Still, I think library operating systems count as operating systems. This Tetris implementation isn&amp;#x27;t using a library operating system, but you could refactor the code into two parts – the Tetris game, and generic OS services, and the later would constitute a library operating system. If you look at its source files, only about seven of them (main.c, music.[ch], sound.[ch], speaker.[ch]) actually implement the game. The other 23 source files are generic OS services. 
So I&amp;#x27;d say that, even if this isn&amp;#x27;t an operating system as a whole, it contains an OS within itself.</text></comment>