Egos 2000
GitHub RepoImpressions736
View on GitHub
@githubprojectsPost Author

Egos 2000: An Educational Operating System That Actually Runs on Bare Metal

Intro

If you've ever wanted to understand how operating systems work under the hood, you know the struggle. Most OS tutorials end up being either too abstract (textbook diagrams) or too complex (diving into Linux kernel source code). And then there's the hardware problem — how do you run your toy OS on actual hardware without bricking your machine?

Enter Egos 2000. It's a minimal, educational operating system designed to run on real RISC-V hardware (like the SiFive HiFive1 board) and also in emulators. The twist? It's written ground-up in C, with clean separation between hardware-dependent and hardware-independent code. No Linux dependencies, no bloated abstractions — just bare metal and a clear path to understanding what happens when you press the power button.

What It Does

Egos 2000 is a teaching OS that demonstrates the core concepts of operating systems:

  • Process management — multitasking with a simple scheduler
  • Memory management — page tables, virtual memory basics
  • Interrupt handling — traps, exceptions, and timer interrupts
  • Device drivers — UART, GPIO, and SPI at the bare-metal level
  • Filesystem — a minimal block-based filesystem on SPI flash

It's not meant to be the next Linux. It's a reference implementation you can read, modify, and run on real hardware or in a simulator. The entire kernel fits in under 5,000 lines of C code — which means you can actually grasp the whole thing in a weekend.

Why It’s Cool

A few things make this project stand out:

Hardware-first approach. Most educational OSes run only in emulators. Egos 2000 boots on real RISC-V boards. You can see your kernel's serial output on a physical UART, watch LEDs blink via GPIO, and store data on actual SPI flash. That tactile feedback is worth its weight in gold when you're learning.

Clean separation of concerns. The code is organized into layers: hardware abstraction layer (HAL) for board-specific stuff, kernel core (processes, scheduler, memory), and user-level libraries. This makes it easy to port to other boards or chip architectures (the repo includes ports for both SiFive HiFive1 and a custom QEMU target).

Minimal dependencies. You only need a RISC-V toolchain (or QEMU) and a serial terminal. No Linux kernel headers, no external libraries. Compile, flash, and see your OS boot in seconds.

Well-documented code. The source files include comments explaining not just what each function does, but why the OS is designed that way. It's like having a senior dev walk you through the codebase.

How to Try It

You can run Egos 2000 on real hardware or in QEMU. Here's the quickstart:

  1. Get a RISC-V toolchain (if you don't have one):

    # For Linux (Ubuntu/Debian)
    sudo apt install gcc-riscv64-unknown-elf
    # Or follow the official guide at riscv.org
    
  2. Clone the repo and build:

    git clone https://github.com/yhzhang0128/egos-2000.git
    cd egos-2000
    make
    
  3. Run in QEMU (no hardware required):

    make qemu
    

    You'll see the kernel booting and printing messages to the terminal.

  4. For real hardware (SiFive HiFive1): connect via USB, flash the kernel using OpenOCD, and open a serial terminal (e.g., screen /dev/ttyUSB0 115200).

The repo also includes a detailed README with step-by-step instructions for both approaches.

Final Thoughts

If you're the kind of developer who learns best by reading code and poking at hardware, Egos 2000 is a gem. It's not trying to win any awards — it's a clear, minimal, and executable explanation of how operating systems actually work. I'd recommend it to anyone who's done a few "hello world" tutorials and wants to level up to understanding the kernel layer.

For learners, it's a practical bridge between theory and practice. For curious devs, it's a refreshingly small codebase to explore during a lunch break.


Follow us on Twitter: @githubprojects

Back to Projects
Last updated: May 31, 2026 at 06:12 AM