An operating system, but it only plays Tetris.

Overview

TETRIS-OS: An operating system that only plays Tetris.

screenshot

Video with an explanation of the development process.

Features:

  • It's Tetris.
  • 32-bit (x86)
  • Fully custom bootloader
  • Soundblaster 16 driver
  • Custom music track runner
  • Fully hardcoded tetris theme
  • Double-buffered 60 FPS graphics at 320x200 pixels with custom 8-bit RGB palette

Resources Used

Building & Running

NOTE: This has only been tested in an emulator. Real hardware might not like it.

EDIT: this is not true anymore! @parkerlreed has run this on a Thinkpad T510.

Mac OS

For the cross-compiler: $ brew tap nativeos/i386-elf-toolchain && brew install i386-elf-binutils i386-elf-gcc

$ make iso
$ qemu-system-i386 -drive format=raw,file=boot.iso -d cpu_reset -monitor stdio -device sb16 -audiodev coreaudio,id=coreaudio,out.frequency=48000,out.channels=2,out.format=s32

Unix-like

You should not need a cross-compiler in most cases as the gcc shipped in most linux distros will support i386 targets.

If this isn't the case for you, read here about getting a cross-compiler.

To run:

$ make iso
$ qemu-system-i386 -drive format=raw,file=boot.iso -d cpu_reset -monitor stdio -device sb16 -audiodev pulseaudio,id=pulseaudio,out.frequency=48000,out.channels=2,out.format=s32

If you have sound device issues, try building without the #define ENABLE_MUSIC in main.c and running with $ qemu-system-i386 -drive format=raw,file=boot.iso.

If you're having issues with no image showing up/QEMU freezing, this is a known bug with QEMU SB16 emulation under GTK. Please read what @takaswie has written in #2 for a workaround.

Windows

Absolutely no idea. Maybe try WSL.

Real hardware

You probably know what you're doing if you're going to try this. Just burn boot.iso onto some bootable media and give it a go. If things break, try disabling all of the music (remove #define ENABLE_MUSIC in main.c) since you probably don't have something with a SB16 in it.

You might also like...
System Programming 2021 Spring

sp-labs System Programming Labs 2021 Spring Repo 文件说明 lab: 实验指导书 & 题目。 answer_template: 提供对应 lab 的参考作答模板。建议将图片放至对应的img/文件夹下,使用 Markdown 编写,最后通过 Typora

Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.

Background Music macOS audio utility Overview Auto-pause music Application volume Recording system audio Download Build and Install Uninstall Troubles

Hello, I created a real banking system with creating each customer a private file.

bankingsystem Hello, I created a real banking system for my school project with creating each customer a private file. Your Transaction Code is your l

An operating system, but it only plays Tetris.
An operating system, but it only plays Tetris.

TETRIS-OS: An operating system that only plays Tetris. Video with an explanation of the development process. Features: It's Tetris. 32-bit (x86) Fully

KePOS is a 64-bit operating system. Design and implement your own operating system
KePOS is a 64-bit operating system. Design and implement your own operating system

KePOS is a 64-bit operating system. The purpose of this system is to combine the theoretical knowledge and practice of the operating system, and to deepen the understanding of the operating system.

A gameboy emulator that only plays Pokemon Blue, in ~70 lines of c++.

pokegb A gameboy emulator that only plays Pokemon Blue, in ~70 lines of c++. See the technical write-up. Features Plays Pokemon Blue (and Red).

GCC/gcov code coverage data extraction from the actual embedded system, without requiring a file system, or an operating system, or standard C libraries.

GCC/gcov code coverage data extraction from the actual embedded system, without requiring a file system, or an operating system, or standard C libraries.

Dining philosophers problem is a problem created by Edsger Wybe Dijkstra in 1965 to explain the deadlock state of an operating system, which is traditionally commonly introduced in lectures on operating systems
Dining philosophers problem is a problem created by Edsger Wybe Dijkstra in 1965 to explain the deadlock state of an operating system, which is traditionally commonly introduced in lectures on operating systems

42-philosophers Dining philosophers problem is a problem created by Edsger Wybe Dijkstra in 1965 to explain the deadlock state of an operating system,

Plugin for VLC that pauses/plays video on mouse click

Pause Click plugin for VLC VLC plugin that allows you to pause/play a video by clicking on the video image. Can be configured to work nicely with doub

Plays native alert sound and shows native dialogs/alerts in your Flutter app.
Plays native alert sound and shows native dialogs/alerts in your Flutter app.

flutter_platform_alert 2021 © Weizhong Yang a.k.a zonble. A simple plugin to present native alerts, including playing alert sounds and showing alert d

VEX v5 Pro program that records driver movements and plays them back during the autonomous period.

Autonomous Recorder This code was written for team 5588R, but it can be easily modified to work with your team's robot. Notes Code isn't fully finishe

Malloc geiger is a hook for malloc that plays geiger counter blips in proportion to the amount of calls to malloc as a way of knowing what an application does

Malloc Geiger Malloc geiger is a hook for malloc that plays geiger counter blips in proportion to the amount of calls to malloc as a way of knowing wh

Tetris on a Raspberry Pi Pico mounted on a Pimoroni Pico Explorer

PicoTetris Classic Tetris game running on a Raspberry Pi Pico microcontroller. Pico C port by Richard Birkby Original JavaScript implementation - Jake

A tetris game on windows console written in C++.

TetrisConsole A tetris game on windows console written in C++. For Course de Introduction to Data Structure and Algorithm Analysis, BUPT 2021. Notice

tinytetris - 80x23 terminal tetris
tinytetris - 80x23 terminal tetris

tinytetris - 80x23 terminal tetris

Tetris written with C++ and OpenGL.

Tetrec This is yet another Tetris game, which is in 3D, written using C++ and OpenGL 2.1, aiming at being lightweight towards not-so-beefy computers (

Tetris bot

Lemon Tea Guildline versus tetris bot How to build Notices Lemon Tea makes use of standard library header bit available in C++20, so make sure your

A version of Tetris with randomly generated polyominoes of varying sizes

Multris A version of Tetris with randomly generated polyominoes of varying sizes ----- CONTROLS ----- LEFT / RIGHT ARROW - Move. Hold to move quicker.

Releases(baf4c98)
Owner
null
Step by step, learn to develop an operating system on RISC-V

This course is used to teach and demonstrate how to write a simple operating system kernel for the RISC-V platform from scratch.

null 373 Jan 3, 2023
A unix operating system written from scratch in c++

A unix operating system made from scratch using c++

pranaOS 141 Jan 6, 2023
Tutorial: Writing a "bare metal" operating system for Raspberry Pi 4

Tutorial: Writing a "bare metal" operating system for Raspberry Pi 4

Adam Greenwood-Byrne 2.5k Dec 31, 2022
Like the Vulkan C API but with quality of life improvements of C++

vk-simple-cpp Takes the current C headers and adds a few quality of life improvements while staying faithful to the original C API. Improvements: Enum

Charles Giessen 6 Feb 18, 2022
Hello, I am creating this file to make everyone understand the basis of C++ language which is actually the advanced version of C but better than C because of its OOPs feature.

Hello-in-C++ ?? ?? FOR BEGINNERS IN C++ Hello, I am creating this file to make everyone understand the basics of C++ language which is actually the ad

Ankita Mohan 2 Dec 27, 2021
A very small v8 javascript runtime for linux only

Just A very small v8 javascript runtime for linux only Build and Run Currently working on modern linux (debian/ubuntu and alpine teste

theanarkh 9 Nov 8, 2021
a header-only crossplatform type-safe dynamic compiler generator based on C++ 17.

Mu Compiler Generator MuCompilerGenerator(MuCplGen) a Header-Only dynamic compiler generator based on C++ 17. Why MuCplGen? header-only cross-platform

MuGdxy 11 Dec 31, 2021
A single file C++ header-only minizip wrapper library

cpp-zipper A single file C++ header-only minizip wrapper library This code is based on 'Making MiniZip Easier to Use' by John Schember. https://nachti

null 8 Dec 18, 2022
Modern, header-only, compact and cross platform C++ network/sockets library

cpp-net-lib Modern, header-only, compact and cross-platform C++ network/sockets library. Don't mind the crappy name, I suck at naming things. Why? I n

Marc 10 Jul 20, 2022
This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.

?? C/C++ 技术面试基础知识总结,包括语言、程序库、数据结构、算法、系统、网络、链接装载库等知识及面试经验、招聘、内推等信息。This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendation, etc.

huihut 27k Dec 31, 2022