With only 2000 lines of code, egos-2000 implements every component of an operating system for education. It can run on a RISC-V board or the QEMU software emulator. The vision of this project is to help every college student read all the code of an operating system within one semester.
Note: cloc is used to count the lines of code above. Try cloc egos-2000 --exclude-ext=md
which excludes the markdown documents in the count.
We use egos-2000 as our teaching operating system at Cornell. It adopts a 3-layer architecture.
- The earth layer implements hardware-specific abstractions.
- tty and disk device interfaces
- interrupt and memory management interfaces
- The grass layer implements hardware-independent abstractions.
- processes, system calls and inter-process communications
- The application layer implements file system, shell and user commands.
The definitions of struct earth
and struct grass
in egos.h specify the interfaces of these layers.
- an Artix-7 35T Arty FPGA development board
- a microUSB cable (e.g., microUSB-to-USB-C)
- [optional] a microSD Pmod, a microSD reader and a microSD card (e.g., Sandisk)
Don't worry if the hardware is not available to you. You can also use the software emulator QEMU.
For compiling and running egos-2000, please read USAGES.md.
The RISC-V instruction set manual introduces the privileged ISA. The SiFive FE310 manual introduces the memory map, especially the GPIO, UART and SPI bus controllers. This document further introduces the teaching plans, architecture and development history of egos-2000.
For any questions, please contact Yunhao Zhang.
Many thanks to Robbert van Renesse and Lorenzo Alvisi for their support. Many thanks to Meta for supporting me with a fellowship. Many thanks to all CS4411 students at Cornell over the years for helping improve this course.