[Oberon] FPGA - Modules.bin - inner core size

Tomas Kral thomas.kral at email.cz
Mon Aug 20 23:10:18 CEST 2018

On Mon, 20 Aug 2018 14:57:11 +0200
Tomas Kral <thomas.kral at email.cz> wrote:

> FOR sec = 2 TO 63 DO
>   Kernel.GetSector(sec*29, buf);
>   Files.WriteBytes(r, buf, Kernel.SectorLength)
> END ;
> Ignoring some trailing NULL sectors, I can guess a file size making
> the original inner core => 37056 bytes.

This is possibly of little or no use, but it shows we can access
sectors in word entities. It can guess number of sectors currently used
in boot area. Exact boot code size is reported by [ORL].Linker.

PROCEDURE Guess*; (*SD boot sectors used*)
     CONST ssw = Kernel.SectorLength DIV 4; (*sector size in words*)
     VAR i, used, secno: INTEGER;
       buf: ARRAY ssw OF INTEGER;
     Texts.WriteString(W, "boot sectors used");
Texts.Append(Oberon.Log, W.buf); sec := 63; (*last*)
       Kernel.GetSector(sec*29, buf); DEC(sec);
       used := 0; FOR i := 0 TO ssw-1 DO INC(used, buf[i]) END ;
     UNTIL (secno < 2 (*first*)) OR (used # 0);
     Texts.WriteInt(W, sec-2+1, 4);
     Texts.WriteLn(W); Texts.Append(Oberon.Log, W.buf)
   END Guess;

Tomas Kral <thomas.kral at email.cz>

More information about the Oberon mailing list