Sample Source: TetrOS is a small feature rich Tetris clone which is written in Assembly. logo

Sample Source: TetrOS is a small feature rich Tetris clone which is written in Assembly.

Free

Tetris that fits into the boot sector.

FreeFree tier
Type
Open Source

About Sample Source: TetrOS is a small feature rich Tetris clone which is written in Assembly.

TetrOS is a minimal Tetris clone written entirely in x86 Assembly that fits into a 512-byte boot sector (MBR). It runs directly during system boot without any operating system, making it a tiny 'operating system' itself. The game includes features such as colored bricks, smooth movement with arrow keys, random next brick selection via a linear congruential generator, and game over detection. Due to extreme size constraints, it lacks scores, highscores, a game over restart, next brick preview, and speed increases. It is open source under the MIT license and can be run via emulators like QEMU or installed on a USB stick for real hardware boot.

Key Features

Each brick shape has a unique color
Blinking cursor is not visible
Left and right arrow to move a brick
Up arrow to rotate a brick
Down arrow to drop a brick
Game over detection when no space for new brick
Random next brick selection via linear congruential generator
Nice playing field

Pros & Cons

Pros
  • Extremely small: 512 bytes (fits in boot sector)
  • Runs without any existing operating system
  • Open source (MIT license) and free
  • Educational for understanding MBR, boot loaders, and assembly
  • Supports both emulator (QEMU) and real hardware (USB boot)
Cons
  • No scores or highscores due to size limit
  • No game over message or restart without reboot
  • No next brick preview
  • No speed increase as game progresses
  • Limited to single game play; no pause or settings

Best For

Boot sector game development demonstrationRetro computing and hobbyist projectsLearning low-level x86 Assembly programmingMinimalist Tetris on embedded systems or old hardware

FAQ

What is TetrOS?
TetrOS is a small, feature-rich Tetris clone written in Assembly that fits entirely into a 512-byte boot sector. It runs during the boot sequence before any operating system, hence the 'OS' in its name.
How can I run TetrOS?
You can run TetrOS either in an emulator like QEMU (by running 'make run') or install it on a USB stick by writing tetros.img to the first sector (e.g., 'sudo dd if=tetros.img of=/dev/sde').
Is TetrOS open source?
Yes, the source code is hosted on GitHub under the MIT license. You can compile it using NASM assembler.
What features are missing due to the size limit?
Due to the 512-byte constraint, TetrOS lacks scores, highscores, an intro screen, game over message, the ability to restart without rebooting, next brick preview, and speed increase.