- This project is a hobby game-oriented OS capable of running custom games without relying on any external operating system.
- The system is being developed incrementally, starting in text mode to stabilize hardware interaction before introducing graphical complexity.
- Executes a custom bootloader
- Switches to 32-bit protected mode
- Initializes VGA text-mode output (written to memory at 0xB8000)
- Initializes a PS/2 keyboard driver (polling-based)
- Displays a terminal interface with a shell prompt
- Supports a minimal interactive shell
- Features a fully playable ASCII Tetris game launched from the shell
- The kernel currently runs entirely in text mode
- Custom bootloader written in x86 assembly
- 32-bit protected-mode kernel
- Cross-compiled using an i686-elf GCC toolchain
- Bootable ISO image tested with QEMU
- Character output
- Line wrapping
- Screen clearing
- Scrolling support
- Per-cell color attribute support (
vga_put_color_at) - Global color state control (
vga_set_color)
- Backspace handling
- Input buffering
- Interactive terminal interface
- Input buffer with length tracking
- Backspace editing support
- Shell command dispatcher returns action codes, enabling mode switching from within the kernel loop
helpclearechoplay— launches ASCII Tetrisshutdown(QEMU ACPI poweroff: port I/O 0x604)
- Full ASCII Tetris implementation running directly in the kernel
- All 7 standard tetrominoes (I, O, T, S, Z, J, L) with 4 rotations each
- Wall-kick rotation system
- Ghost piece (shows landing position)
- Line clearing with scoring
- Progressive difficulty (speed increases every 10 lines, up to level 9)
- Per-piece VGA color attributes
- Next-piece preview panel
- Score, lines cleared, and level display
- Hard drop (space) and soft drop (s)
- Game-over screen with restart prompt
- Exit back to shell at any time with
qorESC
| Key | Action |
|---|---|
a |
Move left |
d |
Move right |
s |
Soft drop |
w |
Rotate clockwise |
Space |
Hard drop |
q |
Exit to shell |
- Commands are dispatched via
shell_execute(), which returns an action code (SHELL_OK,SHELL_PLAY) consumed by the kernel loop to trigger mode switches - The terminal layer exposes
terminal_get_action()for the kernel to poll pending actions after each keypress
Bootloader (Assembly)
↓
Switch to Protected Mode
↓
Kernel (C) ←── Mode: SHELL or TETRIS
├── VGA Driver (text mode + color attributes)
├── PS/2 Keyboard Driver (Polling)
├── Terminal Interface
├── Shell Command Dispatcher
└── Tetris Engine
├── Board state & collision
├── Piece definitions (7 tetrominoes × 4 rotations)
├── Line clearing & scoring
└── Rendering (ghost, colors, info panel)
- Cross-Compiler: The project uses a freestanding cross-compiler toolchain targeting i686-elf.
- OSDev Wiki: GCC Cross-Compiler
- Interrupts – OSDev Wiki
- PS/2 Keyboard – OSDev Wiki
- The Little Book about OS Development
- Creating a Shell
- Emulator: Tested primarily using QEMU (i386)
- Build:
make - Run:
qemu-system-i386 -cdrom myos.isoORmake run - At the shell prompt, type
playto launch Tetris. Pressqin-game to return to the shell.
- Direct hardware interaction via port I/O and memory-mapped VGA
- Interrupt handling
- Freestanding C development
- Game logic in a bare-metal environment
- Validation under QEMU and x86 boot media
It is intentionally built without relying on external OS libraries or hosted runtime environments.

