[Oberon] Creating SD card image - RISC.img and ORG/ORP

Peter De Wachter pdewacht at gmail.com
Tue Apr 15 23:25:15 CEST 2014


On 14-04-14 19:37, Paul Reed wrote:
> Notice that the image doesn't have to be big, see the patch to the
> emulator I included in the Windows package on projectoberon.com - if it
> recognises the image file as an Oberon filesystem (beginning with
> FileDir.DirMark) then it virtualises the first 80002H 512-byte sectors,
> which as you quite rightly say don't need to be accessed if you're just
> going to be in emulation.

Actually, I don't understand why you don't just use the partition table?
The code easily fits in the boot loader. Why force the Oberon file
system to sit in a random location in the middle of the disk?

  PROCEDURE FSoffset(): INTEGER;
    VAR i, ofs, sig, typ, lba1, lba2: INTEGER;
  BEGIN ofs := 0;
    ReadSD(0, 0);
    SYSTEM.GET(508, sig);
    IF sig DIV 10000H MOD 10000H = 0AA55H THEN
      FOR i := 494 TO 446 BY -16 DO
        SYSTEM.GET(i + 2, typ);
        IF typ DIV 10000H MOD 100H = 0FFH THEN
          SYSTEM.GET(i + 6, lba1);
          SYSTEM.GET(i + 10, lba2);
          ofs := (lba1 DIV 10000H MOD 10000H) + (lba2 * 10000H)
        END
      END
    END;
    (* halt if no Oberon partition is found *)
    IF ofs = 0 THEN LED(8FH); REPEAT UNTIL FALSE END
  RETURN ofs
  END FSoffset;

The discovered value can be passed to Oberon in the boot parameter
table, so Kernel.Mod will only need a trivial change.



More information about the Oberon mailing list