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.
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
- 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
beforemret
, which the D1 doesn't do. - Toggle
mstatus.MPRV
in timer_reset to allow requesting timer interrupts. - Enable
mcounteren.TM
to allow readingtime
csr in S-mode
- Mem paging
- User-level threading