Live data from Hacker News

Tetris-OS: An operating system that only plays Tetris

github.com

101–110 of 126 posts

Re: Tetris-OS: An operating system that only plays Tetris

#101

Earlier quoted context omitted.

I 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.

I don't agree that something has to be capable of running "arbitrary binaries" to count as an operating system. If I have a Smalltalk-based OS which is capable of running arbitrary Smalltalk code, but doesn't have any support for running non-Smalltalk binaries (native code or programs written in languages other than Smalltalk), I'd still consider it to be an operating system.

The “arbitrary” part is a force of how rather than what programs are run. Is your Smalltalk code running by compiling it into the OS? Is it loaded as a library? Can I write a C backend to output an indistinguishable library? In the latter cases, it is still capable of running arbitrary code - you may just be choosing not to.

Re: Tetris-OS: An operating system that only plays Tetris

#103

“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 peop…

> 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 Most bootdisk-based games did not have any kind of "customized version of an operating system". They were running on bare metal. For 99% of the games, there was no abstraction/management layer between the application (the game) and the hardware nor any kind of fra…

Also if you take 1 generation step back into the 2600 or intelivision there was a very simple API they did use that was built in. It was usually little more than fill out some memory in a particular way and flick an interrupt or particular instruction and it would either run something in bios or hardware. Also many did not need much in the way of an OS as they usually just either memory mapped themselves into the address space or copied themselves there. At that point if you keep your memory in order you do not need much and can toggle the registers yourself or call into bios routines yourself.

The newer machines use APIs to abstract. Where companies used to conform to particular HW standards (VGA,EGA,etc) with extensions. Now HW companies see their drivers as a differentiator. While the programmer writes to the abstraction API. Technically you could still write bare metal but few companies want to say what their real API looks like. So you are stuck with the OS or if you are lucky what someone else has noodled out.

Re: Tetris-OS: An operating system that only plays Tetris

#104
post #93

Earlier quoted context omitted.

Yet many of these self-booting disks would quite happily work when copied to a reboot-persistent RAM drive (the RAD: drive), which showed that although it was claimed that they did all the OS-ey things themselves, actually there was still quite a lot of the original OS still running there. At the core of it, the AmigaOS exec was tiny and helpful, and things like device drivers were just separate processes that you se…

Doesn't WHDLoad do that?

Yep.

Re: Tetris-OS: An operating system that only plays Tetris

#105

“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 peop…

> 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 Most bootdisk-based games did not have any kind of "customized version of an operating system". They were running on bare metal. For 99% of the games, there was no abstraction/management layer between the application (the game) and the hardware nor any kind of fra…

I think Carrier Command (at least the PC version) was not a bootdisk game but a normal .EXE.

Re: Tetris-OS: An operating system that only plays Tetris

#106
post #19

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…

That's a catchy hook but terribly misleading!

Re: Tetris-OS: An operating system that only plays Tetris

#107
post #19

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…

It'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.

Re: Tetris-OS: An operating system that only plays Tetris

#108
post #59

If Tetris (with an infinite board) is Turing complete, then how about building an OS from Tetris? (It seems for certain problems it is NP-complete!) https://liacs.leidenuniv.nl/~kosterswa/tetris/tot.pdf

If you already know that it's Turing complete, isn't it automatically also NP-complete? (I also read the paper: to clarify, they are referring to different problems you can build on top of Tetris, and prove some of them NP-complete and some Turing complete. (They don't mention Turing completeness directly, but they do a reduction to Post's correspondence problem.))

Right, my comment was the other way around; I don't know whether infinite Tetris is Turing complete.

Re: Tetris-OS: An operating system that only plays Tetris

#109
post #19

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…

That 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

Re: Tetris-OS: An operating system that only plays Tetris

#110

Earlier quoted context omitted.

I don't agree that something has to be capable of running "arbitrary binaries" to count as an operating system. If I have a Smalltalk-based OS which is capable of running arbitrary Smalltalk code, but doesn't have any support for running non-Smalltalk binaries (native code or programs written in languages other than Smalltalk), I'd still consider it to be an operating system.

The “arbitrary” part is a force of how rather than what programs are run. Is your Smalltalk code running by compiling it into the OS? Is it loaded as a library? Can I write a C backend to output an indistinguishable library? In the latter cases, it is still capable of running arbitrary code - you may just be choosing not to.

You can still write code in a different language like C that will compile into Smalltalk VM bytecode. You will never be able to run any arbitrary code, just the one compiled for your machine. And in this case, the machine is virtual (but does not need to be). Symbolics Lisp machines were able to run Pascal as well, for example.
Post reply on HN