home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D3.DMS / in.adf / Interfaces / Disk.mod < prev    next >
Encoding:
Text File  |  1992-11-02  |  3.1 KB  |  112 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                                                                         *)
  3. (*  Amiga Oberon Interface Module:                    Date: 02-Nov-92      *)
  4. (*                                                                         *)
  5. (*   © 1992 by Fridtjof Siebert                                            *)
  6. (*                                                                         *)
  7. (*-------------------------------------------------------------------------*)
  8.  
  9. MODULE Disk;
  10.  
  11. IMPORT e * := Exec;
  12.  
  13. TYPE
  14.  
  15. (********************************************************************
  16. *
  17. * Resource structures
  18. *
  19. ********************************************************************)
  20.  
  21.   DiscResourceUnitPtr * = UNTRACED POINTER TO DiscResourceUnit;
  22.   DiscResourceUnit * = STRUCT (message * : e.Message)
  23.     discBlock * : e.Interrupt;
  24.     discSync * : e.Interrupt;
  25.     index * : e.Interrupt;
  26.   END;
  27.  
  28.   DiscResourcePtr * = UNTRACED POINTER TO DiscResource;
  29.   DiscResource * = STRUCT (library * : e.Library)
  30.     current * : DiscResourceUnitPtr;
  31.     flags * : SHORTSET;
  32.     pad * : e.BYTE;
  33.     sysLib * : e.LibraryPtr;
  34.     ciaResource * : e.LibraryPtr;
  35.     unitID * : ARRAY 4 OF LONGINT;
  36.     waiting * : e.List;
  37.     discBlock * : e.Interrupt;
  38.     discSync * : e.Interrupt;
  39.     index * : e.Interrupt;
  40.     currTask * : e.TaskPtr;
  41.   END;
  42.  
  43. CONST
  44.  
  45. (* DiskResource.flags entries *)
  46.   alloc0  * = 0;      (* unit zero is allocated *)
  47.   alloc1  * = 1;      (* unit one is allocated *)
  48.   alloc2  * = 2;      (* unit two is allocated *)
  49.   alloc3  * = 3;      (* unit three is allocated *)
  50.   active  * = 7;      (* is the disc currently busy? *)
  51.  
  52.  
  53.  
  54. (********************************************************************
  55. *
  56. * Hardware Magic
  57. *
  58. ********************************************************************)
  59.  
  60.  
  61.   dskDMAOff * = 4000H;   (* idle command for dsklen register *)
  62.  
  63.  
  64. (********************************************************************
  65. *
  66. * Resource specific commands
  67. *
  68. ********************************************************************)
  69.  
  70. (*
  71.  * DISKNAME is a generic macro to get the name of the resource.
  72.  * This way if the name is ever changed you will pick up the
  73.  *  change automatically.
  74.  *)
  75.  
  76.   diskName * = "disk.resource";
  77.  
  78.  
  79. (********************************************************************
  80. *
  81. * drive types
  82. *
  83. ********************************************************************)
  84.  
  85.   amiga         * = 000000000H;
  86.   drt37422D2S   * = 055555555H;
  87.   empty         * = 0FFFFFFFFH;
  88.   drt150RPM     * = 0AAAAAAAAH;
  89.  
  90.  
  91. VAR
  92.  
  93. (*
  94.  *  You have to put a pointer to the disk.resource here to use the disk
  95.  *  procedures:
  96.  *)
  97.  
  98.   base * : DiscResourcePtr;
  99.  
  100. PROCEDURE AllocUnit *{base,- 6}(unitNum{0}     : LONGINT): BOOLEAN;
  101. PROCEDURE FreeUnit  *{base,-12}(unitNum{0}     : LONGINT);
  102. PROCEDURE GetUnit   *{base,-18}(unitPointer{9} : DiscResourceUnitPtr): DiscResourceUnitPtr;
  103. PROCEDURE GiveUnit  *{base,-24}();
  104. PROCEDURE GetUnitID *{base,-30}(unitNum{0}     : LONGINT): LONGINT;
  105. PROCEDURE ReadUnitID*{base,-36}(unitNum{0}     : LONGINT): LONGINT;
  106.  
  107. END Disk.
  108.  
  109.  
  110.  
  111.  
  112.