Skip to content

A minimal operating system on a small RISC-V board

License

Notifications You must be signed in to change notification settings

aabdulga/egos-2000

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A minimal operating system on a small RISC-V board

With only 2000 lines of code, egos-2000 implements boot loader, microSD driver, tty driver, memory paging, address translation, interrupt handling, process scheduling and messaging, system call, file system, shell, 7 user commands and the mkfs/mkrom tools. It runs on a $129 small development board.

This is an image

# Count lines of code excluding references and README.md
> cloc egos-2000 --exclude-ext=md,pdf
      62 text files.
      61 unique files.
      13 files ignored.

github.com/AlDanial/cloc v 1.92  T=0.03 s (1668.0 files/s, 105414.7 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                               35            454            490           1565
C/C++ Header                    11             74            105            313
Assembly                         3              6             24             68
make                             1             11              0             54
-------------------------------------------------------------------------------
SUM:                            50            545            619           2000 << exactly 2000!
-------------------------------------------------------------------------------

Earth and Grass Operating System 2000

egos and egos-2000 are the teaching operating systems we use at Cornell. They have the same 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

Software Requirements

Usages and Documentation

For compiling and running egos-2000, please watch the tutorial video and read USAGES.md. This document further introduces the teaching plans, architecture and development history of egos-2000.

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 on a small RISC-V board

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

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