项目 / yhzhang0128/egos-2000

yhzhang0128/egos-2000

行业候选
语言 C标签 educationoperating-system数据更新 2026-11-25 06:49:28 · 仓库 2026-11-24

一段话介绍

Envision a future where everyone can read all the code of an educational operating system.

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Envision a future where everyone can read all the code of an educational operating system.
3,727累计星
322Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景 教育 暂无可用场景

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
打开[仓库 README](https://github.com/yhzhang0128/egos-2000)阅读项目说明,再按其中的使用文档在 macOS、Linux 或 Windows 上编译,并优先在 QEMU 中运行。课程项目见 [EGOS 书](https://egos.fun/book/overview.html)。
特点或设计要点
采用三层架构:earth 层做硬件相关抽象,grass 层做与硬件无关的进程和系统调用抽象,应用层实现文件系统、外壳和用户命令。可在 QEMU 或指定的 RISC-V 开发板上运行。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-08-16 · 语言 C · 贡献者 —
image

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 3,878 字节。

## Vision

This project's vision is to help **every** student read **all** the code of a teaching operating system.

With only **2000** lines of code, egos-2000 implements every component of a teaching operating system that runs on both QEMU and RISC-V boards.
The [EGOS book](https://egos.fun/book/overview.html) contains 9 course projects based on egos-2000.

![Fail to load an image of egos-2000.](tools/images/egos-2000.jpg)

```shell
# The cloc utility is used to count the lines of code.
> cloc egos-2000 --exclude-ext=md
...
github.com/AlDanial/cloc v 1.94  T=0.05 s (949.3 files/s, 62349.4 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                               30            453            677           1592
C/C++ Header                     9             64            105            258
Assembly                         3             14             46             92
make                             1             17             10             58
-------------------------------------------------------------------------------
SUM:                            43            548            838           2000 (exactly!)
-------------------------------------------------------------------------------
```

## Earth and Grass Operating System

The "egos" part of egos-2000 is named after its three-layer architecture.

* The **earth layer** implements hardware-specific abstractions.
    * tty and disk device interface
    * timer and memory management interface
* The **grass layer** implements hardware-independent abstractions.
    * process control block and system call interface
* The **application layer** implements file system, shell, and user commands.

The definitions of `struct earth` and `struct grass` in the header file [egos.h](library/egos.h) specify the layer interface.
Please read [USAGES.md](USAGES.md) for running egos-2000, and
the [instruction set manuals](https://github.com/riscv/riscv-isa-manual/releases) for the RISC-V privileged ISA.

## Acknowledgements

Many thanks to Meta for a [Facebook fellowship](https://research.facebook.com/blog/2021/4/announcing-the-recipients-of-the-2021-facebook-fellowship-awards/).
Many thanks to [Robbert van Renesse](https://www.cs.cornell.edu/home/rvr/), [Lorenzo Alvisi](https://www.cs.cornell.edu/lorenzo/), [Shan Lu](https://people.cs.uchicago.edu/~shanlu/), [Hakim Weatherspoon](https://www.cs.cornell.edu/~hweather/) and [Christopher Batten](https://www.csl.cornell.edu/~cbatten/) for their support.
Many thanks to [Cheng Tan](https://naizhengtan.github.io/) and [Yu-Ju Huang](https://yuju-huang.github.io/) for providing valuable feedback on the EGOS book and using egos-2000 in [Northeastern CS4973/6640](https://naizhengtan.github.io/25spring/) and [Cornell CS4411/5411](https://www.cs.cornell.edu/courses/cs4411/2025sp/).
Many thanks to [Haobin Ni](https://haobin.cx/) and [Hongbo Zhang](https://www.cs.cornell.edu/~hongbo/) for [porting egos-2000 to mriscv](https://github.com/0x486F626F/mriscv/tree/egos), a simple processor written in SystemVerilog.
Many thanks to [Brandon Fusi](https://www.linkedin.com/in/brandon-cheo-fusi-b94b1a171/) for [porting egos-2000 to Allwinner D1](https://github.com/cheofusi/egos-2000-d1) and Sipeed's [Lichee RV64 Nezha compute module](https://wiki.sipeed.com/hardware/en/lichee/RV/RV.html).
Many thanks to [Zack Light](https://zacklight.com/) for making [a YouTube video](https://www.youtube.com/watch?v=zPZzq2KO8ew) introducing egos-2000, and
many thanks to Christopher Allison for [making the DOOM video game work](https://www.youtube.com/watch?v=Lx5DFdnfv7Q) on egos-2000.

For any questions, please contact [Yunhao Zhang](https://dolobyte.net/).
↑