Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A minimal operating system (2K LOC) on a small RISC-V board

License

Notifications You must be signed in to change notification settings

fengzixu/egos-2000

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

811 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimal operating system on a small RISC-V board

With only 2000 lines of code, egos-2000 implements every component of a functional operating system. It runs on a $129 small development board with a RISC-V processor. The vision of this project is to help every student from any college or university to read all the code of an operating system.

Lines of Code What? Lines of Code What?
222 SD card driver 264 11 Applications (shell, etc.)
48 Exception handling 262 Library
106 Memory management 54 Makefile
358 Grass kernel (scheduler + system call) 172 FPGA board-specific tools
339 File system 175 Other (boot loader, etc.)

This is an image

Earth and Grass Operating System 2000

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
    • cpu interrupt and memory management interfaces
  • The grass layer implements hardware-independent abstractions.
    • processes, system calls and inter-process communication
  • The application layer implements file system, shell and user commands.

The definitions of struct earth and struct grass in egos.h specify the interfaces between these layers.

Hardware Requirements

Usages and Documentation

For compiling and running egos-2000, please read USAGES.md or watch the tutorial videos (MacOS, Linux or Windows). This document further introduces the teaching plans, architecture and development history.

The RISC-V instruction set manual introduces the privileged registers used by egos-2000. The SiFive FE310 manual introduces the processor used by egos-2000, especially the GPIO, UART and SPI bus controllers.

For any questions, please contact Yunhao Zhang.

Acknowledgements

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.

About

A minimal operating system (2K LOC) on a small RISC-V board

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 95.1%
  • Makefile 2.7%
  • Assembly 2.2%