"To understand the machine, one must become the machine's architect."
A 32-bit preemptive multitasking operating system kernel built from scratch
Features β’ Architecture β’ Quick Start β’ Documentation
GT-OS is a research-grade operating system kernel developed from first principles for the x86 architecture. This project explores the intricate world of protected mode execution, virtual memory management, and POSIX-compliant system interfaces.
This isn't just codeβit's a journey into the heart of how computers work, bridging the gap between raw hardware and elegant software abstraction.
- Educational: Designed for developers who want to understand OS internals from the boot sector up
- Research: A platform for exploring kernel design patterns and low-level systems programming
- Professional: Built with production-grade structure and engineering discipline
|
|
GT-OS follows a modular monolithic kernel design, where core services run in kernel space for performance while maintaining strict separation of concerns.
βββββββββββββββββββββββββββββββββββββββββββ
β User Space Applications β
βββββββββββββββββββββββββββββββββββββββββββ€
β System Call Interface β
βββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββ¬βββββββββββ¬βββββββββββ β
β βScheduler β VFS β IPC β β
β ββββββββββββΌβββββββββββΌβββββββββββ€ β
β β VMM β Heap β Slab β β
β ββββββββββββ΄βββββββββββ΄βββββββββββ β
β Kernel Core β
βββββββββββββββββββββββββββββββββββββββββββ€
β Hardware Abstraction Layer (HAL) β
βββββββββββββββββββββββββββββββββββββββββββ€
β PS/2 β ATA β PCI β RTC β PIT β
βββββββββββββββββββββββββββββββββββββββββββ
| Subsystem | Description |
|---|---|
| Scheduler | Preemptive multitasking with round-robin arbitration, process state tracking, and context switching |
| Memory Manager | Paging-enabled Virtual Memory Manager with dynamic kernel heap and slab allocator |
| VFS | Virtual File System abstraction decoupling userspace from physical storage |
| IPC | UNIX-style signals and system call interfaces for inter-process communication |
Ensure you have the following tools installed:
# Required Tools
- i586-elf-gcc # Cross-compiler
- i586-elf-as # Assembler
- QEMU (i386) # Emulator
- make # Build system
- Linux/WSL/macOS # Host environment# Clone the repository
git clone https://github.com/yourusername/GT-OS.git
cd GT-OS/osdev-source
# Clean previous builds
make clean
# Compile the kernel
make all# Boot the kernel
make startDefault Login:
- Username:
root - Password:
toor
Upon boot, GT-OS drops you into a user-mode shell that communicates with the kernel through a Linux-compatible syscall interface.
| Command | Description |
|---|---|
ps |
Display running processes and PIDs |
ls |
List directory contents (VFS query) |
cat <file> |
Output file contents to stdout |
time |
Poll CMOS RTC for current time |
mod <module> |
Load/unload kernel modules dynamically |
GT-OS/
βββ osdev-source/
β βββ arch/i386/ # x86 architecture-specific code
β β βββ boot.S # Bootstrap assembly
β β βββ interrupts.S # Interrupt handlers
β βββ kernel/ # Core kernel subsystems
β β βββ panic.c # Kernel panic handler
β β βββ elf.c # ELF binary loader
β β βββ syscalls.c # System call dispatcher
β βββ mm/ # Memory management
β β βββ pmm.c # Physical memory manager
β β βββ vmm.c # Virtual memory manager
β β βββ heap.c # Kernel heap allocator
β βββ fs/ # File system implementations
β β βββ vfs.c # Virtual File System
β β βββ ext2.c # ext2 driver
β βββ drivers/ # Hardware drivers
β β βββ screen.c # VGA text mode
β β βββ keyboard.c # PS/2 keyboard
β β βββ ata.c # ATA/PIO disk
β βββ include/ # System-wide headers
βββ README.md
GT-OS embodies three core principles of systems programming:
Managing race conditions and synchronization in a preemptive multitasking environment
Transforming raw electrical signals into elegant abstractions like files, streams, and processes
Direct hardware interfacing through port I/O and memory-mapped registersβno safety nets
This kernel is educational in nature but professional in structure, demonstrating that with curiosity and discipline, the computer's "black box" becomes a glass house.
|
Architecture
|
Binary Format
|
Interrupts
|
Contributions are welcome! Areas of interest include:
- π Additional hardware drivers
- π Filesystem optimization
- π§ POSIX compliance improvements
- π Documentation enhancements
Please adhere to K&R coding style for consistency.
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
Gaurav Thakur
Concept, Architecture & Implementation
The name GT-OS reflects the personal nature of this architectural study. It stands as a testament to the fact that with enough curiosity and determination, the "black box" of the computer becomes transparent.
- The OSDev community for their invaluable resources
- The GNU toolchain developers
- QEMU project for excellent emulation
- Everyone who believes in understanding technology from the ground up
Built with passion for operating systems and low-level programming