cheofusi / egos-2000-d1

Port of the egos-2000 teaching operating system to Allwinner's D1 chip

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

This is a port of the awesome egos-2000 teaching operating system to Allwinner's D1 chip, using Sipeed's Lichee RV compute module.

There is no attempt at staying under 2K lines of code. Most of the chip dependent sources were gotten from FlatHeadBro's D1 baremetal programs (to whom I am immensely grateful) and given a facelift.

The port either runs in M-mode, or M+S+U with Page Tables.

Usages and Documentation

For compiling and running egos-2000-d1, please read this document. The RISC-V instruction set manual, C906 processor manual and D1 chip manual introduce the privileged ISA and memory map. egos.h details the memory layout

Major Changes

  • New memory layout in egos.h and linker scripts
  • New disk layout in disk.h
  • fence.i required after a context switch when running in M-mode only.
  • D1 C906 Sv39 paging
  • trap_entry_vm rewrite to allow for clearing mstatus.MPRV before mret, which the D1 doesn't do.
  • Toggle mstatus.MPRV in timer_reset to allow requesting timer interrupts.
  • Enable mcounteren.TM to allow reading time csr in S-mode

TODO

  • Mem paging
  • User-level threading

About

Port of the egos-2000 teaching operating system to Allwinner's D1 chip

License:MIT License


Languages

Language:C 96.9%Language:Assembly 1.8%Language:Makefile 1.3%