v1.0.0 Stable • x86_64

A simple x86_64 microkernel
for educational study.

A complete, functional microkernel written in C from scratch. Features cooperative multitasking, mailbox IPC, and a real user shell.

qemu-system-x86_64
$ make run
[KERNEL] Booting Microkernel OS...
[KERNEL] Initializing GDT... OK
[KERNEL] Initializing IDT... OK
[KERNEL] Memory: 128MB detected
[SCHED] Starting task scheduler...
[USER] Shell started. PID: 1

microkernel> _

< 1s

Build Time

7

System Calls

~15KB

Kernel Size

100%

Educational

Live Kernel Simulation

Visualizing the Cooperative Scheduler & IPC in real-time.

CPU CORE 0
IDLE
READY QUEUE
BLOCKED (WAITING)
System initialized...

System Architecture

A microkernel design separating mechanism from policy.

RING 3
USER SPACE
Shell
IPC Server
IPC Client
User Lib
⬇⬆ SYSCALL / SYSRET
RING 0
KERNEL
Syscall Dispatcher
Scheduler
IPC Mailbox
PMM / VMM
⬇⬆ INTERRUPTS
HARDWARE
CPU (x86_64)
RAM
PS/2 Keyboard
Serial Port

Clean, Readable C Code

Standard C99 and Assembly.

void ipc_send(task_t *sender, int target_tid, const char *msg, size_t len) {
    task_t *target = &tasks[target_tid];
    
    // Block sender until mailbox is empty (Synchronization)
    while (target->mailbox.occupied) {
        sender->state = TASK_BLOCKED;
        sched_yield();
    }
    
    // Copy message to target's mailbox
    memcpy(target->mailbox.buffer, msg, len);
    target->mailbox.occupied = true;
    
    // Wake receiver if it was waiting
    if (target->state == TASK_BLOCKED) {
        target->state = TASK_READY;
    }
}

System Call API

Current implementation details (v1.0.0).

Syscall RAX (ID) RDI (Arg 1) RSI (Arg 2) Description
sys_write 1 buffer length Write to serial/console (stdout implicit)
sys_yield 2 - - Voluntarily give up CPU time
sys_exit 3 - - Terminate current task
sys_send 4 packet_ptr - Send IPC message (via ipc_packet_t*)
sys_recv 5 buffer maxlen Receive IPC message (blocking)
sys_getchar 6 - - Read char from keyboard (blocking)
sys_exec 7 prog_name - Launch program by name (e.g. "shell")

Quick Start Guide

Requirements: GCC, Make, QEMU
01. Clone
git clone https://github.com/Ojhaharsh/Microkernel-OS.git
02. Build
make

Compiles kernel & user programs

03. Run
make run

Launches QEMU instantly

🚀 Project Roadmap

Join us in building the next features.

Phase 1: Memory

Implementing a user-space malloc and free allocator for dynamic memory.

Next Up

Phase 2: Storage

Building a Virtual File System (VFS) with TAR RAM disk support to load files.

Planned

Phase 3: Graphics

Transitioning from text mode to a VESA/VGA framebuffer for GUI applications.

Planned