Skip to content

Instantly share code, notes, and snippets.

@schierlm
Last active May 1, 2020 23:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schierlm/fa30b06d66f1dff42a516bd166fa5aaa to your computer and use it in GitHub Desktop.
Save schierlm/fa30b06d66f1dff42a516bd166fa5aaa to your computer and use it in GitHub Desktop.
Getting the A2 ISO bootable again

Getting the A2 ISO bootable again

See the patch and generated ISO files below... (EDIT The mini iso is easily downloadable but the big one got split due to GitHub's filesize limit of 100MB. So you will have to use 7-Zip or cat or similar tools to combine the files back)

  1. Fix OBLUnreal boot loader when drive is 0 (booting from (emulated) floppy), so that it will only read one sector
  2. Pad OBLUnreal boot loader to CD sector size
  3. Some small tweaks in Build.Tool
  4. Fix installer
  5. Include Oberon again and fix compilation errors.
Index: Build.Tool
===================================================================
--- Build.Tool (revision 9807)
+++ Build.Tool (working copy)
@@ -11,17 +11,15 @@
# Step 2: Link boot files
+# All these boot files are larger than 640KB, therefore OBLUnreal.Bin must be used as boot loader file.
System.DoCommands
-Linker.Link \P../Test/ \.Obx ../Test/IDE.Bin 0100000H 1000H Kernel Traps
+Linker.Link --path=../Test/ --fileName=../Test/IDE.Bin --displacement=0100000H Kernel Traps
ATADisks DiskVolumes DiskFS Loader BootConsole ~
-~
-
-# These boot images can't be built anymore because they get to large in terms of size
-Linker.Link \P../Test/ \.Obx ../Test/USB.Bin 0100000H 1000H Kernel Traps
+Linker.Link --path=../Test/ --fileName=../Test/USB.Bin --displacement=0100000H Kernel Traps
UsbHubDriver UsbEhci UsbStorageBoot
DiskVolumes DiskFS Loader BootConsole ~
-Linker.Link \P../Test/ \.Obx ../Test/SCSI.Bin 0100000H 1000H Kernel Traps
+Linker.Link --path=../Test/ --fileName=../Test/SCSI.Bin --displacement=0100000H Kernel Traps
Adaptec7 NCR810Disks DiskVolumes DiskFS Loader BootConsole ~
~
@@ -31,10 +29,15 @@
# The low-/full-speed drivers (UsbUhci.Mod, UsbOhci.Mod) can be loaded later on-demand.
# If you want to boot from a computer that does not support high-speed USB, use
-Linker.Link \P../Test/ \.Obx ../Test/USBSLOW.Bin 0100000H 1000H Kernel Traps
+Linker.Link --path=../Test/ --fileName=../Test/USBSLOW.Bin --displacement=0100000H Kernel Traps
UsbHubDriver UsbOhci UsbUhci UsbStorageBoot
DiskVolumes DiskFS Loader BootConsole ~
+ZipTool.Add --nopath ../Test/Applications.zip ../Test/InstallerPackages.XML ~
+
+PCAAMD64.Assemble OBLUnreal.Asm ~
+FSTools.CopyTo ../Test/ ./ OBLUnreal.Bin ~
+
# Step 3a: Create image for bootable CD (A2.iso)
System.DoCommands
@@ -41,13 +44,16 @@
System.Timer start ~
+PCAAMD64.Assemble OBLUnreal.Asm ~
+PartitionsLib.SetBootLoaderFile OBLUnreal.Bin ~
+
FSTools.Mount RAMDISK RamFS 2000000 4096 ~
-FSTools.DeleteFiles RAMDISK:A2.Dsk ~
+FSTools.DeleteFiles -i RAMDISK:A2.Dsk ~
-VirtualDisks.Create RAMDISK:A2.Dsk 320000 512 ~
+VirtualDisks.Create RAMDISK:A2.Dsk 390000 512 ~
VirtualDisks.Install -c=80 -h=2 -s=18 -b=512 VDISK0 RAMDISK:A2.Dsk ~
-Linker.Link \P../Test/ \.Obx ../Test/CD.Bin 0100000H 1000H
+Linker.Link --path=../Test/ --fileName=../Test/CD.Bin --displacement=0100000H
Kernel Traps ATADisks DiskVolumes RAMVolumes DiskFS Loader BootConsole ~
Partitions.Format VDISK0#0 AosFS 1024 ../Test/CD.Bin ~
@@ -61,7 +67,7 @@
GuiApplicationsMini.zip GuiApplications.zip Fun.zip Contributions.zip Build.zip EFI.zip
Oberon.zip OberonGadgets.zip OberonApplications.zip OberonDocumentation.zip
KernelSrc.zip SystemSrc.zip DriversSrc.zip ApplicationsMiniSrc.zip ApplicationsSrc.zip GuiApplicationsMiniSrc.zip GuiApplicationsSrc.zip FunSrc.zip BuildSrc.zip
- ScreenFonts.zip CjkFonts.zip TrueTypeFonts.zip ~
+ ScreenFonts.zip CjkFonts.zip TrueTypeFonts.zip IBMPlexFonts.zip ~
System.Show Copy ZIP archives to TEMP: ~
FSTools.CopyTo TEMP: ../Test/
@@ -73,11 +79,11 @@
FunSrc.zip TestingSrc.zip BuildSrc.zip EFISrc.zip ContributionsSrc.zip
Education.zip EducationSrc.zip
Oberon.zip OberonGadgets.zip OberonApplications.zip OberonDocumentation.zip
- ScreenFonts.zip TrueTypeFonts.zip CjkFonts.zip
+ ScreenFonts.zip TrueTypeFonts.zip CjkFonts.zip IBMPlexFonts.zip
OberonSrc.zip OberonApplicationsSrc.zip OberonGadgetsSrc.zip
OberonVoyager.zip OberonVoyagerSrc.zip OberonAnts.zip OberonAntsSrc.zip
Pr3Fonts.zip Pr6Fonts.zip
- IDE.Bin CompileCommand.Tool ~
+ IDE.Bin OBLUnreal.Bin SCSI.Bin USB.Bin USBSLOW.Bin CompileCommand.Tool ~
FSTools.Watch TEMP ~
FSTools.Unmount TEMP ~
@@ -113,13 +119,16 @@
System.Timer start ~
+PCAAMD64.Assemble OBLUnreal.Asm ~
+PartitionsLib.SetBootLoaderFile OBLUnreal.Bin ~
+
FSTools.Mount RAMDISK RamFS 2000000 4096 ~
-FSTools.DeleteFiles RAMDISK:A2.Dsk ~
+FSTools.DeleteFiles -i RAMDISK:A2.Dsk ~
-VirtualDisks.Create RAMDISK:A2.Dsk 80000 512 ~
+VirtualDisks.Create RAMDISK:A2.Dsk 100000 512 ~
VirtualDisks.Install -c=80 -h=2 -s=18 -b=512 VDISK0 RAMDISK:A2.Dsk ~
-Linker.Link \P../Test/ \.Obx ../Test/CD.Bin 0100000H 1000H
+Linker.Link --path=../Test/ --fileName=../Test/CD.Bin --displacement=0100000H
Kernel Traps ATADisks DiskVolumes RAMVolumes DiskFS Loader BootConsole ~
Partitions.Format VDISK0#0 AosFS 1024 ../Test/CD.Bin ~
Index: Installer.Mod
===================================================================
--- Installer.Mod (revision 9807)
+++ Installer.Mod (working copy)
@@ -12,7 +12,7 @@
AosFsName = "AosFS";
DefaultMBRFile = "OBEMBR.BIN";
- DefaultBootLoader = "OBL.Bin";
+ DefaultBootLoader = "OBLUnreal.Bin";
DefaultBootfile = "IDE.Bin";
DefaultUsbBootfile = "USB.Bin";
DefaultBootManMBR = "BootManagerMBR.Bin";
@@ -649,7 +649,7 @@
installLog.String(", Boot File: "); installLog.String(config.bootfile); installLog.String(") ... "); installLog.Update;
NEW(operation, disk, partition, out);
operation.SetParent(SELF);
- operation.SetParameters(AosFsName, config.bootfile, -2, 0);
+ operation.SetParameters(AosFsName, config.bootfile, 1024, 0);
operation.SetBlockingStart;
RETURN OperationDone(operation);
END DoFormatPartition;
Index: Oberon.FATDocs.Mod
===================================================================
--- Oberon.FATDocs.Mod (revision 9807)
+++ Oberon.FATDocs.Mod (working copy)
@@ -66,7 +66,7 @@
(* Copy - copies 'src' to 'dst' *)
PROCEDURE Copy(src, dst: ARRAY OF CHAR): BOOLEAN;
CONST BufLen = 8192;
-VAR s, d: Files.File; rS, rD: Files.Rider; i, size, ts: SIGNED32; buf: ARRAY BufLen OF CHAR;
+VAR s, d: Files.File; rS, rD: Files.Rider; i, ts: SIGNED32; size: SIGNED64; buf: ARRAY BufLen OF CHAR;
res: BOOLEAN;
BEGIN
res := FALSE;
@@ -81,7 +81,7 @@
s.ReadBytes(rS, buf, 0, BufLen); d.WriteBytes(rD, buf, 0, BufLen); INC(i)
END;
IF (rD.res = 0) THEN
- s.ReadBytes(rS, buf, 0, size MOD BufLen); d.WriteBytes(rD, buf, 0, size MOD BufLen);
+ s.ReadBytes(rS, buf, 0, (size MOD BufLen)(SIGNED32)); d.WriteBytes(rD, buf, 0, (size MOD BufLen)(SIGNED32));
END;
IF (rD.res = 0) THEN
@@ -88,7 +88,7 @@
Files.Register(d);
Texts.WriteString(W, "done");
IF MeasureTime THEN
- Texts.WriteString(W, ": "); Texts.WriteInt(W, size, 0); Texts.WriteString(W, " bytes copied");
+ Texts.WriteString(W, ": "); Texts.WriteInt(W, size(SIGNED32) (* TODO: loss of information! *), 0); Texts.WriteString(W, " bytes copied");
Texts.WriteString(W, ": "); Texts.WriteInt(W, Oberon.Time()-ts,0); Texts.WriteString(W, " ticks")
END;
res := TRUE
@@ -497,7 +497,7 @@
END
END Unquote;
-PROCEDURE ListEntry(VAR name: ARRAY OF CHAR; flags: SET; time, date, size: SIGNED32);
+PROCEDURE ListEntry(VAR name: ARRAY OF CHAR; flags: SET; time, date: SIGNED32; size: SIGNED64);
VAR str: ARRAY 32 OF CHAR; i: SIGNED32; c: CHAR;
BEGIN
Texts.SetColor(dirW, SHORT(Display3.textC));
@@ -600,7 +600,7 @@
PROCEDURE EnumerateDirectory(F: Frame);
VAR f: Objects.Object; pos: SIGNED32; e: Files.Enumerator;
- name, dummy: FATFiles.Filename; flags: SET; time, date, size: SIGNED32;
+ name, dummy: FATFiles.Filename; flags: SET; time, date: SIGNED32; size: SIGNED64;
BEGIN
Texts.Delete(F.text, 0, F.text.len);
Texts.WriteString(dirW, F.fs.prefix); Texts.Write(dirW, ":");
Index: Oberon.LPRPrinter.Mod
===================================================================
--- Oberon.LPRPrinter.Mod (revision 9807)
+++ Oberon.LPRPrinter.Mod (working copy)
@@ -114,7 +114,7 @@
WHILE str[i] # 0X DO
INC(i)
END;
- l := SHORT(LEN(str)-1);
+ l := (LEN(str)-1)(SIGNED16);
j := 0;
WHILE (i < l) & (str2[j] # 0X) DO
str[i] := str2[j];
Index: Oberon.NetSystem.Mod
===================================================================
--- Oberon.NetSystem.Mod (revision 9807)
+++ Oberon.NetSystem.Mod (working copy)
@@ -221,7 +221,7 @@
(** Blocking read a single byte. *)
PROCEDURE Read* (C: Connection; VAR ch: CHAR);
-VAR len, res: SIGNED32; buf: ARRAY 1 OF CHAR;
+VAR len: SIZE; res: INTEGER; buf: ARRAY 1 OF CHAR;
BEGIN
C.pcb.Receive(buf, 0, 1, 1, len, res);
IF (res = 0) & (len = 1) THEN ch := buf[0] ELSE C.res := error; ch := 0X END
@@ -230,7 +230,7 @@
(** Blocking read len bytes of data (beginning at pos in buf) to buf. *)
PROCEDURE ReadBytes* (C: Connection; pos, len: SIGNED32; VAR buf: ARRAY OF SYSTEM.BYTE);
-VAR res, read: SIGNED32;
+VAR res: INTEGER; read: SIZE;
BEGIN
ASSERT(pos+len <= LEN(buf)); (* index check *)
C.pcb.Receive(SYSTEM.VAL(Bytes, buf), pos, len, len, read, res);
@@ -240,7 +240,7 @@
(** Blocking read two bytes in network byte ordering. *)
PROCEDURE ReadInt* (C: Connection; VAR x: SIGNED16);
-VAR buf: ARRAY 2 OF CHAR; res, len: SIGNED32;
+VAR buf: ARRAY 2 OF CHAR; res: INTEGER; len: SIZE;
BEGIN
C.pcb.Receive(buf, 0, 2, 2, len, res);
IF (res = 0) & (len = 2) THEN
@@ -253,7 +253,7 @@
(** Blocking read four bytes in network byte ordering. *)
PROCEDURE ReadLInt* (C: Connection; VAR x: SIGNED32);
-VAR buf: ARRAY 4 OF CHAR; res, len: SIGNED32;
+VAR buf: ARRAY 4 OF CHAR; res: INTEGER; len: SIZE;
BEGIN
C.pcb.Receive(buf, 0, 4, 4, len, res);
IF (res = 0) & (len = 4) THEN
@@ -380,12 +380,12 @@
PROCEDURE ReceiveDG*(S: Socket; VAR remIP: IPAdr; VAR remPort: SIGNED16; pos: SIGNED32; VAR len: SIGNED32;
VAR buf: ARRAY OF SYSTEM.BYTE);
-VAR res, fport: SIGNED32;
+VAR res, fport: SIGNED32; length: SIZE;
BEGIN
ASSERT(pos+len <= LEN(buf)); (* index check *)
- S.pcb.Receive(SYSTEM.VAL(Bytes, buf), pos, len, 0, remIP, fport, len, res);
+ S.pcb.Receive(SYSTEM.VAL(Bytes, buf), pos, len, 0, remIP, fport, length, res);
remPort := SHORT(fport);
- IF res = 0 THEN S.res := done ELSE S.res := error; len := -1 END
+ IF res = 0 THEN S.res := done; len := length(SIGNED32) ELSE S.res := error; len := -1 END
END ReceiveDG;
(** Returns the size of the first available datagram on the socket. *)
Index: OBLUnreal.Asm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: Release.Mod
===================================================================
--- Release.Mod (revision 9807)
+++ Release.Mod (working copy)
@@ -833,6 +833,9 @@
Strings.Append(fileName, file.module.name);
Strings.Append(fileName, ".");
Strings.Append(fileName, extension);
+ IF (Strings.StartsWith("Oberon.", 0, file.module.name)) THEN
+ fileName[Strings.Length(prefix)+6] := '-'
+ END
END GetObjectFileName;
PROCEDURE GetSymbolFileName(file : File; CONST prefix : ARRAY OF CHAR; VAR fileName : ARRAY OF CHAR);
@@ -841,6 +844,9 @@
Strings.Append(fileName, file.module.name);
Strings.Append(fileName, ".");
Strings.Append(fileName, symbolFileExtension);
+ IF (Strings.StartsWith("Oberon.", 0, file.module.name)) THEN
+ fileName[Strings.Length(prefix)+6] := '-'
+ END
END GetSymbolFileName;
PROCEDURE GetPackageFileName(package : Package; sourceCode : BOOLEAN; VAR filename : ARRAY OF CHAR) : BOOLEAN;
Index: Release.Tool
===================================================================
--- Release.Tool (revision 9807)
+++ Release.Tool (working copy)
@@ -131,7 +131,7 @@
COMPILEOPTIONS "-p=Bios32"
EXTENSION "Gof"
SYMBOLEXTENSION "Sym"
- EXCLUDEPACKAGES "Oberon OberonGadgets OberonApplications OberonDocumentation OberonVoyager OberonAnts"
+ EXCLUDEPACKAGES ""
DISABLED "FALSE"
}
Bios32C {
This file has been truncated, but you can view the full file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment