Skip to content

Commit

Permalink
Add script for automatically rebuilding disk image
Browse files Browse the repository at this point in the history
Based on CommandLineCompiler
  • Loading branch information
schierlm committed May 24, 2020
1 parent 754207b commit dc8541a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 1 deletion.
1 change: 1 addition & 0 deletions BuildModifications.Tool.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ORP.Compile ORS.Mod/s ORB.Mod/s ~
ORP.Compile ORG.Mod/s ORP.Mod/s ~
ORP.Compile ORL.Mod/s ~
System.Free ORL ORP ORG ORB ORS ~

ORP.Compile Kernel.Mod/s FileDir.Mod/s Files.Mod/s Modules.Mod/s ~
ORL.Link Modules ~
Expand Down
27 changes: 27 additions & 0 deletions CommandLineCompiler/CommandLineDefragger.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- 1/Defragger.Mod.txt
+++ 2/Defragger.Mod.txt
@@ -1,5 +1,5 @@
MODULE Defragger;
- IMPORT SYSTEM, Kernel, FileDir, DefragFiles, Display, Fonts;
+ IMPORT SYSTEM, Kernel, FileDir, DefragFiles, Display, Fonts, CommandLineSystem;

CONST FileInfoPerSector = 28;

@@ -31,6 +31,7 @@
Display.ReplConst(Display.black, 22, 22, 166, 26, Display.replace);
DrawText("Defrag finished. Please restart.", 30, 30);
Kernel.Install(SYSTEM.ADR(ShowRestartMessage), 0);
+ CommandLineSystem.FinishCommand;
REPEAT SYSTEM.PUT(-64, Kernel.Time() + 1000) UNTIL FALSE
END ShowRestartMessage;

@@ -122,5 +123,9 @@
END;
Trim; ShowRestartMessage
END Defrag;
+
+ PROCEDURE Load*;
+ BEGIN
+ END Load;

END Defragger.
1 change: 1 addition & 0 deletions CommandLineCompiler/CommandLineSystem.Mod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ MODULE CommandLineSystem;
Texts.Append(Oberon.Log, W.buf);
Files.Set(R, F, 0);
WHILE i > 0 DO Rec(x); Files.WriteByte(R, x); DEC(i) END;
Rec(x); ASSERT(x = 0);
Files.Register(F); Texts.WriteString(W, " done"); Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf)
ELSE
Texts.WriteString(W, "> "); Texts.Append(Oberon.Log, W.buf);
Expand Down
Empty file modified DefragmentFreeSpace/trim_defragmented_image.sh
100644 → 100755
Empty file.
38 changes: 38 additions & 0 deletions make_disk_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh
set -e

for i in Display Viewers MenuViewers Rectangles Curves Draw MacroTool ORS PCLink1 ORTool; do
cp ${WIRTH_PERSONAL:-../wirth-personal/}people.inf.ethz.ch/wirth/ProjectOberon/Sources/$i.Mod.txt work/$i.Mod
dos2unix work/$i.Mod
unix2mac work/$i.Mod
done

cd work
sed 's/Modules.Load("System"/Modules.Load("CommandLineSystem"/' <Oberon.Mod.txt >OberonX.Mod.txt
cp Defragger.Mod.txt Defragger0.Mod.txt
patch <../CommandLineCompiler/CommandLineDefragger.patch
mv Defragger.Mod.txt DefraggerX.Mod.txt
mv Defragger0.Mod.txt Defragger.Mod.txt
for i in *.txt; do unix2mac $i; mv $i ${i%.txt}; done

unzip ../CommandLineCompiler.zip
gcc main.c disk.c risc.c risc-fp.c -o risc

cp base.dsk mods.dsk
: >.cmds
for i in *.Mod *.Text *.Tool; do echo +$i >> .cmds; done
./risc mods.dsk < .cmds
cp ../BuildModifications.Tool.txt .cmds
echo 'ORP.Compile CommandLineSystem.Mod OberonX.Mod ~' >> .cmds
./risc mods.dsk < .cmds
echo 'ORP.Compile DefraggerX.Mod/s ~' > .cmds
echo 'System.DeleteFiles OberonX.Mod DefraggerX.Mod ~' >> .cmds
echo 'Defragger.Load' >> .cmds
echo 'ORP.Compile Oberon.Mod Defragger.Mod/s ~' >> .cmds
echo 'Defragger.Defrag' >> .cmds
./risc mods.dsk < .cmds
../DefragmentFreeSpace/trim_defragmented_image.sh mods.dsk
mv mods.dsk_trimmed OberonModifications.dsk
cd ..

echo Done.
5 changes: 4 additions & 1 deletion make_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
rm -rf work
mkdir work
for i in Kernel FileDir Files Modules Fonts Input Texts Oberon TextFrames System Edit Graphics GraphicFrames ORB ORG ORP BootLoad; do
cp ${WIRTH_PERSONAL:-../wirth-personal/}people.inf.ethz.ch/wirth/ProjectOberon/Sources/$i.Mod.txt work
cp ${WIRTH_PERSONAL:-../wirth-personal/}people.inf.ethz.ch/wirth/ProjectOberon/Sources/$i.Mod.txt work
dos2unix work/$i.Mod.txt
done

Expand Down Expand Up @@ -44,10 +44,13 @@ rmdir work/utf8lite
patch -d work <VariableLinespace/VariableLineSpace.patch

sed -i 's/maxCode = 8000; /maxCode = 8500; /' work/ORG.Mod.txt
sed -i '1,2d' work/BootLoad.Mod.txt

cp BuildModifications.Tool.txt ORL.Mod.txt Calculator/*.txt DrawAddons/*.txt ResourceMonitor/*.txt work
cp DefragmentFreeSpace/DefragFiles.Mod.txt DefragmentFreeSpace/Defragger.Mod.txt OnScreenKeyboard/*.txt work
cp RebuildToolBuilder/*.txt KeyboardTester/*.txt RobustTrapViewer/*.txt ORInspect/*.txt work
cp UTF8CharsetLite/*.txt work

rm work/*.orig

echo Done.

0 comments on commit dc8541a

Please sign in to comment.