BVOS - A Very Minimal x86 Training OS in Assembly and C

BVOS — Barely Visible OS A minimal 32-bit x86 operating system written in Assembly and C, designed as a learning project to explore bootloaders, protected mode, and kernel basics. It does almost nothing… and that’s the point. Features Boots from BIOS via a custom MBR boot sector Loads a tiny kernel from disk into memory Switches to Protected Mode and runs C code Writes “Hello, world!” directly to VGA text memory Fits in just a few sectors Build & Run Prerequisites ...

August 18, 2025 · 2 min

mtsh — Empty Shell — Minimal Teaching Shell

mtsh (pronounced like em tee shell) is a tiny, educational Unix-like shell written in C. It’s designed to be simple enough to understand line-by-line, while still being a functional interactive shell you can extend over time. It starts as a bare-bones REPL that can run external commands, and is designed to grow feature-by-feature as you learn. Every line of code is intended to be readable, hackable, and easily extended — making mtsh a hands-on guide to understanding how real shells work under the hood. ...

August 14, 2025 · 3 min

The Cloud Is the New OS

Back in the 1990s and early 2000s, the operating system was the computer. If you wanted to run a program, manage users, allocate memory, connect to a network, or read a file, you did it through the OS. Microsoft understood this. They built an empire by controlling the layer that everything else relied on. But today, most developers have no idea what OS their app is running on. And they don’t need to. ...

August 7, 2025 · 3 min

How the Scheduler Works in Xv6

Here’s an ELI5 (Explain Like I’m 5) version of what the scheduler() function in xv6 is doing: What is a scheduler? Imagine a classroom with a bunch of students (processes) but only one teacher (CPU). The teacher can only help one student at a time, so she needs a way to pick which student to help next. That’s what the scheduler does — it chooses which process gets to use the CPU next. ...

August 5, 2025 · 4 min

Fix High CPU Usage in Xv6

When you run MIT’s xv6 in QEMU, you’ll often see 100% CPU usage on one of the CPU threads, even when the system is doing absolutely nothing. I first noticed this when I could hear the normally super-quiet fan of my PC spinning. But why? The Problem: Busy-Waiting in the Scheduler xv6 implements a simple process scheduler in proc.c. Here’s a simplified view: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 void scheduler(void) { for(;;){ acquire(&ptable.lock); for(p in process table){ if(p->state == RUNNABLE){ run(p); } } release(&ptable.lock); } } This loop runs forever. Even when no processes are runnable, the scheduler keeps spinning, checking over and over, eating CPU cycles. ...

August 5, 2025 · 3 min