A minimal 32-bit operating system kernel written in Rust, featuring a command-line interface, file system, text editor, Snake game, and ASCII video player.
- Snake Game: Classic snake game with keyboard controls
- ASCII Video Player: Play videos converted to ASCII art (includes Bad Apple demo)
- Real-time rendering with configurable FPS
- Command-Line Interface: Interactive shell with multiple commands
- File System: In-memory file system with directory support
- Text Editor: Built-in editor for creating and modifying files
- VGA Text Mode: Custom VGA driver with color support
- Keyboard Driver: PS/2 keyboard input with interrupt handling
- Interrupt Descriptor Table (IDT): Proper interrupt management
- Create, read, write, and delete files
- Directory management (mkdir, rmdir, cd)
- File listing and navigation
- In-memory storage (up to 32 files, 4KB each)
- Rust (nightly toolchain)
- NASM or GNU as (assembler)
- GNU ld (linker)
- QEMU (for running the OS)
- Python 3 with OpenCV (for video conversion)
# Build the OS
make
# Build and run in QEMU
make run
# Clean build artifacts
make clean
# Rebuild from scratch
make rebuild# Create bin directory
mkdir -p bin
# Assemble boot code
as --32 src/boot.asm -o bin/boot.o
# Compile Rust kernel
rustc --target i686-unknown-linux-gnu --crate-type staticlib \
-C opt-level=2 -C panic=abort -C relocation-model=static \
-C target-feature=-sse,-sse2,+soft-float \
-o bin/kernel.o src/kernel.rs
# Link everything
ld -m elf_i386 -T src/linker.ld -o bin/myos.bin bin/boot.o bin/kernel.o
# Run in QEMU
qemu-system-i386 -kernel bin/myos.bin# Make iso
make iso
Once HexiumOS boots, you'll see the HexiumOS prompt. Type help to see available commands:
help- Display help informationclear- Clear the screenhello- Print a greeting messageinfo- Display system informationecho <text>- Echo text back to the terminal
snake- Launch the Snake game- Use arrow keys to control
- ESC to exit
play <video>- Play an ASCII videoplay badapple- Play Bad Apple videoplay rahh- Play RAHH video- ESC to exit playback
ls- List files and directories in current directorycd <dir>- Change to specified directorypwd- Print working directorymkdir <dir>- Create a new directoryrmdir <dir>- Remove an empty directorytouch <file>- Create an empty filecat <file>- Display file contentsedit <file>- Open file in text editorwrite <file>- Write text to a filerm <file>- Delete a file
- Type to insert text
Backspace- Delete characterESC- Save and exit editor
HexiumOS includes a Python script to convert videos into ASCII art format:
python convert_video.py <video_file> [options]
Options:
--width WIDTH ASCII width (default: 80)
--height HEIGHT ASCII height (default: 24)
--fps FPS Target FPS (default: 15)
--output OUTPUT Output Rust file (default: src/bad_apple_data.rs)
--invert Invert colors (white on black)# Convert a video to ASCII
python convert_video.py badapple.mp4 --width 80 --height 24 --fps 15 --output src/bad_apple_data.rs
# Rebuild the OS with the new video
make rebuild
# Run and play the video
make run
# Then type: play badapple- Target: i686 (32-bit x86)
- Boot: Custom bootloader using multiboot
- Memory: Direct VGA buffer access (0xB8000)
- Interrupts: Custom IDT with keyboard interrupt handler
#![no_std]- Bare metal development#![no_main]- Custom entry point- Static compilation with panic=abort
- Soft-float arithmetic (no SSE/SSE2)
- VGA Buffer: 0xB8000 (80x25 text mode)
- Kernel: Loaded at 1MB physical address
- File System: Static arrays in kernel memory
- Stores pre-rendered ASCII frames
- Implements frame timing for consistent FPS
- Supports multiple video formats
- Direct VGA buffer manipulation for performance
- In-memory implementation
- Maximum 32 files
- Maximum 4KB per file
- Maximum 16 directories
- Hierarchical directory structure
- Type commands and press Enter
- Use Backspace to delete characters
โArrow Up - Move upโArrow Down - Move downโArrow Left - Move leftโArrow Right - Move rightESC- Exit game
ESC- Stop playback and return to CLI
- Regular typing - Insert text
Backspace- Delete characterESC- Save and exit
- No persistence (file system is RAM-only)
- Maximum file size: 4KB
- No multitasking
- No network support
- Limited to VGA text mode (80x25) or limited color mode
- No dynamic memory allocation
- Persistent file system (disk I/O)
- More video codec support
- Additional games and applications
- Network stack
- GUI support
- Multi-processing
- Additional drivers (mouse, sound)
Contributions are welcome! Feel free to submit issues or pull requests.
This project is open source and available under the MIT License.