x86-32 Kernel

This project is a custom x86-32 kernel implementation that incorporates several key operating system features: I built this kernel as a deep dive into operating system internals. This project helped me understand how modern operating systems work under the hood by implementing core features myself. I spent around 150 hours on this project.

Core Features

  • Preemptive Multitasking: Implements time-slice based task switching with a round-robin scheduler
  • Virtual Memory Management: Paging and segmentation with support for user/kernel space separation, as well as shared memory
  • EXT2 Filesystem: Basic read support for the EXT2 filesystem format
  • System Calls: Essential syscalls including process creation, process management, and IPC
  • Signal Handling: Implementation of basic Unix-like signals for inter-process communication
  • UART8250 Driver: Serial port communication for input/output through QEMU

User Space

Separately, I built a basic os userland shell in C and file system to interact with the kernel, with the shell being able to run elf binaries, navigate the filesystem, and manipulate files with a special vi-like text editor named ‘jinx’. Also supports cat, ls, echo, exit, tree, and other basic commands.

Technical Implementation

The kernel is written primarily in C++ with critical sections in x86 assembly. Key components include:

  • Protected mode operation with GDT/IDT setup
  • Page frame allocation and virtual memory mapping with setup of page tables
  • Process control blocks and context switching
  • Interrupt handling and hardware abstraction layer
  • EXT2 filesystem driver, support for read-only operations
  • UART8250 initialization and interrupt-driven I/O

Development Environment

The kernel runs in QEMU and can be debugged using GDB. The build system uses Make with a custom toolchain for cross-compilation.

[Redacted] (Ask for access)