Project Oberon 2013 on RISC-V
github.com
github.com
this port of Niklaus Wirth's Project Oberon (http://www.projectoberon.com) to RISC-V (rv32im) is the semester project of my student Rikke Solbjørg at the department of computer science at NTNU in Trondheim/Norway.
The system currently runs in a version of Peter de Wachter's emulator modified to use a RISC-V CPU emulation instead of Wirth's RISC5 (now isn't that confusing? ;-)).
Rikke's announcement on the Oberon mailing list: http://lists.inf.ethz.ch/pipermail/oberon/2020/015269.html
To answer the obvious question right away: yes, we are working on a FPGA implementation :-). Happy to answer your other questions...
Any thoughts about pursuing similar endeavours with System 3?
System 3 is closer to modern systems in L&F, which could make some students feel more inspired to delve into Oberon based platforms.
Just as an idea for other upcoming projects, I guess.
I'm currently digging through the 1992/2005 edition of the Project Oberon book (for the National Semiconductor 32k-based Ceres workstations from ETHZ - https://people.inf.ethz.ch/wirth/ProjectOberon1992.pdf). The Ceres Oberon version had a number of additional features, e.g. it could use the MMU for memory protection, which the RISC5 version doesn't support.
Some details on the port and the binary size differences can be found in the project report: https://github.com/solbjorg/oberon-riscv/blob/master/report....
From a CPU-in-FPGA perspective, it could be used for e.g. L1 cache. Actual RAM can be slower and external to the FPGA chip.
The ULX3S (which can support the minimig Amiga implementation) and the DE10-Nano (miSTer's base board) would make overkill targets for this.
Unfortunately, FPGA boards with 32 bit wide SRAM are really hard to find nowadays, especially those supported by SymbiFlow...
They also have a version for ARM Cortex-M controllers: https://www.astrobe.com/Oberon.htm
Here's a two minute video showing these build scripts running twice in a modified Norebo environment and producing identical disk images. The notable thing is that the first time it runs, it's actually running in a web browser―fully in a web browser, not shelling out to some cloud provider.
EDIT: Sorry about forgetting the video link. It's here: https://www.youtube.com/watch?v=TUpd70Mu0Ek
I'm familiar with Oberon and have contributed to Peter De Wachter's Norebo bootstrapping scripts. I wrote a recent comment in another thread about the use of "applicative literature" in pedagogy. <https://news.ycombinator.com/item?id=25490826> Rikke's README for this project—and many other projects related to Oberon—end up describing processes in natural language, with steps to be performed manually, e.g. to change the bootloader. This is not special to Oberon, though. The gist of my argument is that pretty much every student and professor already has a suitable environment for handling process documents that could be adapted to be also executable by a machine. Do you have any thoughts about this? Do you have any experience trying to work with anything that follows Knuth's "literate programming" paradigm (including difficulties you've encountered)?
Anyway, nice work by you and your students. Wirth's RISC machine has a simplicity that others don't, which makes it good for teaching, but it makes some pragmatic choices that make it more realistic than similar attempts that result in toy computers that are a little too toy-like. It's work like this that makes for a decent transition after going from not knowing anything about a computer to hands-on understanding using a practical fantasy system like Wirth's to a full-on "industry-approved" instruction set RISC-V.
While not as elaborate as Knuth's WEB system, I liked the approach used by Douglas Comer in his Xinu OS books (my first OS textbook) very much. Comer's integration of explaining text sections and related code is not as tight as some of the commonly mentioned literate programming examples, but IMHO it still helps a lot to understand the system structure and the dependencies of the piece of code discusses with other parts of the system.
What is great about the Comer books is that - like Oberon - they also cover more than just the OS. In the original version of the Xinu book, there was an extensive explanation of the PDP11 the system was developed on, though not on a sufficient level of detail to actually build a PDP11. While Comer doesn't include a compiler or GUI in Xinu, he extends the system in another useful direction with Xinu-based Ethernet and TCP/IP support in a second volume. The Project Oberon book includes a short chapter on networking, but this is a point where the "not-invented-here" paradigm that helps to keep the Oberon system so simple and elegant seems to break down, as real-world interfacing is essential today. The difference in complexity between the homebrew approach and TCP/IP is easy to see, however. Networking is covered in a single chapter (IIRC) in the Project Oberon book, whereas it took Comer a whole book volume to describe his TCP/IP implementation (admittedly, also including the description of a number of network protocols on top of TCP/IP).
I know that it and A2 are more complex than Oberon, but a riscV version of those would be awesome, particularly the concept of managed memory without GC.
I am hoping to be able to work on a more “native” UX for it for MacOS rather than the xorg/X11 based one.
There’s ARM support already too but I don’t think M1 works in any sense yet, so I guess I’ll have to use Bonjour2 for now.
Fun stuff!
I've been working on this project for the last few months. I'm glad you find it interesting!
I won't reiterate what my advisor has already said, but like mentioned in the README of the linked repository, if you just want to try it, you can clone the emulator here, which includes a RISC-V image: https://github.com/solbjorg/oberon-riscv-emu
The port should also be quite easy to hack on, if you so wish. :) I'm happy to answer any questions as well.
But one of the most important use cases for Oberon is probably software development - so one of the most important tools that is included with the system is the compiler.
As far as I know it's also the only system currently in existence that fullfills that promise.
We arguably spend too much time teaching our students how to work with complex commercial systems (or nowadays also complex open source systems such as Linux) and should try to rely more on self-developed software which can be understood, adapted and improved in a reasonable amount of time. I'm trying to revive some of that spirit in my courses and projects.
Maybe Oberon errs a bit too much on the side of simplicity. I don't think it's very problematic that the compiler doesn't implement sophisticated optimizations, but the OS part of Project Oberon does not implement memory protection (the older Ceres-based system did to some extent) or preemptive multitasking. This is appropriate considering the system's age and the constraints of the FPGA for the original RISC5 system, but due to this the OS part of Oberon is on a similar level as non-NT Windows and classic MacOS. Accordingly, it's not a very useful example design today IMHO. Other systems such as xv6 might be more appropriate here, but xv6 was never designed to be used as a desktop os for real-world use.
One problem that also affects other bare-metal systems such as Lukas Hartmann's Interim OS (http://interim-os.com) or my Smalltalk-80 port (https://multicores.org/blog/smalltalk-on-a-small-computer.ht...) for the Raspberry Pi, is handling the complexity of modern peripheral and communication protocols.
Some of the worst "offenders" here are USB and Bluetooth, both of which require driver and protocol stack code that often has more lines of code and is more complex than the rest of the system. Ethernet and TCP/IP might be a bit more manageable, Adam Dunkels' uIP/lwIP are a good example.
So, as always in system design, the art is to find the right tradeoffs. Exploring the design space here is interesting, especially within the constraints of a real-world ISA as a basis. And I think projects involving small operating systems and RISC V are lots of fun (I hope Rikke agrees ;-) - we also have students working on Plan9 and Inferno ports to RISC-V) in addition to be educationally worthwhile - IMHO an important point to keep students motivated.
I think we should probably all re-read Prof. Wirths "A Plea for Lean Software" (https://cr.yp.to/bib/1995/wirth.pdf) once in a while, but also consider how to apply the principles of this paper carefully instead of going for absolute minimalism. I hope that something along these lines will be a valuable learning outcome for the students working on my projects and attending my courses..
I expect the same to happen to Linux when those of us that grew up with it, Linus and his gang are all gone.
Whoever comes next will just drive it into something else.
You already see this with the uprising of MIT licensed POSIX clones for IoT devices, or most userspace innovations being driven by a single company.
Regarding ETHZ, at least Active Oberon seems to still be being worked on
It is a complete single user graphical workstation OS, written in a GC enabled systems programming language.
Niklaus Wirth got his inspiration out of Mesa/Cedar during his second sabbatical at Xerox PARC (during his first one he ended up creating Modula-2 inspired by Mesa).
You can see what Mesa/Cedar was capable of by checking this videos,
"Eric Bier Demonstrates Cedar"
https://www.youtube.com/watch?v=z_dt7NG38V4
The original Oberon system was a simplified version of it in more affordable hardware, then from its roots, a series of other variants were born, Oberon-2, Active Oberon, V4, System 3, Component Pascal, Zonnon, are the most well known. Eventually Niklaus Wirth decided to go back and see how much he could remove from original Oberon and still have it be a systems programming language with GC, thus Oberon-07 was born, with a couple of revisions, the latest one from 2016.
Going back to the original one, this is what you got in the package:
- A full stack single user graphical workstation, in a GC enabled systems programming language
- The only kind of application are modules, loaded dynamically
- Applications are just modules that register themselves into the system to be available on the REPL or in menus when loaded, e.g. Module.Command will load Module and call the procedure named Command, which can then be fed data from the REPL, mouse selection or selected application window
- This brings dynamism similar to Smalltalk and Lisp machines where you get access to whole OS and each application is extensible
At a given point during the 90's the ETHZ IT department had plenty of people using Oberon based workstations.
For a couple of screenshots about Oberon System 3 and Active Oberon, with links about Xerox PARC related stuff have a look at https://www.progtools.org/article.php?name=oberon§ion=co...
System 3
https://www.progtools.org/compilers/tutorials/oberon/oberon-...
Amiga Workbench 3.0
https://www.gregdonner.org/workbench/wb_30.html
However I do get your point.
https://en.wikipedia.org/wiki/Common_Object_Request_Broker_A...
Yes, those ideas are similar to ToonTalk (on Sun), CORBA, COM/DCOM/OLE, DBus,... just done in a more easier and approachable way.
I also happened to be the only PC dude among a circle of Amiga owning friends, so I know it relativity well.
Amiga had lots of good stuff, including a similar feature, and the ability to script whole applications via ARexx.
I advise a reading of https://datagubbe.se/ltmag/
I got to see an Amiga in action when I visited a friend who lived in England. It was soooooo awesome.
(I had to cut my teeth on an IBM PCjr.)