23 ms·
Tetris-OS: An operating system that only plays Tetris
- cconger 5y agoYoutube video that goes over the developer's experience making it: https://www.youtube.com/watch?v=FaILnmUYS_U https://www.youtube.com/watch?v=FaILnmUYS_U
- aparsons 5y agoIn my retirement, watching programming streams has been a guilty pleasure (drives my SO crazy), and this is one of my favorite channels. I especially loved their other video on making Minecraft from scratch* * - https://www.youtube.com/watch?v=4O0_-1NaWnY https://www.youtube.com/watch?v=4O0_-1NaWnY
- nuclearnice1 5y agoWonderful! Mine has been chess streams. GMHikaru,IM Rosen, St. Louis Chess Club ... What else have you discovered?
- aparsons 5y agoPer Vognsen’s Bitwise (*) was one of my favorites until it was discontinued. It’s not a complete set, but still a great watch. I also enjoyed George Hotz’s occasional programming streams. He reminds me of some of my favorite colleagues from over the years. I haven’t watched chess in a while, but your comment certainly sparked something. I may give it another go. For a less nerd-y class of content, I have also enjoyed boxing videos - especially those focused on coaches illustrating technique. [*] https://www.youtube.com/channel/UCguWV1bZg1QiWbY32vGnOLw https://www.youtube.com/channel/UCguWV1bZg1QiWbY32vGnOLw
- dankwizard 5y agoReplying to watch later!
- Kelamir 5y agoYou could also press on the timestamp of the message, which will present you with an option to add it to the list of your favorites, which you'll be able to access from your profile.
- unixhero 5y agoI just do this in between, for procrastination.
- Koshkin 5y agoTetrOS would be a better name.
- darig 5y agoWhat did you name the OS you made?
- nojs 5y ago“Tetris” clones often seem to get aggressively shut down on copyright grounds too, so this might be more robust.
- harry8 5y agoSeems ironic since given the prominence of intellectual property theft from its creators in the Tetris story. :S
- FredPret 5y agoMaybe they learnt first-hand...
- lloeki 5y agoThe name is a trademark, usually not calling it "Tetris" makes you measurably safer. The tetrominos themselves are not protected but the shapes+colours are protected in some way (as original art), as is the official set of gameplay rules, the argument being that the overall combination of these is the "Tetris IP"... although the enforceability of that more often seem to hinge into "I don't have the money to fight an army of lawyers to prove that a gameplay idea isn't protected in yet another jurisdiction". https://arstechnica.com/gaming/2012/06/defining-tetris-how-courts-judge-gaming-clones/ https://arstechnica.com/gaming/2012/06/defining-tetris-how-c...
- anthk 5y agoExcept BSD games :p.
- userbinator 5y ago
- readflaggedcomm 5y agoThere are also Tetris clones in BIOS: https://www.basicinputoutput.com/2018/11/the-great-tetris-renaissance-in-bios.html https://www.basicinputoutput.com/2018/11/the-great-tetris-re...
- martin1975 5y agolol, this is awesome!
- cwyers 5y agoWell, at least until someone ports DOOM to it.
- ngcc_hk 5y agoLike the last bit. As many have observed a good movie is more about the sound than the sight. But has it actually run on bare metal or just qemu I wonder. Anyway good music.
- tyingq 5y ago"Windows - Absolutely no idea." QEMU works on WSL and WSL2 now, that would be one way.
- tracker1 5y agoGetting X and PulseAudio working is less than fun though... hoping MS or someone comes up with an "easy" button for that one. Managed to get X11 working, but not PulseAudio then kind of gave up on the experiment.
- tracker1 5y agoLooks like there's an easy button in the insiders channel now... will have to wait a while for GA though.
- spijdar 5y agoQEMU works fine on Windows natively, and supports the "Windows Hypervisor Platform" as an accelerator ("-accel whpx" I think), same API that Hyper-V and WSL2 use. Where you might run into problems is the audio/video parts, not sure if QEMU can do audio on win32. Edit: Thinking about it, I'm pretty sure QEMU comes with an SDL frontend by default, which should wrap at least audio output even on Windows.
- yjftsjthsd-h 5y agoI'm confused - doesn't qemu work fine on Windows natively?
- tyingq 5y agoHe had specific command line switches for other environments, so it would allow the Linux example to "just work", other than maybe audio. I'm sure someone could figure it out for Windows as well.
- snapetom 5y ago"Literally everything" Love the brutal honesty.
- charles_f 5y ago> Soundblaster 16 driver 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)
- deleted 5y ago[deleted]
- loser777 5y agoHow do we delineate "OS that does one thing" from "bare metal program?"
- yjftsjthsd-h 5y agoI'd argue that the difference is that an OS doesn't do just one thing, unless the thing is "run arbitrary other programs". (Which is to say, I think calling this an OS is a misnomer, since I don't see anything to suggest that it can load/run anything else)
- RantyDave 5y agoI'm having enough difficulty separating "hypervisor" from "operating system".
- sitkack 5y agometa-os, the os that runs the os. Then there is nested virtualization, and then user mode virtualization, so you can easily get 4 levels deep. Think of all the exits!
- Black101 5y agoTetrinet next?
- lisper 5y agoThis 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 5y 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 5y 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 5y 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 5y 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.)
- raggi 5y agoI am confused. Normally it's distributions that have an OS suffix. This is actually an Operating System. How rebellious.
- jarym 5y agoVertically Integrated Tetris!
- AndrewKemendo 5y agoI wonder why the choice of SB16
- naikrovek 5y agoprobably because it's the least complex option which met the requirements.
- sgerenser 5y agoAlso because it’s supported by QEMU.
- anthk 5y agoAnd any emulator since 1996.
- fuzzfactor 5y agoAlso can be natively enabled on bare metal by DOS without additional drivers, so many audio chips support(ed) SB16 long after DOS lost popularity. Somewhat like VESA graphics modes which are at least there if you have no vendor-specific VGA drivers.
- kazinator 5y agoBecause it's widely supported by emulators, and supports the 16 bit sample size at the 48 kHz sample rate that is needed for high quality music, which is more than enough for Tetris. The SB16 also features FM synthesis, though this program doesn't appear to use it; it rolls its own wave table method. However, that would be a particular reason to target it specifically, rather than some more modern card that lacks FM synthesis. FM synthesis produces the signature sounds heard in 80's pop music and video games.
- rasz 5y agonon-PnP SB16 max out at 44.1KHz, only Vibra and later PnP models supported up to 48KHz. The real reason is that SB16 is the lowest common denominator for DOS stereo compatibility with higher models. You might think SBPRo also supports stereo playback, but SB16, SB32, SB64, and SB128 do not support SBPro Stereo mode playback. SB16 DSP 4.x removed support for DSP 2.x 3.x "High Speed" modes. Anything using SBPro Stereo mode will not work in SB16 an newer at all.
- mrmckizzle 5y agoReminds me of this https://www.nand2tetris.org/ https://www.nand2tetris.org/
- tonfreed 5y agooh, so like emacs then?
- ganafagol 5y ago> This has only been tested in an emulator. Real hardware might not like it. ?! So this is just a stand-alone binary with an awkward loader then. The real trick (and challenge) comes when you want to run your stuff on actual bare metal.
- jfrunyon 5y agoYeah... my biggest question is why it hasn't been tested on hardware. Dev doesn't own an x86? Also the author refers to the (raw/MBR-format) disk image twice as an "iso" which makes me shudder.
- fuzzfactor 5y agoIf there was a floppy-based IMG file I would try it right out on bare metal.
- Hnrobert42 5y agoI don’t understand your point? Are you trying to argue that OP didn’t work on a hard enough challenge to make you happy?
- ganafagol 5y agoI'm arguing that OP did not build an OS. They built a program that needs a quite heavyweight runtime and loader in form of a system emulator.
- dudeinjapan 5y agoIf 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 https://liacs.leidenuniv.nl/~kosterswa/tetris/tot.pdf
- eru 5y agoIf 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.))
- dudeinjapan 5y agoRight, my comment was the other way around; I don't know whether infinite Tetris is Turing complete.
- eru 5y agoRunning a Turing machine reduces to Post's correspondence problem (which the paper shows reduces to answering some peculiar questions about Tetris).
- elcomet 5y agoTuring completeness refers to a language, while NP-completeness refers to an optimization problem. So for it to be turing complete you first need to define a language based on tetris. For NP-completeness, it might just be solving the game.
- klyrs 5y agoSorry to nitpick your nitpicking, but NP-completeness refers to decision problems (does there exist a solution with parameter k); optimization problems are often NP-Hard (find the minimum parameter k for which the decision problem has a solution).
- mlang23 5y agoDo you know that effect? Once you touch a topic, it appears to show up everywhere! :-) I recently wrote a tetris clone for braille users. https://news.ycombinator.com/item?id=26790812 https://news.ycombinator.com/item?id=26790812
- modernerd 5y ago“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.” – Casey Muratori in “The Thirty Million Line Problem” https://youtu.be/kZRE7HIO3vk?t=1205 https://youtu.be/kZRE7HIO3vk?t=1205
- teddyh 5y agohttps://en.wikipedia.org/wiki/Self-booting_disk https://en.wikipedia.org/wiki/Self-booting_disk
- hackerbabz 5y agoTruly everything old is new again.
- protoman3000 5y agoIt should be again like this. I only truly understood C after I wrote my own fully functional Operating System (e.g. paging, interrupts, user mode, multitasking and multicore etc.) and got it running on bare metal. Programming other things in C now often feels like when you beat the final level in recent Mario games ("Champions Road") and replay the core game again, it just flows is easy and highly enjoyable. I'd recommend every serious programmer to write their own OS.
- vladharbuz 5y agoI've wanted to do this but had some trouble finding a good reference. Do you have any resources you can share? Thank you! :)
- ajxs 5y agoThe resource that got me started on this topic was: https://wiki.osdev.org/Main_Page https://wiki.osdev.org/Main_Page There's some decent tutorials available on here that provide a good introduction to the topic.
- nikodunk 5y agoDamn that’s probably some good Tetris performance with it being so close to bare metal. Edit: having read the readme, it looks like performance is locked at 60fps.
- procrastitron 5y agoThere is a similar project for Space Invaders here: http://www.erikyyy.de/invaders/ http://www.erikyyy.de/invaders/
- rejschaap 5y agoI was half-expecting an OS where you delete a file by completing lines with the right Tetris pieces.
- exikyut 5y agoHow would that work? Genuinely curious, trying to visualize what you mean
- kovvy 5y agoPerhaps start with a set of blocks representing available resources. The 'top' equivalent could be a stream of blocks falling down the screen. Manipulate and rearrange the blocks to create new sets of blocks representing your desired function. Deleting a file would be similar to any current GUI file manager, but with more blocks - drag file block to delete block. Opening a file with a particular program would be similar. Chaining a series of operations would be where it gets interesting. The shape of the pieces would control what can be chained together.
- nathell 5y agoI made one too, 20 years ago! http://pliki.danieljanus.pl/btetris.bin http://pliki.danieljanus.pl/btetris.bin (Use qemu-system-i386 -fda btetris.bin if you want to try it out.) 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. I've lost the source code, but ndisasm should help out. 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.
- frodetb 5y ago>Features: > - It's Tetris. Not sure what I was expecting.
- netik 5y agoif you built an operating system that only does X it’s called an embedded system or you know, a video game
- anthk 5y agoYou don´t need Qemu, DOSBox will run it if you set 100h as the loading address.
- luxuryballs 5y agoWould 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.
- shockeychap 5y agoI’d love to see a Super Mario Brothers version of this concept.
- ChrisArchitect 5y agoso this is just a bootable thing that runs Tetris? Does it do anything to run/control the hardware?