{"id":13836013,"url":"https://github.com/daniel-e/tetros","last_synced_at":"2026-01-07T21:04:18.108Z","repository":{"id":46321386,"uuid":"68911683","full_name":"daniel-e/tetros","owner":"daniel-e","description":"Tetris that fits into the boot sector.","archived":false,"fork":false,"pushed_at":"2016-12-18T13:32:27.000Z","size":171,"stargazers_count":778,"open_issues_count":0,"forks_count":39,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-07-10T19:23:30.348Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daniel-e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-22T10:42:55.000Z","updated_at":"2025-07-05T11:19:28.000Z","dependencies_parsed_at":"2022-09-02T01:51:35.111Z","dependency_job_id":null,"html_url":"https://github.com/daniel-e/tetros","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/daniel-e/tetros","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-e%2Ftetros","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-e%2Ftetros/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-e%2Ftetros/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-e%2Ftetros/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daniel-e","download_url":"https://codeload.github.com/daniel-e/tetros/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daniel-e%2Ftetros/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28237781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T15:00:32.418Z","updated_at":"2026-01-07T21:04:18.078Z","avatar_url":"https://github.com/daniel-e.png","language":"Assembly","funding_links":[],"categories":["RTOS","Assembly"],"sub_categories":["ESP8266"],"readme":"# TetrOS\nTetrOS is a small *feature rich* Tetris clone which is written in Assembly. It fits completely into a 512 byte boot sector as it requires only 446 bytes (which is the maximum allowed size of the first stage boot loader in the master boot record (MBR) of a drive) and is executed during the boot sequence before any operating system is loaded. Actually, it does not need any existing operating system. TetrOS *is* an operating system, hence the suffix OS in its name.\n\nVideo that shows TetrOS in action:\n\n[![TetrOS - Teris in 512 byte boot sector](http://img.youtube.com/vi/Hl7M7f-Hh78/0.jpg)](https://youtu.be/Hl7M7f-Hh78)\n\nAnd this is the complete machine code:\n\n![TetrOS - Machine code](https://github.com/daniel-e/mbr_tetris/blob/master/screenshots/code.png)\n\n## Running TetrOS\n\nThere are two options to run TetrOS. Either in an emulator like qemu or via an installation of TetrOS in the boot sector of a real disk, USB stick or some other media.\n\n### Running via qemu\n\nSimply run `make run`. This will execute qemu with the right parameters to run TetrOS. If you're using Ubuntu and qemu is not intalled on your system you can install it via `sudo apt-get install qemu`.\n\n### Running via an USB stick\n\nFirst, copy the image to an USB stick. For example, if your USB stick is on `/dev/sde` use the following command to overwrite the first sector of the USB stick with the TetrOS image:\n\n`sudo dd if=tetros.img of=/dev/sde`\n\nAfter that you should be able to boot the stick to play TetrOS.\n\n## Features\n* Each brick shape has a unique color.\n* Blinking cursor is not visible.\n* Left and right arrow to move a brick.\n* Up arrow to rotate a brick.\n* Down arrow to drop a brick.\n* Game over detection. It stops if a new brick could not be placed.\n* Selects the next brick at random via a linear congruential generator.\n* Nice playing field.\n\n## Features missing due to size limits\n* Scores and highscores.\n* Intro.\n* Game over message and restart without rebooting.\n* Show next brick.\n* Increase speed.\n\n## Compiling the sources\n\nThe repository already contains an image which you can use for testing. However, if you want to compile the image from the sources you need nasm, a general prupose x86 assembler to be installed on your system. On Ubuntu you can can install it via the command `sudo apt-get install nasm`. On macOS you will need [homebrew](http://brew.sh/) to install `nasm` and `binutils`.\n\nIf `nasm` is installed you can compile the sources by executing `make`. This will create the image `tetros.img`. After that you can run the image via qemu or you can copy the image via `dd` on an USB disk or a disk (see above).\n\nI have tested it with nasm 2.11.08 on Ubuntu 16.04.\n\n## Similar projects\n* https://github.com/dbittman/bootris\n* https://github.com/Shikhin/tetranglix\n* http://olivier.poudade.free.fr/src/BootChess.asm\n* https://github.com/programble/tetrasm - Tetris for x86 in NASM but which does not fit into the boot sector.\n\n## Acknowledgements\nI would like to thank the following persons for contributing to TetrOS.\n* [DraftYeti5608](https://github.com/DraftYeti5608)\n* [Ivoah](https://github.com/Ivoah)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-e%2Ftetros","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaniel-e%2Ftetros","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaniel-e%2Ftetros/lists"}