QEMU target implementation for Oberon RISC architecture
This is to let you all know about a fork of QEMU (a very fast emulator with lots of features) introducing the Oberon RISC architecture. https://github.com/io-core/qemu-risc6 It is unfinished and I probably should have waited to announce it but the new year starts soon and I just want to share some pretty (to me) pictures. As it says in the readme on the github page, the target is named risc6 to avoid confusion with the already existing riscv target in qemu and because in one communication (An Update of the RISC5 Implementation <https://inf.ethz.ch/personal/wirth/ProjectOberon/RISC5.Update.pdf>) Professor Wirth defines module RISC6 to introduce interrupts into the architecture. I intend to update the readme with build instructions and binaries that can be simply downloaded, etc. Happy Hacking, Chuck
Thank you very much for sharing your work. It looks promising so far, congrats! On Fri, Dec 27, 2019, 17:37 Charles Perkins <chuck@kuracali.com> wrote:
This is to let you all know about a fork of QEMU (a very fast emulator with lots of features) introducing the Oberon RISC architecture.
https://github.com/io-core/qemu-risc6
It is unfinished and I probably should have waited to announce it but the new year starts soon and I just want to share some pretty (to me) pictures.
As it says in the readme on the github page, the target is named risc6 to avoid confusion with the already existing riscv target in qemu and because in one communication (An Update of the RISC5 Implementation <https://inf.ethz.ch/personal/wirth/ProjectOberon/RISC5.Update.pdf>) Professor Wirth defines module RISC6 to introduce interrupts into the architecture.
I intend to update the readme with build instructions and binaries that can be simply downloaded, etc.
Happy Hacking, Chuck -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Charles Nice. You must have changed some Oberon files like Fonts.Mod and Texts.Mod. Didn’t browse through all your qemu fork yet. Are your Oberon changes available somewhere? Jörg
Am 28.12.2019 um 02:37 schrieb Charles Perkins <chuck@kuracali.com>:
This is to let you all know about a fork of QEMU (a very fast emulator with lots of features) introducing the Oberon RISC architecture.
https://github.com/io-core/qemu-risc6
It is unfinished and I probably should have waited to announce it but the new year starts soon and I just want to share some pretty (to me) pictures.
As it says in the readme on the github page, the target is named risc6 to avoid confusion with the already existing riscv target in qemu and because in one communication (An Update of the RISC5 Implementation) Professor Wirth defines module RISC6 to introduce interrupts into the architecture.
I intend to update the readme with build instructions and binaries that can be simply downloaded, etc.
Happy Hacking, Chuck -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
I did add pcf font loading capability in Fonts.Mod but Michael Schierl did the work of adapting Oberon to handle Unicode and fonts with more than 128 characters in them. My changes and what I adopted from him and others can be found in projects under the Github organization https:/// github.com/io-core where I have taken the liberty of dividing the Project Oberon files into logical packages that could be versioned and developed separately and combined appropriately with package management tools. The division is notional, I don't have a finished tool yet, much yet an Oberon native one, though there is a prototype tool written in go in https://github.com/io-core/Mod that illustrates where I think we could go in having distributed Oberon package repositories with semantic versioning, checksums, etc. without making any changes to Oberon itself and with allowing divergent implementations of Oberon with common sub-features. So, to answer your question, the pcf font loding is found the Fonts.Mod file in https://io-core/Edit along with the rest of the text-specific code in Project Oberon. The fonts I have been using can be found in https://github.com/io-core/io/tree/master/core/fonts but that hasn't been made into a package yet. Packages? For Oberon? Sure! Each package in this model is located with the files in a directory (such as a github repo or whatever you like) and starts with a <package>.Pkg file. A .Pkg file is a simple text lines in a csv format like this, for the "outer core" of Oberon, which has some changes from the original Project Oberon files, which I arbitrarily set at Version 5.0.0, and which ''requires' at least the original versions of the Files, Modules, and Kernel packages (but minor version bumps are OK) but which requires at least version 5.1.0 of the Edit package as defined in io-core because it relies on Unicode changes introduced there, and provides four modules (Oberon.Mod, Input.Mod, Display.Mod, Viewers.Mod and MenuViewers.Mod, each checksummed for verification: Oberon.Pkg: k,v1,v2 package,Oberon,v5.1.0 from,github.com/io-core,whenever license,PROJECTOBERON,NW JG PDR MS CP r,[core]/Files,v5.0.0 r,[core]/Modules,v5.0.0 r,[io-core]/Edit,v5.1.0 r,[core]/Kernel,v5.0.0 p,Oberon.Mod,a427a83c7b04278a6d51ccef9a88c854656aeece870d9f8cb6bfe947400236d1 p,Input.Mod,c4add3b8d70c0ae4a77c972bb7ae7fc77e3169566cb2afb9cadeadee998a055f p,Display.Mod,4157ff39acbdc7dcfecab8903fb8a99386ec89c6247de09e224faf6d2e4f4657 p,Viewers.Mod,68dd972188ccca1b91c0f1e26204ce2cdec73098501c0fc15db334bbfab6ffe7 p,MenuViewers.Mod,3f49849f9103be0c466df69c1c73324137416a85bb27b993e943ae6e56c89f89 Once you have individual packages the natural next step is to create an index of them that can be queried and retrieved from and (if you have permission) updated. A simple text file suffices: Packages.Ndx: package,license,version,location Edit,PROJECTOBERON,v5.1.0, github.com/io-core/Edit Files,PROJECTOBERON,v5.0.20130815,github.com/io-core/Files Kernel,PROJECTOBERON,v5.0.20140204,github.com/io-core/Kernel Mod,MIT,v0.1.0,github.com/io-core/Mod Modules,PROJECTOBERON,v5.0.20190108,github.com/io-core/Modules Attest,MIT,v0.1.0,github.com/io-core/Attest Crypto,MIT,v0.1.0,github.com/io-core/Crypto Script,MIT,v0.1.0,github.com/io-core/Script Draw,PROJECTOBERON,v5.0.0,github.com/io-core/Draw System,PROJECTOBERON,v5.1.0,github.com/io-core/System Build,PROJECTOBERON,v5.0.0,github.com/io-core/Build Oberon,PROJECTOBERON,v5.1.0,github.com/io-core/Oberon Paint,PROJECTOBERON,v1.0.0,github.com/io-core/Paint My Packages.Ndx is found in https://github.com/io-core/Index/ and in my imagination other developers would publish their packages similarly, and perhaps a package ecosystem might build on this so that Oberon can have the equivalent of pypi or npm, etc. All of the above is just what I am using with my own files and there is no reason anyone else will want to adopt it other than I see a need for package management of some kind but attuned to the specific needs of the Oberon system, and the above is what I've come up with. Best Regards, Charles On Sat, Dec 28, 2019 at 12:37 AM Joerg <joerg.straube@iaeth.ch> wrote:
Hi Charles
Nice. You must have changed some Oberon files like Fonts.Mod and Texts.Mod. Didn’t browse through all your qemu fork yet. Are your Oberon changes available somewhere?
Jörg
Am 28.12.2019 um 02:37 schrieb Charles Perkins <chuck@kuracali.com>:
This is to let you all know about a fork of QEMU (a very fast emulator with lots of features) introducing the Oberon RISC architecture.
https://github.com/io-core/qemu-risc6
It is unfinished and I probably should have waited to announce it but the new year starts soon and I just want to share some pretty (to me) pictures.
As it says in the readme on the github page, the target is named risc6 to avoid confusion with the already existing riscv target in qemu and because in one communication (An Update of the RISC5 Implementation <https://inf.ethz.ch/personal/wirth/ProjectOberon/RISC5.Update.pdf>) Professor Wirth defines module RISC6 to introduce interrupts into the architecture.
I intend to update the readme with build instructions and binaries that can be simply downloaded, etc.
Happy Hacking, Chuck -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hello Joerg, Am 28.12.2019 um 09:37 schrieb Joerg:
You must have changed some Oberon files like Fonts.Mod and Texts.Mod. Didn’t browse through all your qemu fork yet. Are your Oberon changes available somewhere?
Your post reminded me to update my GitHub repo where I collect changes I did to Project Oberon over the years. The repo is available at <https://github.com/schierlm/Oberon2013Modifications> A disk image for oberon-risc-emu with the patches applied and compiled is available at <https://github.com/schierlm/Oberon2013Modifications/releases/tag/2019.12> And last but not least, an image for my JavaScript web emulator is available at <http://schierlm.github.io/OberonEmulator/emu.html?image=ModificationsDiskImage> Note that KeyTester does not work in the JavaScript emulator (you won't see any pressed keys) due to how keyboard emulation is done in the JavaScript emulator. In other emulators (and presumable on real hardware too), it works well. And the other modifications work well in the JavaScript emulator as well. Regards, Michael
Hi Chuck,
...the target is named risc6 to avoid confusion with the already existing riscv target in qemu and because in one communication (An Update of the RISC5 Implementation [1]) Professor Wirth defines module RISC6 to introduce interrupts into the architecture.
Sorry I think that's a mis-print since it's the only occurrence, I'm pretty sure the intention was to keep it as RISC5. Apologies for any confusion. As it happens most of the stuff for interrupts was there originally anyway before the update, especially in the compiler. The RISC5 source on Prof. Wirth's site definitely contains the interrupt code now. There's also a RISC5a version, without interrupts and without floating-point. Cheers, Paul
Hi You can ask the RISC processor to reveal its version with this code cpu := SYSTEM.H(2019) MOD 80H; IF cpu = 53H THEN (* RISC5: with interrupts + floating-point, 31.8.2018 *) ELSIF cpu = 54H THEN (* RISC5a: no interrupts, no floating-point, 1.9.2018*) ELSIF cpu = A0H THEN (* RISC0, 26.12.2013 *) END; br Jörg Am 30.12.19, 09:56 schrieb "Oberon im Auftrag von Paul Reed" <oberon-bounces@lists.inf.ethz.ch im Auftrag von paulreed@paddedcell.com>: Hi Chuck, > ...the target is named risc6 > to avoid confusion with the already existing riscv target in qemu and > because in one communication (An Update of the RISC5 Implementation > [1]) Professor Wirth defines module RISC6 to introduce interrupts into > the architecture. Sorry I think that's a mis-print since it's the only occurrence, I'm pretty sure the intention was to keep it as RISC5. Apologies for any confusion. As it happens most of the stuff for interrupts was there originally anyway before the update, especially in the compiler. The RISC5 source on Prof. Wirth's site definitely contains the interrupt code now. There's also a RISC5a version, without interrupts and without floating-point. Cheers, Paul -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi Paul and Jörg, Sometimes I am too clever for my own good. I thought I saw a way out of the name confusion. I'll make it clear that RISC5 is the correct name for the architecture. Also, I missed the CPU version bits in the emulator -- I will have to make sure the SYSTEM.H code works too... after I correct DIV for negative operands and finish floating point! Of course this is just another emulator and the Oberon community already has plenty of those but I wanted to work with just one emulation platform across several porting efforts, and QEMU is to me the obvious choice. And as a side benefit it seems quite fast, comparatively. Cheers, Chuck On Mon, Dec 30, 2019 at 1:43 AM Jörg <joerg.straube@iaeth.ch> wrote:
Hi
You can ask the RISC processor to reveal its version with this code
cpu := SYSTEM.H(2019) MOD 80H; IF cpu = 53H THEN (* RISC5: with interrupts + floating-point, 31.8.2018 *) ELSIF cpu = 54H THEN (* RISC5a: no interrupts, no floating-point, 1.9.2018*) ELSIF cpu = A0H THEN (* RISC0, 26.12.2013 *) END;
br Jörg
Am 30.12.19, 09:56 schrieb "Oberon im Auftrag von Paul Reed" < oberon-bounces@lists.inf.ethz.ch im Auftrag von paulreed@paddedcell.com>:
Hi Chuck,
> ...the target is named risc6 > to avoid confusion with the already existing riscv target in qemu and > because in one communication (An Update of the RISC5 Implementation > [1]) Professor Wirth defines module RISC6 to introduce interrupts into > the architecture.
Sorry I think that's a mis-print since it's the only occurrence, I'm pretty sure the intention was to keep it as RISC5. Apologies for any confusion.
As it happens most of the stuff for interrupts was there originally anyway before the update, especially in the compiler. The RISC5 source on Prof. Wirth's site definitely contains the interrupt code now. There's also a RISC5a version, without interrupts and without floating-point.
Cheers, Paul -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
Hi A remark on interrupts in ProjectOberon: The current implementation of interrupts looks to me a little bit like a quick and dirty hack or proof of concept. I don‘t find it user-friendly a programmer has to import SYSTEM and has to know the „magic“ address 4. Let me explain. Offering interrupts to the programmer needs three parts: - CPU support: instructions to enable/disable interrupts and return from interrupts. DONE. - Compiler support: PROCEDURE* is parsed and correct instructions are generated. DONE. - OS support: an easy to use API to use the interrupt in a program. MISSING. Of course I can provide an API myself. Eg: MODULE Interrupt; (* jr/31dec19 *) IMPORT SYSTEM, Kernel; PROCEDURE* Empty; END Empty; PROCEDURE Install*(handler: PROCEDURE); (* handler=NIL: deactivate interrupts *) VAR instr: INTEGER; BEGIN SYSTEM.LDPSR(0); Kernel.Install(SYSTEM.ADR(Empty), 4); SYSTEM.GET(SYSTEM.VAL, INTEGER, handler)+4, instr); IF instr = 0A0E00000H THEN (* valid interrupt handler *) Kernel.Install(SYSTEM.VAL(INTEGER, handler), 4); SYSTEM.LDPSR(1) END END Install; BEGIN Install(NIL) END Interrupt. For me something like the above should be part of the inner core (e.g. Kernel.Mod) or at least a module of the outer core to be provided with the standard distribution. With the above API, interrupts are easily consumable (no import of SYSTEM, all the nitty gritty details hidden in Interrupt.Mod) MODULE TestInt; IMPORT Interrupt; VAR led, cnt: INTEGER; PROCEDURE* Int; (*interrupt handler called every millisecond*) BEGIN INC(cnt); IF cnt = 500 THEN led := 3 - led; LED(led); cnt := 0 END END Int; PROCEDURE On*; BEGIN Interrupt.Install(Int) END On; PROCEDURE Off*; BEGIN Interrupt.Install(NIL) END Off; BEGIN led := 1; cnt := 0 END TestInt. br Jörg
Am 30.12.2019 um 16:12 schrieb Charles Perkins <chuck@kuracali.com>:
Hi Paul and Jörg,
Sometimes I am too clever for my own good. I thought I saw a way out of the name confusion. I'll make it clear that RISC5 is the correct name for the architecture. Also, I missed the CPU version bits in the emulator -- I will have to make sure the SYSTEM.H code works too... after I correct DIV for negative operands and finish floating point!
Of course this is just another emulator and the Oberon community already has plenty of those but I wanted to work with just one emulation platform across several porting efforts, and QEMU is to me the obvious choice. And as a side benefit it seems quite fast, comparatively.
Cheers, Chuck
On Mon, Dec 30, 2019 at 1:43 AM Jörg <joerg.straube@iaeth.ch> wrote: Hi
You can ask the RISC processor to reveal its version with this code
cpu := SYSTEM.H(2019) MOD 80H; IF cpu = 53H THEN (* RISC5: with interrupts + floating-point, 31.8.2018 *) ELSIF cpu = 54H THEN (* RISC5a: no interrupts, no floating-point, 1.9.2018*) ELSIF cpu = A0H THEN (* RISC0, 26.12.2013 *) END;
br Jörg
Am 30.12.19, 09:56 schrieb "Oberon im Auftrag von Paul Reed" <oberon-bounces@lists.inf.ethz.ch im Auftrag von paulreed@paddedcell.com>:
Hi Chuck,
> ...the target is named risc6 > to avoid confusion with the already existing riscv target in qemu and > because in one communication (An Update of the RISC5 Implementation > [1]) Professor Wirth defines module RISC6 to introduce interrupts into > the architecture.
Sorry I think that's a mis-print since it's the only occurrence, I'm pretty sure the intention was to keep it as RISC5. Apologies for any confusion.
As it happens most of the stuff for interrupts was there originally anyway before the update, especially in the compiler. The RISC5 source on Prof. Wirth's site definitely contains the interrupt code now. There's also a RISC5a version, without interrupts and without floating-point.
Cheers, Paul -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
-- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On 12/30/19 9:11 AM, Charles Perkins wrote:
Sometimes I am too clever for my own good. I thought I saw a way out of the name confusion. I'll make it clear that RISC5 is the correct name for the architecture.
In my personal notes, I've sometimes referred to it as RISC-W. -- Colby Russell
Joerg: saying "RISC processor" do you mean the NW firmware pulled off his website? I am looking at it right now. I do not see "2019" in the Verilog code. How can the real firmware processor respond to the "get version request" which you are describing? It is pretty essential to know the firmware revision, but I do not see it coded verbatim in the actual firmware.
You can ask the RISC processor to reveal its version with this code
cpu := SYSTEM.H(2019) MOD 80H; IF cpu = 53H THEN (* RISC5: with interrupts + floating-point, 31.8.2018 *) ELSIF cpu = 54H THEN (* RISC5a: no interrupts, no floating-point, 1.9.2018*) ELSIF cpu = A0H THEN (* RISC0, 26.12.2013 *) END; W.
Wojtek, Am 30.12.2019 um 21:11 schrieb Skulski, Wojciech:
saying "RISC processor" do you mean the NW firmware pulled off his website? I am looking at it right now. I do not see "2019" in the Verilog code. How can the real firmware processor respond to the "get version request" which you are describing? It is pretty essential to know the firmware revision, but I do not see it coded verbatim in the actual firmware.
The compiler function SYSTEM.H only uses the last bit of its operand, therefore SYSTEM.H(2019) is the same as SYSTEM.H(1). https://github.com/Spirit-of-Oberon/wirth-personal/blob/master/people.inf.et... SYSTEM.H(0) will create a MOV instruction that loads the remainder from the last division, and SYSTEM.H(1) will create a MOV instruction that loads the flag register. Both are implemented in this line of Verilog: https://github.com/Spirit-of-Oberon/wirth-personal/blob/master/people.inf.et... (~u ? C0 : (~v ? H : {N, Z, C, OV, 20'b0, 8'h53}))) : As you can see, the flag register ends with hexadecimal 53. You can put anything else in the flag register if you want your processor to be identified differently. Regards, Michael
participants (8)
-
Charles Perkins -
Colby Russell -
Joerg -
Jörg -
Luca Boasso -
Michael Schierl -
Paul Reed -
Skulski, Wojciech