Bootstrap.Mos 952 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. MODULE Bootstrap;
  2. (**
  3. AUTHOR Timothée Martiel, 01/2016
  4. PURPOSE Bootloader bootstrapping module
  5. *)
  6. IMPORT
  7. Trace, Board, TraceDevice, Memory, OFSDiskVolumes, OFS, Modules;
  8. CONST
  9. Volume = 'SD0';
  10. Partition = 2;
  11. Prefix * = '_';
  12. VAR
  13. m: Modules.Module;
  14. v: OFSDiskVolumes.Volume;
  15. res: LONGINT;
  16. BEGIN
  17. TraceDevice.Install; (* install trace if it has not yet been installed *)
  18. v := NIL;
  19. OFSDiskVolumes.New(Volume, Partition, v);
  20. IF v = NIL THEN
  21. Trace.String("OEB Boostrap: Failed to mount partition ");
  22. Trace.String(Volume);
  23. Trace.String("#");
  24. Trace.Int(Partition, 0);
  25. Trace.Ln;
  26. LOOP END
  27. END;
  28. OFS.InitVol(v);
  29. OFS.NewFS(Prefix, FALSE, v);
  30. (*Trace.StringLn("OEB Starting...");*)
  31. Modules.ThisMod("Bootloader", m);
  32. IF m = NIL THEN
  33. Trace.String("OEB Bootstrap: Failed to load module ");
  34. Trace.String(Modules.errstring);
  35. Trace.String(", error code: ");
  36. Trace.Int(Modules.res, 0);
  37. Trace.Ln;
  38. LOOP END
  39. END
  40. END Bootstrap.