5 ms·
This is cool, but I think it's misleading to call it an operating system. It's Tetris that runs without an operating system, which is to say, on bare metal, ol
by lisper 6y ago
This is cool, but I think it's misleading to call it an operating system. It's Tetris that runs without 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.
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 is. IMHO, the defining characteristic 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.
- pcthrowaway 6y agoIf Apple and Google can release operating systems that can only run software which has been built for those platforms, approved by Apple/Google, and released through official delivery channels, this could be an operating system too, which only allows you to run program which have been pre-approved, possibly only to deliver blocks. Perhaps the keys are shortcuts to launch additional programs which change the wallpaper in various ways.
- wk_end 6y agoYes, props to the developer for what they've done, but I am perversely disappointed that this isn't actually a complete OS - process scheduler, file system, TCP/IP stack, multiple user support, all the rest - that only runs Tetris.
- klyrs 6y agoI used a few operating systems that were considered "complete," in their time, without a TCP/IP stack or multiple user support. Come to think of it, I don't think they had process schedulers either
- eru 6y agoWell, if you are into exokernels, they wouldn't have a TCP/IP stack either. (You'd have them in userland. Whether you count that as part of the OS or not, is a different question.)
- poisonborz 6y agoThe software in your washing machine begs to differ.
- spijdar 6y agoI somewhat agree with the sentiment, but I think the line is fuzzy. UNIX, as the stories go, originated as essentially an abstraction layer for a single video game, all written in assembly, and eventually expanded to have process isolation and a shell. So I'm inclined to think that this could be an OS, as it has to provide subroutines and code to drive hardware and provide an environment for the game to run, an "operating system" if you will. But if you accept that, everything becomes fuzzy. Is the firmware an "operating system" then? The CPU microcode? On systems like the XEROX Alto, the microcode was developed like a sort of OS kernel. I think it's interesting to explore the "lesser meanings" of terms like "operating system" :-)
- hugey010 6y agoSo if you could write programs with the tetris blocks, it'd be an OS? Sign me up!
- mseepgood 6y agoYou mean Minecraft?
- skissane 6y agoI don't think it is essential that there be a clear boundary between an OS and programs. For example, you can have a Smalltalk-based OS, written in Smalltalk. The OS components are simply Smalltalk classes and methods. Your programs/utilities/applications would also be Smalltalk classes and methods. There needn't be any clear boundary between the classes/methods that belong to the OS and those that belong to programs/applications/utilities. 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'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'd say that, even if this isn't an operating system as a whole, it contains an OS within itself.
- aparsons 6y agoI like to define an OS as something that can execute arbitrary binaries. So if your hypothetical Smalltalk OS has a defined executable format that non-Smalltalk programs can compile to, I’d call it an OS. Note that this also makes for example the uppermost part of the JVM an OS by my definition. I’d argue it’s not a completely incorrect characterization.
- eru 6y agoI think that definition is a bit too broad and too narrow to be useful. For too narrow: you might have a security focused OS that includes everything like a TCP/IP stack etc, but perhaps doesn't allow arbitrary binaries by construction. (Eg it might only allow binaries that come with a proof of innocence, or some other restriction that's harsh enough to lose the 'arbitrary' rating.) For too broad: https://en.wikipedia.org/wiki/Weird_machine https://en.wikipedia.org/wiki/Weird_machine would make almost any software that was written sloppily enough into an OS.
- userbinator 6y agoAlternatively, it'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. A lot of software was written in this format several decades ago, including many games: https://en.wikipedia.org/wiki/Self-booting_disk https://en.wikipedia.org/wiki/Self-booting_disk https://en.wikipedia.org/wiki/List_of_PC_booter_games https://en.wikipedia.org/wiki/List_of_PC_booter_games 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'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. Even at the "small end", 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/cooperative multithreads, filesystem code, etc.?
- alexvoda 6y agoIt's a Tetris unikernel
- ganafagol 6y agoIt's not even running on bare metal.
- jfrunyon 6y agoIDK. Plenty of "operating systems" are linked as a single binary with the application, in the embedded world and historically. This takes it a bit further but I doubt you think the dividing line is "OS and application are maintained as a separate project" which is about the only distinction. I do see where you're coming from, though. Personally I would've described it as "bootable Tetris".
- grishka 6y agoEven in embedded systems, there's still usually a distinct boundary between the OS kernel and the "application", and a well-defined API between the two.
- globular-toast 6y agoI agree, but "operating system" is very poorly defined. Name a feature of an operating system and you can find one that doesn't support it. Just about the only definition that seems to hold is that it runs without an operating system.
- Ceezy 6y agoThat's a catchy hook but terribly misleading!
- Olreich 6y agoIt's no more misleading than saying it runs on bare metal. If I flash the correct motherboard ROM chip with the necessary bits to play Tetris in the UEFI (or completely replace it), would I be running closer or farther from "bare metal" than this is? Am I still on bare metal if I choose to use GRUB for loading up the game? Do I become an OS if I use GRUB instead of embedding that logic within my binary? We call things BIOS and Boot-loader and Operating System by virtue of history, not necessity. It could even be confusing to a newcomer looking into development closer to the hardware and being told that all these programs are fundamentally different, instead of just being instructions and data getting shoved through a bunch of tubes in the processor and PCB.
- JamesSwift 6y agoThat might be what OS'es currently _are_, but I disagree that it is what an OS _is_. I think fundamentally an OS is as the OP uses it, a set of code that interfaces with all your hardware to make the computer function. Heres a good talk I came across in a HN comment a little while back [1] about how games used to be developed vs how they are today. [1] - https://www.youtube.com/watch?v=kZRE7HIO3vk https://www.youtube.com/watch?v=kZRE7HIO3vk