Skip to content

Commit

Permalink
Extended-Oberon-1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaspirklbauer committed Aug 31, 2022
1 parent 5efd80e commit 3678fd2
Show file tree
Hide file tree
Showing 100 changed files with 1,229 additions and 536 deletions.
Binary file modified Documentation/S3RISCinstall.tar.gz
Binary file not shown.
23 changes: 22 additions & 1 deletion EOS_news.txt
Expand Up @@ -29,11 +29,32 @@
2020-10-24 Oberon, System - Oberon.Batch (but not System.Batch) invokes the garbage collector after each executed command
2020-11-01 ORG, ORB - Restrict the type case statement such that type loopholes are no longer possible
2020-11-12 ORP - Allow elements of a structure as numeric case expressions in all cases
2020-12-01 ORL - Don't provide a hint to the bootloader for Kernel.MemLim and Kernel.stackOrg anymore
2020-12-01 ORL - No longer provide a hint to the bootloader for Kernel.MemLim and Kernel.stackOrg
2020-12-02 Disk - Enlarge boot area from sectors 2-63 (62KB) to sectors 2-159 (158KB) to accomodate entire pre-linked Oberon systems
2020-12-12 Modules - Add procedure Modules.SetFinalizer to set a module finalization sequence to be executed prior to unloading
2020-12-30 TextFrames - TextFrames.Copy now produces an exact copy of the text frame, including vertical offset from baseline
2020-12-31 Modules, ORS, ORG, ORP, ORL, ORX, ORTool, Oberon0 - Add module finalization as a language construct (symbol FINAL)
2021-01-24 ORTool - Decode FLR, FLT, RTI, STI, CLI instructions
2021-04-12 In, Out - In added, Out updated
2021-06-11 ORB - Allow hidden re-imports to coexist with declarations of identifiers or module aliases with the same name
2021-10-01 ORTool - Improve output of ORTool.DecSym, type hierarchy now displayed over multiple lines
2021-10-01 ORG - Introduce a new field x.obj into ORG.Item, used to distinguish between numeric and type case statements
2021-10-01 ORP - Eliminate a number of restrictions in the type case statement, as suggested by C. Burrows
2021-11-01 ORG, ORP - No longer avoid forward branches in nested procedures, removal of this optimization makes the compiler simpler
2022-01-01 Disk - Enlarge boot area from sectors 2-159 (158KB) to sectors 2-191 (190KB) to accommate larger pre-linked Oberon systems
2022-01-01 ORL, Oberon0 - clear unused part of boot area during system building (identical builds will result in identical images)
2022-01-11 Oberon, System - Move procedures Trap, Abort and Deferred from System to Oberon
2022-05-01 Modules, ORL - Renamed fields data and code to var and prg in module descriptors
2022-05-22 ORB, ORTool - Streamlined symbol files by removing unnecessary fixup code in procedures Import and Export
2022-06-15 ORB - Set mod.rdo in ORB.ThisModule, simplify ORB.thisimport by using the fact that ORB.thisObj skips over re-imports
2022-06-21 ORB - Correct ORB.Import for case where module M1 defines M1.T1 to be an alias type of M0.T0 and a client imports both M0 and M1
2022-06-21 ORB - Use Files.WriteNum and Files.ReadNum for real constants
2022-07-01 ORP - ORP.Method now checks whether a redefined method is called from the overriding method and whether the receivers are the same
2022-07-22 ORB - Eliminate the invalid import order restriction (allow explicit import of a module after types from it have previously been re-imported)
2022-08-01 ORB - Re-introduce fix in ORB.InType (variable 'last') to handle cyclic references correctly
2022-08-07 ORB - Write name and key of a re-imported module before instead of after the type description in the symbol file
2022-08-11 ORB - Also detect a conflict with a module alias if a previously re-imported module is later explicitly imported
2022-08-15 ORB - Minimize the number of searches through the module list in ORB.ThisModule
2022-08-15 MenuViewers - Eliminate flickering when continuously modifying viewers in MenuViewers.Modify'
2022-08-28 Oberon - Skip over line feeds in Oberon.Skip, allowing regular .txt files as input for Oberon.Batch
2022-08-31 ORB - detect bad keys among multiple imports or re-imports of the same module at compile time instead of only at module load time
135 changes: 5 additions & 130 deletions README.md
Expand Up @@ -5,18 +5,18 @@ Note: In this repository, the term "Project Oberon 2013" refers to a re-implemen

Features

* Programming language Oberon-2 (2020 Edition), implementing a superset of Oberon-07
* Programming language Oberon-2 (2020 Edition) defined as a superset of the Oberon-07 language
* Safe module unloading and module finalization
* System building and maintenance tools
* Smooth line scrolling with variable line spaces
* Multiple logical displays
* Improved decoder tools
* Import any number of modules
* Improved import/export, e.g. import any number of modules and in any order
* Simple batch execution facility

**Last release:** 11.6.2021
**Last release:** 1.9.2022 / Extended-Oberon-1.7

**Last update:** 11.6.2021
**Last update:** 1.9.2022

The file [**S3RISCinstall.tar.gz**](Documentation/S3RISCinstall.tar.gz) always reflects the *latest* version of Extended Oberon, as described in the file [**EOS_news.txt**](EOS_news.txt).

Expand All @@ -26,130 +26,5 @@ Documentation: [**Documentation**](Documentation)

# Instructions for converting an existing Project Oberon 2013 system to Extended Oberon

**PREREQUISITES**: A current version of the Project Oberon 2013 system (see http://www.projectoberon.com).
If you run Oberon in an emulator on the desktop (e.g., http://github.com/pdewacht/oberon-risc-emu), you can simply backup your existing S3RISCinstall directory, download the compressed archive [**S3RISCinstall.tar.gz**](Documentation/S3RISCinstall.tar.gz) from this repository (containing Extended Oberon) to your emulator directory, run the command *tar xvzf S3RISCinstall.tar.gz* in that directory and then restart the emulator.

**NOTE**: If you run Oberon in an emulator on the desktop (e.g., http://github.com/pdewacht/oberon-risc-emu), you can simply backup your existing S3RISCinstall directory, download the compressed archive [**S3RISCinstall.tar.gz**](Documentation/S3RISCinstall.tar.gz) from this repository (containing Extended Oberon) to your emulator directory, run the command *tar xvzf S3RISCinstall.tar.gz* in that directory and then restart the emulator, instead of going through the instructions outlined below.

------------------------------------------------------

**STEP 1**: Build a slightly modified Project Oberon 2013 compiler on your Project Oberon 2013 system

Edit the file *ORG.Mod* on your original system and set the following constants to the indicated new values:

CONST ...
maxCode = 8800; maxStrx = 3200; ...

Then recompile your Project Oberon 2013 compiler (and unload the old one):

ORP.Compile ORS.Mod/s ORB.Mod/s ~
ORP.Compile ORG.Mod/s ORP.Mod/s ~
System.Free ORP ORG ORB ORS ~

This step is (unfortunately) necessary since the original Oberon-07 compiler has a tick too restrictive constants. To compile Extended Oberon, one needs slightly more space (in the compiler) for both *code* and *string constants*.

------------------------------------------------------

**STEP 2**: Build a slightly modified version of module Oberon on your Project Oberon 2013 system

Edit the file *Oberon.Mod* on your original system and add the following line anywhere in the source text

PROCEDURE Return*(n: INTEGER); BEGIN END Return;

Then recompile the following modules on your original system:

ORP.Compile Oberon.Mod/s ~
ORP.Compile MenuViewers.Mod/s TextFrames.Mod/s ~
ORP.Compile System.Mod/s Edit.Mod/s ~
ORP.Compile Tools.Mod/s PCLink1.Mod/s ~

Then re-compile the Oberon compiler again(!) before (!) restarting the system:

ORP.Compile ORS.Mod/s ORB.Mod/s ~
ORP.Compile ORG.Mod/s ORP.Mod/s ~
ORP.Compile ORL.Mod/s ORX.Mod/s ORTool.Mod/s ~

------------------------------------------------------

**STEP 3:** Restart the Oberon system

You are now running a slightly modified version of your your original Project Oberon 2013 system.

------------------------------------------------------

**STEP 4**: Download and import the Extended Oberon files to your (slightly modified) Project Oberon 2013 system

Download all files from the [**Sources**](Sources/) directory of this repository. Convert the *source* files to Oberon format (Oberon uses CR as line endings) using the command [**dos2oberon**](dos2oberon), also available in this repository (example shown for Linux or MacOS):

for x in *.Mod *.Tool ; do ./dos2oberon $x $x ; done

Import the files to your Oberon system. If you use an emulator, click on the *PCLink1.Run* link in the *System.Tool* viewer, copy the files to the emulator directory, and execute the following command on the command shell of your host system:

cd oberon-risc-emu
for x in *.Mod *.Tool *.Scn.Fnt ; do ./pcreceive.sh $x ; sleep 0.5 ; done

Open the Extended Oberon version of the [**System.Tool**](Sources/System.Tool) viewer in the system track of your Project Oberon 2013 system, so that you can directly activate the compilations needed to build Extended Oberon:

System.Open System.Tool

If you just follow the compilation sequence shown in *System.Tool*, you should be done with the remaining steps in a few seconds!

------------------------------------------------------

**STEP 5:** Build a cross-development toolchain by compiling the "new" compiler and boot linker/loader on the "old" system

ORP.Compile ORS.Mod/s ORB.Mod/s ~
ORP.Compile ORG.Mod/s ORP.Mod/s ~

Temporarily compile module *Disk* with the "old" compiler on the "old" system, so it can be used by the cross-linker *ORL* (this works, because module *Disk* is written such that it can be compiled under both Project Oberon 2013 and Extended Oberon). Note that module *Disk* will later be recompiled again with the "new" compiler (for execution in Extended Oberon).

ORP.Compile Disk.Mod/s ~

Compile the remaining modules of the cross-development toolchain (where *ORL* uses a temporary version of *Disk*):

ORP.Compile ORL.Mod/s ORX.Mod/s ORTool.Mod/s ~
System.Free ORTool ORP ORG ORB ORS ORL ORX ~

------------------------------------------------------

**STEP 6:** Use the cross-development toolchain on your Project Oberon 2013 system to build Extended Oberon

First, load the temporary version of ORL (using module *Disk* compiled for the "old" system):

ORL.Link nonexistingmodulename ~ # load the "old" version of module Disk into memory, so module Disk can be safely re-compiled below

This step is absolutely necessary! Otherwise the next command below (*ORP.Compile Kernel.Mod/s Disk.Mod/s ...*) would create a "new" version of module *Disk* (i.e. a version that is compiled for Extended Oberon), before the command *ORL.Link* gets a chance to load the "old" version into memory.

Compile the *inner core* of Extended Oberon and load it onto the boot area of the local disk:

ORP.Compile Kernel.Mod/s Disk.Mod/s FileDir.Mod/s Files.Mod/s Modules.Mod/s ~ # modules for the "regular" boot file for Extended Oberon
ORL.Link Modules ~ # generate a pre-linked binary file of the "regular" boot file (Modules.bin)
ORL.Load Modules.bin ~ # load the "regular" boot file onto the boot area of the local disk

This step is possible, because module *ORL* is written such that it can be executed on both the Project Oberon 2013 and the Extended Oberon system. It produces output using the Extended Oberon module and object file format.

Release the temporary versions of modules *ORL* and *Disk* (compiled for the "old" system), as they are no longer needed:

System.Free ORL Disk ~

Compile the remaining modules of Extended Oberon:

ORP.Compile Input.Mod/s Display.Mod/s Viewers.Mod/s ~
ORP.Compile Fonts.Mod/s Texts.Mod/s Oberon.Mod/s ~
ORP.Compile MenuViewers.Mod/s TextFrames.Mod/s ~
ORP.Compile System.Mod/s Edit.Mod/s Tools.Mod/s ~

------------------------------------------------------

**STEP 7:** Re-compile the Oberon compiler itself before (!) restarting the system:

ORP.Compile ORS.Mod/s ORB.Mod/s ~
ORP.Compile ORG.Mod/s ORP.Mod/s ~
ORP.Compile ORL.Mod/s ORX.Mod/s ORTool.Mod/s ~

This step is necessary because Extended Oberon uses a different Oberon object file format (the currently loaded Extended Oberon compiler runs under Project Oberon 2013, but wouldn't be able to run under Extended Oberon).

------------------------------------------------------

**STEP 8:** Restart the Oberon system

You are now running Extended Oberon. Re-compile any other modules that you may have on your system.
6 changes: 3 additions & 3 deletions Sources/Disk.Mod
@@ -1,4 +1,4 @@
MODULE Disk; (*NW/PR 11.4.86 / 27.12.95 / 4.2.2014 / AP 12.12.20 Extended Oberon*)
MODULE Disk; (*NW/PR 11.4.86 / 27.12.95 / 4.2.2014 / AP 1.1.22 Extended Oberon*)
IMPORT SYSTEM;
CONST SectorLength* = 1024;
spiData = -48; spiCtrl = -44;
Expand Down Expand Up @@ -77,8 +77,8 @@ MODULE Disk; (*NW/PR 11.4.86 / 27.12.95 / 4.2.2014 / AP 12.12.20 Extended Ober
PROCEDURE InitSecMap*;
VAR i: INTEGER;
BEGIN NofSectors := 0;
FOR i := 0 TO 4 DO sectorMap[i] := {0 .. 31} END ; (*mark blocks 0-159 (=5*32 = 160 blocks) as allocated*)
FOR i := 5 TO mapsize DIV 32 - 1 DO sectorMap[i] := {} END (*mark blocks 160-65536 (=64K-160 blocks) as unallocated*)
FOR i := 0 TO 5 DO sectorMap[i] := {0 .. 31} END ; (*mark blocks 0-191 (=6*32 = 192 blocks) as allocated*)
FOR i := 6 TO mapsize DIV 32 - 1 DO sectorMap[i] := {} END (*mark blocks 192-65536 (=64K-192 blocks) as unallocated*)
END InitSecMap;

PROCEDURE MarkSector*(sec: INTEGER);
Expand Down
18 changes: 9 additions & 9 deletions Sources/MenuViewers.Mod
@@ -1,21 +1,21 @@
MODULE MenuViewers; (*JG 26.8.90 / 16.9.93 / NW 10.3.13 / AP 12.2.20 Extended Oberon*)
MODULE MenuViewers; (*JG 26.8.90 / 16.9.93 / NW 10.3.13 / AP 15.8.22 Extended Oberon*)
IMPORT Input, Display, Viewers, Oberon;

TYPE Viewer* = POINTER TO ViewerDesc;
ViewerDesc* = RECORD (Viewers.ViewerDesc) menuH*: INTEGER END;

PROCEDURE Draw (V: Viewer; Y, H, col: INTEGER);
PROCEDURE Draw (V: Viewer; Y, H: INTEGER);
BEGIN
Display.ReplConst(col, V.X, Y, 1, H, Display.replace);
Display.ReplConst(col, V.X + V.W - 1, Y, 1, H, Display.replace);
Display.ReplConst(col, V.X + 1, Y, V.W - 2, 1, Display.replace);
Display.ReplConst(col, V.X + 1, Y + H - 1, V.W - 2, 1, Display.replace)
Display.ReplConst(Display.white, V.X, Y, 1, H, Display.replace);
Display.ReplConst(Display.white, V.X + V.W - 1, Y, 1, H, Display.replace);
Display.ReplConst(Display.white, V.X + 1, Y, V.W - 2, 1, Display.replace);
Display.ReplConst(Display.white, V.X + 1, Y + H - 1, V.W - 2, 1, Display.replace)
END Draw;

PROCEDURE Restore (V: Viewer);
VAR Menu, Main: Display.Frame;
BEGIN Menu := V.dsc; Main := V.dsc.next;
Oberon.RemoveMarks(V.X, V.Y, V.W, V.H); Draw(V, V.Y, V.H, Display.white);
Oberon.RemoveMarks(V.X, V.Y, V.W, V.H); Draw(V, V.Y, V.H);
IF V.H > V.menuH + 1 THEN
Main.X := V.X + 1; Main.Y := V.Y + 1; Main.W := V.W - 2; Main.H := V.H - V.menuH - 1;
Menu.X := V.X + 1; Menu.Y := V.Y + V.H - V.menuH; Menu.W := V.W - 2; Menu.H := V.menuH - 1;
Expand All @@ -30,7 +30,7 @@ MODULE MenuViewers; (*JG 26.8.90 / 16.9.93 / NW 10.3.13 / AP 12.2.20 Extended Ob
PROCEDURE Modify (V: Viewer; Y, H: INTEGER);
VAR Menu, Main: Display.Frame;
BEGIN Menu := V.dsc; Main := V.dsc.next;
Oberon.RemoveMarks(V.X, V.Y, V.W, V.H); Draw(V, V.Y, V.H, Display.black);
Oberon.RemoveMarks(V.X, V.Y, V.W, V.H);
IF H > V.menuH + 1 THEN
IF Y + H > V.Y + V.H THEN
Viewers.Adjust(Menu, Viewers.modify, Y + H - V.menuH, V.menuH - 1);
Expand All @@ -46,7 +46,7 @@ MODULE MenuViewers; (*JG 26.8.90 / 16.9.93 / NW 10.3.13 / AP 12.2.20 Extended Ob
Viewers.Adjust(Main, Viewers.modify, Y + H - V.menuH, 0);
Viewers.Adjust(Menu, Viewers.modify, Y + 1, H - 2)
END ;
Draw(V, Y, H, Display.white)
Draw(V, Y, H)
END Modify;

PROCEDURE Suspend (V: Viewer);
Expand Down

0 comments on commit 3678fd2

Please sign in to comment.