x64 OS mostly developed by Copilot
- C++ 73.4%
- C 11.6%
- Makefile 9.3%
- Assembly 4.4%
- Shell 0.8%
- Other 0.5%
| .github | ||
| src | ||
| .gitignore | ||
| LICENSE | ||
| Makefile | ||
| README.md | ||
| renovate.json | ||
| run.sh | ||
SlopOS
A minimal operating system built with GRUB bootloader
SlopOS is a simple operating system that demonstrates multiboot kernel development using the GRUB bootloader. It resolves the previous boot loop issues by using a proven, reliable bootloader instead of a custom implementation.
Architecture
SlopOS uses the multiboot specification and boots via GRUB, providing a stable and reliable boot process.
Boot Process
- GRUB Bootloader: Handles hardware initialization and multiboot protocol
- Multiboot Kernel: 32-bit protected mode kernel with multiboot headers
- VGA Text Output: Simple text-based output for demonstration
Building and Running
Prerequisites
- NASM assembler
- GCC compiler
- GRUB tools (grub-mkrescue, grub-pc-bin)
- QEMU x86-64 emulator
- Make
- xorriso (for ISO creation)
- mtools
Quick Start
# Build and run the OS (builds ISO and boots with GRUB)
./run.sh
# Or manually:
make all # Build ISO image
make run # Run in QEMU (nographic)
make run-gui # Run in QEMU with graphics
make clean # Clean build files
Project Structure
src/- Kernel source codemultiboot_kernel.cpp- Main kernel with process and memory managementmultiboot_entry.asm- Assembly entry point for multiboot kernelmultiboot.ld- Linker script for multiboot ELF kernelterminal.cpp- VGA text mode terminal driverstring.cpp- String manipulation functionstimer.cpp- Timer functionalitymemory.cpp- Physical memory allocator and heap managementprocess.cpp- Process control and schedulingcontext_switch.asm- Assembly context switching codesyscall.cpp- System call interface implementationshell.cpp- Shell as separate integrated process
build/- Generated build artifacts and ISO imageMakefile- Build configuration for GRUB-based system with new componentsrun.sh- Build and run script
Features
- GRUB-based bootloader (reliable, no boot loops)
- Multiboot-compliant 32-bit protected mode kernel
- VGA text mode output with proper newline and cursor positioning
- Clean build system with ISO generation
- QEMU testing support
- Resolves previous boot loop issues
- Interactive shell with command input/output
- Shell commands (version, hello, uptime, about, help)
- Keyboard input support with character echo
- Hardware cursor positioning management
- Memory management system (physical memory allocator)
- Process management framework (PCB, scheduling)
- System call interface
- Separated shell architecture
Process and Memory Management
SlopOS v2.0 introduces fundamental operating system features:
Memory Management
- Physical memory allocator with bitmap-based free page tracking
- Kernel heap allocator (kmalloc/kfree) for dynamic memory allocation
- Memory initialization and management for 32MB RAM
- Foundation for virtual memory management (paging support prepared)
Process Management
- Process Control Block (PCB) structure for process metadata
- Process creation, termination, and state management
- Basic cooperative multitasking scheduler (round-robin)
- Context switching support with assembly implementation
- Support for up to 32 concurrent processes
System Architecture
- Clear separation between kernel and user space
- System call interface for user-kernel communication
- Shell runs as integrated process with memory management
- Modular design allowing future enhancements
System Calls
- sys_exit - Process termination
- sys_write - Terminal output
- sys_read - Terminal input
- sys_yield - Cooperative multitasking
Boot Loop Fix
This version of SlopOS resolves the previous boot loop issue by:
- Replacing the problematic custom bootloader with GRUB
- Using the multiboot specification for reliable kernel loading
- Implementing proper multiboot headers and entry points
- Providing a stable, tested boot process
The GRUB bootloader successfully loads the kernel and displays a working system with basic shell functionality.
Shell Commands
SlopOS now includes an enhanced shell with process and memory management features:
version- displays "slopOS 2.0 - Now with process management!"hello- displays "world"ps- shows running processes (kernel and shell)memory- displays memory management statusyield- demonstrates cooperative multitaskingexit- exits the shellhelp- displays list of available commands
The shell features:
- Interactive command input with keyboard support
- Proper cursor positioning that follows text input/output
- Command parsing and execution
- Error handling for unknown commands
- Real-time user interaction
- Professional shell prompt "slopOS> "
- Memory management integration
- Process management awareness