An educational software system of a tiny self-compiling C compiler, a tiny self-executing RISC-V emulator, and a tiny self-hosting RISC-V hypervisor. Selfie is a project of the Computational Systems Group at the Department of Computer Sciences of the University of Salzburg in Austria. The Selfie Project provides an educational platform for teaching undergraduate and graduate students the design and implementation of programming languages and runtime systems. The focus is on the construction of compilers, libraries, operating systems, and even virtual machine monitors. The common theme is to identify and resolve self-reference in systems code which is seen as the key challenge when teaching systems engineering, hence the name. Selfie is implemented in a single (!) file and kept minimal for simplicity. There is also a simple in-memory linker, a RISC-U disassembler, a garbage collector, L1 instruction and data caches, a profiler, and a debugger with replay.
Features
- Selfie generates ELF binaries that run on real RISC-V hardware
- Selfie is designed as 64-bit system and requires as such a 64-bit system to run (LP64 data model)
- Selfie also compiles on systems that support compiling and executing 32-bit binaries
- Selfie becomes a 32-bit system that generates and executes 32-bit binaries out-of-the-box
- Selfie is a self-contained 64-bit, 11-KLOC C implementation of a self-compiling compiler called starc
- The common theme is to identify and resolve self-reference in systems code