ModuOS is a hobby operating system written in C and x86-64 assembly, designed for learning and experimentation. It features a custom kernel with interrupt handling, memory management (paging, physical memory allocator), multitasking with process management, and support for multiple file systems (FAT32, ISO9660).
- Custom 64-bit Kernel: Long mode x86-64 kernel with Multiboot2 support
- Memory Management: Physical memory allocator, virtual memory with paging, kernel heap
- Process Management: Multitasking, context switching, ELF executable loading, syscall interface
- Drivers:
- Storage: ATA/ATAPI, AHCI/SATA support
- Graphics: VBE text mode
- Input: PS/2 keyboard and mouse
- System: PCI enumeration, ACPI, RTC, PIC/Timer
- File Systems: FAT32 and ISO9660 (read-only) with virtual file system layer
- Userland: Basic applications and games (cat, echo, shell, games)
- Built-in Games: Raycaster FPS, Snake (Eat Fruit), Stack Blocks, Vertical Ping Pong, Mine Sweeper
- Docker Desktop - For cross-compilation environment
- QEMU - For testing and running the OS
- Windows - Primary tested platform (Linux/macOS may work with modifications)
- Visual Studio Code or any code editor for development
- Git for version control
git clone https://github.com/NtinosTheGamer2324/ModuOS.git
cd ModuOSThe project uses a Docker container with a cross-compiler toolchain. Build the image:
docker build buildenv -t modu-osThis creates a modu-os image containing:
- x86_64-elf-gcc cross-compiler
- NASM assembler
- GRUB bootloader tools
- xorriso for ISO creation
ModuOS requires a 1GB FAT32-formatted disk image named disk.img in the project root.
Option A: Using PowerShell (Windows)
# Create 1GB file
fsutil file createnew disk.img 1073741824
# Use Disk Management or diskpart to format as FAT32Option B: Using third-party tools
- Win32 Disk Imager
- Rufus (create a FAT32 formatted file)
โ ๏ธ Important: The build script does not createdisk.imgautomatically. You must provide it.
Simply run the batch script:
run.batThis will:
- โ Check if Docker is running (and start it if needed)
- ๐จ Build the kernel inside the Docker container
- ๐ฆ Create a bootable ISO with GRUB2
- ๐ Launch QEMU with the ISO and disk image
- ๐ Open log viewer for
com1.logandcom2.log
To view COM port logs during runtime:
- Download Log Viewer v1
- Place it at:
vendor/NTSoftware/Log Viewer.exe - The
run.batscript will automatically open it
ModuOS/
โโโ buildenv/ # Docker build environment configuration
โโโ include/ # Header files
โ โโโ moduos/ # Kernel, driver, and filesystem headers
โ โโโ arch/ # Architecture-specific (AMD64)
โ โโโ drivers/ # Hardware driver headers
โ โโโ fs/ # File system headers
โ โโโ kernel/ # Kernel subsystem headers
โโโ src/ # Source code
โ โโโ arch/AMD64/ # x86-64 specific code (boot, interrupts, syscalls)
โ โโโ drivers/ # Hardware drivers (ATA, AHCI, VGA, PCI, etc.)
โ โโโ fs/ # File system implementations
โ โโโ kernel/ # Core kernel (memory, process, scheduler, etc.)
โโโ targets/AMD64/ # Build target configuration
โ โโโ iso/ # ISO layout for bootable image
โ โโโ linker.ld # Linker script
โโโ userland/ # User-space programs
โโโ LICENSES/ # Third-party licenses
โโโ Makefile # Build system
โโโ run.bat # Build and test script
โโโ LICENSE # Project license (GPLv2)
If you prefer to build manually without run.bat:
# Build the kernel
docker run --rm -it -v "%cd%":/root/env modu-os make clean build-AMD64
# Run in QEMU
qemu-system-x86_64 ^
-M pc-i440fx-6.2 ^
-m 1024M ^
-smp 2 ^
-serial file:com1.log ^
-serial file:com2.log ^
-drive file=dist/AMD64/kernel.iso,format=raw,media=cdrom ^
-drive id=disk,file=disk.img,if=none,format=raw ^
-device ahci,id=ahci ^
-device ide-hd,drive=disk,bus=ahci.0 ^
-boot dOnce booted, you can run:
cat <file>- Display file contentsecho <text>- Print text to consolesh- Simple shellmemtest- Memory testing utilityneofetch- System information display
- Raycaster FPS - First-person perspective game
- Eat Fruit (Snake) - Classic snake game
- Stack Blocks - Block stacking puzzle
- Vertical Ping Pong - Pong variant
- Mine Sweeper - Minesweeper clone
cd userland
./build.sh # Linux/WSLUser programs are compiled separately and placed in targets/AMD64/iso/Apps/.
- Serial Output: Kernel outputs debug information to COM1 and COM2 ports
- QEMU Monitor: Press
Ctrl+Alt+2in QEMU to access the monitor - GDB Debugging: Add
-s -Sto QEMU args and connect withgdb
qemu-system-x86_64 -cdrom dist/AMD64/kernel.iso -s -S &
gdb dist/AMD64/mdsys.sqr
(gdb) target remote localhost:1234
(gdb) continueContributions are welcome! Here's how you can help:
- ๐ด Fork the repository
- ๐ฟ Create a feature branch (
git checkout -b feature/amazing-feature) - ๐พ Commit your changes (
git commit -m 'Add amazing feature') - ๐ค Push to the branch (
git push origin feature/amazing-feature) - ๐ Open a Pull Request
- Follow existing code style and conventions
- Comment your code where necessary
- Test your changes in QEMU before submitting
- Update documentation if you add new features
This project is licensed under the GNU General Public License v2.0 only - see the LICENSE file for details.
ModuOS uses several third-party components:
- GRUB2 - Bootloader (GPLv3+)
- Multiboot2 - Boot protocol specification
- GCC Cross-Compiler - Build toolchain (GPLv3+)
See the LICENSES folder for full license texts of third-party components.
- OSDev Community - Invaluable resources at wiki.osdev.org
- Multiboot2 Specification - Boot protocol by GNU GRUB
- randomdude/gcc-cross-x86_64-elf - Docker base image for cross-compilation
- Project Repository: github.com/NtinosTheGamer2324/ModuOS
- Issues & Bug Reports: GitHub Issues
- Developer: New Technologies Software
Made with โค๏ธ for learning and fun