This Custom-Written Operating System Has Only One Job: To Play Tetris

Written for x86 hardware, and requiring a Sound Blaster 16 for audio, this tiny operating system gets one job done well.

Gareth Halfacree
4 years agoRetro Tech / Gaming

Pseudonymous programmer "jdah" has written a custom operating system for x86 processors, but with a twist: the only thing it does is play Tetris.

"Yes, I know it's more of a kernel than an operating system," jdah admits by way of introduction to his unusual project, "but 'ring 0 bare metal OS/tiny kernel' just doesn't have the same ring to it. When I came up with the idea for this project I just kind of had to throw my main one on the back burner because this was too good to wait."

Traditionally, an operating system is used to provide an interface to the underlying hardware of a PC in order to run a variety of applications. In this case, the only thing the software — which is written for 32-bit x86 hardware — does is play a modern implementation of Tetris, the tile-matching classic written by Alexey Pajitnov in 1984 and since ported to almost anything capable of even the most basic computation.

Most operating systems can accomplish a variety of tasks; jdah's, by contrast, plays Tetris. (📹: jdah)

The operating system created by jdah includes a fully-custom bootloader, a Sound Blaster 16 driver for audio, and 320x200 eight-bit RGB graphics running at 60 frames per second with double buffering — and all without anything running beneath it. The under the permissive MIT License and has been confirmed as running on real x86 hardware —though you'll need a Sound Blaster 16 card or compatible if you want to hear any music.

Jdah has published a 23-minute video walking through the development of the custom OS, from writing the bootloader through to getting the graphics and audio working and finally implementing the game; the source code, meanwhile, is available on GitHub under the permissive MIT License and has been confirmed as running on real x86 hardware — though you'll need a Sound Blaster 16 card or compatible if you want to hear any music.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Get our weekly newsletter when you join Hackster.
Latest articles
Read more
Related articles