Earth Ground OS, for RISC-V in 2000 lines of code

I stumbled upon this today, it is totally for education purposes only, but I really like it.
The only peripherals supported are a UART, SD card and possibly GPIO (Some of the “Earth” code references GPIO on a SiFive E31 MCU).

For applications it has a built in shell with a few commands (cat, cd, echo, ls, pwd).

I have not tried to port it to the JH7110, but am sure that it is possible.

2 Likes

Hi, I am Yunhao, the author of egos-2000. Thanks for liking this project and feel free to email me if I can help with anything. You can find my email on my homepage: https://dolobyte.net/

1 Like

Thank you.

Oh and congratulations on the Hackaday post.

I like one of the comments there, that the Linux 0.01 kernel source code, from 1991, which is only about 10000 lines of C and x86 assembly could be useful for education as well.

mzs@tock:~/src/os/linux$ cloc *
      88 text files.
      88 unique files.
       0 files ignored.

github.com/AlDanial/cloc v 1.86  T=0.20 s (447.1 files/s, 52019.0 lines/s)
-----------------------------------------------------------------------
Language             files          blank        comment           code
-----------------------------------------------------------------------
C                       45            554            398           4977
C/C++ Header            31            293            193           1998
Assembly                 7            108            230           1126
make                     5             45             24            293
-----------------------------------------------------------------------
SUM:                    88           1000            845           8394
-----------------------------------------------------------------------

P.S. I can always find an email address from a simple “git log | more”, but I rarely hassle people, they usually get enough background noise from empty vessels. So for better, or worse, I’m one of those people who will dig deep into source code, if available, to “understand” something that I am not able to understand at first glance.

1 Like

I agree with you. I think a good amount of students should still aim at reading a 10K OS, such as Linux 0.01 or xv6-riscv from MIT. I was reading xv6 myself seven years ago when I took my undergrad OS.

I think egos-2000 is suitable for another good amount of students, depending on how much time a student would like to allocate for studying OS.

1 Like

Thanks, I am currently reading the xv6-risc-book (which is also available in Chinese).

EDIT: To generate the English pdf I needed to apply pull request 35 and if you want an epub file pull request 31.

e.g.

$ cd xv6-riscv-book/
$ git config --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"
From https://github.com/mit-pdos/xv6-riscv-book
 * [new ref]         refs/pull/10/head -> origin/pr/10
 * [new ref]         refs/pull/11/head -> origin/pr/11
 * [new ref]         refs/pull/14/head -> origin/pr/14
 * [new ref]         refs/pull/15/head -> origin/pr/15
 * [new ref]         refs/pull/16/head -> origin/pr/16
 * [new ref]         refs/pull/17/head -> origin/pr/17
 * [new ref]         refs/pull/18/head -> origin/pr/18
 * [new ref]         refs/pull/19/head -> origin/pr/19
 * [new ref]         refs/pull/20/head -> origin/pr/20
 * [new ref]         refs/pull/21/head -> origin/pr/21
 * [new ref]         refs/pull/24/head -> origin/pr/24
 * [new ref]         refs/pull/27/head -> origin/pr/27
 * [new ref]         refs/pull/28/head -> origin/pr/28
 * [new ref]         refs/pull/29/head -> origin/pr/29
 * [new ref]         refs/pull/3/head  -> origin/pr/3
 * [new ref]         refs/pull/30/head -> origin/pr/30
 * [new ref]         refs/pull/31/head -> origin/pr/31
 * [new ref]         refs/pull/32/head -> origin/pr/32
 * [new ref]         refs/pull/35/head -> origin/pr/35
 * [new ref]         refs/pull/5/head  -> origin/pr/5
 * [new ref]         refs/pull/6/head  -> origin/pr/6
 * [new ref]         refs/pull/7/head  -> origin/pr/7
 * [new ref]         refs/pull/8/head  -> origin/pr/8
 * [new ref]         refs/pull/9/head  -> origin/pr/9
$ git checkout origin/pr/35
$ make
$ git checkout origin
2 Likes

:+1: :+1: :+1: