This is a version of theProject Oberon Systemmigrated
from Oberon 07 to the more common Oberon 90, using a recent version of theOP2 compilerwith a RISC-V (RV32) backend;
the repository also includes an emulation of a machine (VM) very similar to the one described by Wirth in hisProject Oberon Book,
based on the well-knownRV32 emulator;
the latter is a stripped-down and slightly modified version with only the interpreter,
combined with my own implementation of the machine and the peripherals;
the memory map of Wirth’s machine is reproduced 1:1 so that Kernel.Mod, Display.Mod and
Input.Mod are unchanged.
Here is a screenshot of the system running natively on the RISC-V VM:
Wirth continued this journey after his retirement. The sources published onprojectoberon.netare written inOberon-07, which is Wirth’s last and most radical simplification of the language.
There is also a free 2013 revision of the Project Oberon book available.
The declared purpose of the 2013 project is unchanged from 1992:to provide a single book that serves as an example of a system that exists, is in actual use, and is explained in all detail.
The 1992 book and project used theNational Semiconductor NS32032processor, which “is now neither available nor is its architecture recommendable”.
Instead of retargeting the compiler to some other commercial architecture, Wirth decided to design his own processor,
which he calledRISC-5,
“in order to extend the desire for simplicity and regularity to the hardware”.
He even implemented it with a programmable gate array (FPGA) and turned his design into
“a real, functioning processor on a single chip”. The whole system runs on a low-cost development board (Xilinx Spartan-3 by
Digilent, with 1 MB of static RAM) that “easily accommodates the entire Oberon System, including its compiler”.
So for the first time not only the software but also the hardware of the Oberon System is described completely
and rigorously. The hardware modules are implemented inVerilog, also available on projectoberon.net.
Thanks to the simplifications of language and processor, all parts that in 1992 had been written in assembly code (and
were not in the book) are now expressed in Oberon as well, from device drivers to raster operations. Wirth based his
new system directly on the original Ceres version, discarding the features of the later Oberon lines.
“It has been my desire to present the system essentially as it existed 25 years ago, without embellishments”.
The result is a small and sufficiently complete system which is well documented and easy to migrate to other architectures.
The entire hardware/software contract of Project Oberon consists of a memory map plus the instruction set.
Migrating the Project Oberon System from RISC-5 to RISC-V is a pragmatic way to bring the system to widely available contemporary hardware
while preserving the principles that make Oberon valuable. Espressif offers inexpensive, readily available microcontrollers in several ESP32 families,
and board makers such as Olimex build practical development boards around them, for example the ESP32-P4-PC which provides all resources needed
by the Oberon System at a very attractive price.
Since the Oberon system does not require an MMU, it is well-suited for this type of microcontroller.
So far, this migration runs on an emulated RISC-V machine, which helps both debugging and keeping the code close to the book.
Future iterations will migrate this (and also System 3) to the mentioned Olimex board.
Wirth’s own compiler (OR) targets his RISC-5 architecture and compiles Oberon-07.
I could have added an RV32 back end to it; instead, this project reuses the OP2 compiler
which I already used for themigration of Oberon System 3 to the Raspberry Pi.
OP2 is itself part of the ETH Oberon heritage; its front end/back end separation was designed exactly for this:
the same front end has produced code for SPARC, MIPS, i386, and recently ARMv7 and RV32.My OP2 modifications, the ARMv7 backend and boot linker have proven themselves in the System 3 migration.
Extending OR would have meant maintaining another compiler. Migrating the system to the 1990 language
keeps one compiler for both migrated systems, and the source code is still close enough to the book to keep it useful.
The original version of the Project Oberon source code was downloaded fromhttps://www.projectoberon.net/on 2026-04-14.
I particularly downloaded the following archives:
The latest file modification date is 2018-11-28. Each subdirectory of this repository
corresponds to the archive of the same name, besides apptools and systools which
have been merged in files.
Migrated all Oberon-07 sources to Oberon 90 so that they compile with the
ActiveOberon project o2c compiler and OP2. Some notes:
Implemented a RISC-V machine based on rv32emu similar to Wirth’s RISC-5 described in PO book
and made the necessary (minimal) changes to the Oberon code to run it.