A next-gen custom operating layer for the PlayStation 2: CLI power interface, advanced memory management, and network/party features. Built as a NASM real-mode boot chain + x86 assembly kernel glue + C kernel, with a platform HAL multiplexed for PS2 EE (FreeMCBoot) and x86 QEMU/modchip CD targets.
This OS is designed to run on PlayStation 2 consoles with the following specifications:
- CPU: MIPS R5900 (Emotion Engine) - x86 emulation via modchip
- Memory: 32MB DDR SDRAM
- Storage: CD/DVD Drive
- Controllers: DualShock 2 Support
- Network: Ethernet (optional)
- PS2 Console (any model)
- DMS3 Modchip (or any compatible modchip)
- CD/DVD Media for burning the OS
- USB Keyboard (for shell interaction)
- Linux Terminal (Ubuntu/Debian recommended)
- NASM (Netwide Assembler) for Assembly compilation
- GCC (GNU Compiler Collection) for C compilation
- i686-elf-gcc cross-compiler
- i686-elf-binutils for linking
- mkisofs for ISO creation
- growisofs for CD burning
# One-command setup (x86 tools, QEMU, Docker/PS2SDK, verify build)
./setup.sh
# Or manually on Ubuntu/Debian:
sudo apt-get update
sudo apt-get install nasm gcc-multilib make dosfstools genisoimage qemu-system-x86# Clone the repository
git clone <repository-url>
cd asmOS
# Build for PS2 (optimized)
make ps2-build
# Or build with debugging
make all# Create ISO image
make iso
# Burn to CD (replace /dev/sr0 with your CD drive)
growisofs -dvd-compat -Z /dev/sr0=ps2os.iso- Insert the burned CD into your PS2
- Power on the PS2 with modchip enabled
- The OS will boot automatically
- Use keyboard to interact with the shell
make all- Standard buildmake ps2-build- PS2-optimized buildmake ps2-test- Test PS2 build in QEMUmake iso- Create bootable ISOmake setup/./setup.sh- Install all deps and verify environmentmake test-integration- Build + symbol/stub checksmake ps2-native- Build PS2 EE ELF for FreeMCBootmake fmcb-package- Assemble FreeMCBoot deploy foldermake clean- Clean build artifactsmake info- Show build information
- NASM boot (
boot/stage1.asm,fatload16.asm) — real-mode FAT12 kernel load, E801 RAM probe →0x500, PM jump to0x100000 - NASM kernel glue (
boot/arch_x86/) — ATA disk I/O, keyboard/VGA text, timer, speaker, syscalls (syscalls_x86.asm), context switch - FAT12 chain —
disk_read_sector→fat12_read_sector→plat_fs_*→ shellls/fat12_list_files - C kernel (
src/,platform/x86/) — shell, scheduler policy, memory, net, subsystems - Platform HAL (
include/platform.h,platform/x86/,platform/ps2/) — shared logic, target-specific backends - QEMU —
make runattachesdisk/os.imgas IDE (if=ide); protected-mode ATA PIO matchesdisk_io.asm - Note:
boot/stage2.cis an alternate C FAT loader; live x86 boot uses NASM stage1 only - Network stack (
src/net/,src/net_clients.c) — UDP transport, ping, FTP/telnet/IRC clients - FAT12 I/O — read/write/delete via platform storage layer
- FreeMCBoot —
scripts/build_fmcb_package.sh,docs/HARDWARE_TESTING.md
- CPU: Optimized for Pentium III era (PS2 x86 emulation)
- Memory: 32MB RAM allocation
- Graphics: VGA text mode compatibility
- Storage: FAT12 filesystem for CD compatibility
- PS2 hardware detection
- Enhanced error handling
- Larger kernel support (16KB)
- Improved disk I/O
- PS2-specific optimizations
- Enhanced memory management
- Improved task scheduling
- Better system information display
- ps2info - PS2 hardware information
- meminfo - Memory usage details
- ls - File listing with sizes
- clear - Screen clearing
- reboot - System restart
- help - Command help system
- FAT12 filesystem for CD compatibility
- File listing with detailed information
- Directory navigation (planned)
- File reading capabilities (planned)
help # Show available commands
ls # List files
clear # Clear screen
echo <text> # Echo text
exit # Exit shellps2info # PS2 hardware information
meminfo # Memory usage information
date # Current date/timereboot # Reboot system# Test in QEMU before burning to CD
make ps2-test
# Debug with GDB
make debug
# In another terminal: make gdb- CD not booting: Ensure modchip is properly installed
- Build errors: Check cross-compiler installation
- Memory issues: Verify 32MB RAM allocation
- Keyboard not working: Check USB keyboard compatibility
Edit boot/boot.asm to adjust:
- Memory detection thresholds
- Hardware compatibility flags
- Boot messages
Edit src/shell.c to add:
- New command functions
- Command descriptions
- Help text
Edit Makefile to adjust:
- Compiler optimization flags
- CPU architecture settings
- Memory allocation
- BIOS Load: PS2 BIOS loads bootloader from CD
- Hardware Detection: Detect PS2-specific hardware
- Kernel Load: Load kernel from FAT12 filesystem
- System Init: Initialize memory, scheduler, shell
- User Interface: Present enhanced shell to user
- 0x0000-0x7BFF: Bootloader
- 0x7C00-0x7DFF: Boot sector
- 0x10000-0x1FFFF: Kernel (16KB)
- 0x20000+: User space and system data
- FAT12: Compatible with CD media
- Boot Sector: Enhanced with PS2 branding
- Root Directory: 224 entries maximum
- File Size: Up to 32MB per file
This project is licensed under the MIT License - see the LICENSE file for details.