home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / MM2_DEV / S / MOS / BIOS.D < prev    next >
Encoding:
Modula Definition  |  1990-07-19  |  4.7 KB  |  157 lines

  1. DEFINITION MODULE BIOS;
  2.  
  3. (*
  4.  * BIOS-Definition nach TDI V3.00
  5.  *
  6.  * Die Dokumentation stammt von Paul Curtis (TDI).
  7.  *)
  8.  
  9.  
  10. FROM SYSTEM IMPORT ADDRESS;
  11.  
  12.  
  13. TYPE Device = (PRT,   (* printer, parallel port *)
  14.                AUX,   (* aux device, the serial port *)
  15.                CON,   (* console, the screen *)
  16.                HSS,   (* high speed serial, MIDI port: Atari extension *)
  17.                KDB,   (* intelligent keyboard: Atari extension *)
  18.                RAW);  (* raw console device: Atari extension *)
  19.  
  20. TYPE RW = (Read,                 (* normal read *)
  21.            Write,                (* normal write *)
  22.            ReadNoMediaChange,    (* read, do not alter media-change *)
  23.            WriteNoMediaChange);  (* write, do not alter media-change *)
  24.  
  25. TYPE MCState = (NoChange,        (* definately no change *)
  26.                 MayHaveChanged,  (* media might have changed *)
  27.                 Changed);        (* definately has changed *)
  28.  
  29. TYPE BPBPtr = POINTER TO BPB ;
  30.      BPB = RECORD (* BIOS Paramter Block *)
  31.              recsiz : CARDINAL ; (* physical sector size in bytes *)
  32.              clsiz  : CARDINAL ; (* cluster size in sectors *)
  33.              clsizb : CARDINAL ; (* cluster size in bytes *)
  34.              rdlen  : CARDINAL ; (* root directory length in sectors *)
  35.              fsiz   : CARDINAL ; (* FAT size in sectors *)
  36.              fatrec : CARDINAL ; (* sector # of 1st data sector of 2nd FAT *)
  37.              datrec : CARDINAL ; (* sector # of 1st data sector *)
  38.              numcl  : CARDINAL ; (* number of data clusters on disk *)
  39.              bflags : CARDINAL ; (* misc flags *)
  40.            END ;
  41.  
  42. TYPE
  43.   DriveSet = SET OF [0..31];
  44.  
  45. TYPE
  46.   KBShiftBits = (RightShift, LeftShift, ControlKey, AlternateKey,
  47.                  CapsLock, RightMouseButton, LeftMMouseButton);
  48.   KBShifts = SET OF KBShiftBits;
  49.  
  50.  
  51. PROCEDURE BConStat(dev: Device): BOOLEAN;
  52.   (* return input status of device.
  53.  
  54.      dev: the device to return status of.
  55.      returns: TRUE => characters waiting to be read. *)
  56.  
  57.  
  58. PROCEDURE BCosStat(dev: Device): BOOLEAN;
  59.   (* return output status of device.
  60.  
  61.      dev: the device to return status of.
  62.      returns: TRUE => no characters waiting to be written. *)
  63.  
  64.  
  65. PROCEDURE BConIn(dev: Device): LONGCARD;
  66.   (* read character from device. (waits for character)
  67.  
  68.      dev: the device to read from.
  69.      returns: character. For CON, IBM-PC compatible scan code in
  70.        hi word, character in low word. *)
  71.  
  72.  
  73. PROCEDURE BConOut(dev: Device; c: CHAR);
  74.   (* write character to device. (waits for device ready)
  75.  
  76.      dev: the device to write to.
  77.      c: the character to write. *)
  78.  
  79.  
  80. PROCEDURE RWAbs(rw: RW; buf: ADDRESS; count, recno, dev: CARDINAL): LONGINT;
  81.   (* read/write absolute sectors.
  82.  
  83.      rw: the type of read/write operation.
  84.      buf: the buffer to write from/read to.
  85.      count: number of sectors to transfer.
  86.      recno: logical sector number to start transfer at,
  87.      dev: device, 0 => A:, 1 => B:, > 2 for hard disk, network, etc.
  88.  
  89.      returns: 0 => OK, otherwise error code. *)
  90.  
  91.  
  92. PROCEDURE SetException(vecnum: CARDINAL; vec: ADDRESS);
  93.   (* set exception vector.
  94.  
  95.      vecnum: vector to set.
  96.      vec: the code to execute on exception.
  97.  
  98.      returns: old vector.
  99.  
  100.      notes: $00-$FF: reserved for 68000
  101.             $100-$107: reserved for GEMDOS.
  102.                        $100 = system timer interrupt,
  103.                        $101 = critical error handler.
  104.                        $102 = Process terminate hook. *)
  105.  
  106.  
  107. PROCEDURE GetException(vecnum: CARDINAL): ADDRESS;
  108.   (* get exception vector.
  109.  
  110.      vecnum: as for SetException.
  111.      returns: current exception handler address. *)
  112.  
  113.  
  114. PROCEDURE TimerCalibration(): LONGCARD;
  115.   (* get timer calibration value.
  116.  
  117.      returns: timer calibration value to nearest millisecond. *)
  118.  
  119.  
  120. PROCEDURE GetBPB(dev: CARDINAL): BPBPtr ;
  121.   (* get bios parameter block for device.
  122.  
  123.      dev: device to get BPB for; 0 => A:, 1 => B: etc.
  124.  
  125.      returns: 0 => BPB can't be determined, otherwise address of
  126.                 parameter block. *)
  127.  
  128.  
  129. PROCEDURE MediaChange(dev: CARDINAL): MCState;
  130.   (* returns media change state for a device.
  131.  
  132.      dev: the device to return change state of, 0 => A:, etc.
  133.  
  134.      returns: the media change state. *)
  135.  
  136.  
  137. PROCEDURE DriveMap(): DriveSet;
  138.   (* return drives on line.
  139.  
  140.      returns: 1 in bit position means drive on line, otherwise
  141.                 no drive connected. *)
  142.  
  143.  
  144. PROCEDURE SetKBShift(keys: KBShifts);
  145.   (* set keyboard shift key state.
  146.  
  147.      keys: the new keyboard shift key state. *)
  148.  
  149.  
  150. PROCEDURE GetKBShift(): KBShifts;
  151.   (* return keyboard shift key state.
  152.  
  153.      returns: the current keyboard shift key state. *)
  154.  
  155.  
  156. END BIOS.
  157.