home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD1.3 / Text_Autodocs / disk.doc < prev    next >
Encoding:
Text File  |  1992-09-12  |  3.7 KB  |  161 lines

  1. TABLE OF CONTENTS
  2.  
  3. disk.resource/AllocUnit
  4. disk.resource/FreeUnit
  5. disk.resource/GetUnit
  6. disk.resource/GetUnitID
  7. disk.resource/GiveUnit
  8.  
  9.  
  10. disk.resource/AllocUnit                     disk.resource/AllocUnit
  11.  
  12.    NAME
  13.        AllocUnit - allocate a unit of the disk
  14.  
  15.    SYNOPSIS
  16.        Success = AllocUnit( unitNum ), DRResource
  17.     D0                      D0         A6
  18.  
  19.    FUNCTION
  20.     This routine allocates one of the units of the disk.  It should
  21.     be called before trying to use the disk (via GetUnit).
  22.  
  23.    INPUTS
  24.     unitNum -- a legal unit number (zero through three)
  25.  
  26.    RESULTS
  27.     Success -- nonzero if successful.  zero on failure.
  28.  
  29.    EXCEPTIONS
  30.  
  31.    SEE ALSO
  32.  
  33.    BUGS
  34.  
  35.  
  36. disk.resource/FreeUnit                       disk.resource/FreeUnit
  37.  
  38.    NAME
  39.        FreeUnit - deallocate the disk
  40.  
  41.    SYNOPSIS
  42.        FreeUnit( unitNum ), DRResource
  43.           D0         A6
  44.  
  45.    FUNCTION
  46.     This routine deallocates one of the units of the disk.  It should
  47.     be called when done with the disk.  Do not call it if you did
  48.     no successfully allocate the disk (there is no protection -- you
  49.     will probably crash the disk system).
  50.  
  51.    INPUTS
  52.     unitNum -- a legal unit number (zero through three)
  53.  
  54.    RESULTS
  55.  
  56.    EXCEPTIONS
  57.  
  58.    SEE ALSO
  59.  
  60.    BUGS
  61.  
  62.  
  63. disk.resource/GetUnit                         disk.resource/GetUnit
  64.  
  65.    NAME
  66.        GetUnit - allocate the disk for a driver
  67.  
  68.    SYNOPSIS
  69.        lastDriver = GetUnit( unitPointer ), DRResource
  70.        D0              A1             A6
  71.  
  72.    FUNCTION
  73.     This routine allocates the disk to a driver.  It is either
  74.     immediately available, or the request is saved until the disk
  75.     is available.  When it is available, your unitPointer is
  76.     sent back to you (via ReplyMsg).  You may then reattempt the
  77.     GetUnit.
  78.     
  79.     Allocating the disk allows you to use the disk's resources.
  80.     Remember however that there are four units to the disk; you are
  81.     only one of them.  Please be polite to the other units (by never
  82.     selecting them, and by not leaving interrupts enabled, etc.).
  83.  
  84.     When you are done, please leave the disk in the following state:
  85.         dmacon dma bit ON
  86.         dsklen dma bit OFF (write a #DSKDMAOFF to dsklen)
  87.         adkcon disk bits -- any way you want
  88.         entena:disk sync and disk block interrupts -- Both DISABLED
  89.         CIA resource index interrupt -- DISABLED
  90.         8520 outputs -- doesn't matter, because all bits will be
  91.         set to inactive by the resource.
  92.         8520 data direction regs -- restore to original state.
  93.  
  94.    INPUTS
  95.     unitPtr - a pointer you your disk resource unit structure.
  96.         Note that the message filed of the structure MUST
  97.         be a valid message, ready to be replied to.
  98.  
  99.    RESULTS
  100.     lastDriver - if the disk is not busy, then the last unit
  101.         to use the disk is returned.  This may be used to
  102.         see if a driver needs to reset device registers.
  103.         (If you were the last user, then no one has changed
  104.         any of the registers.  If someone else has used it,
  105.         then any allowable changes may have been made).  If the
  106.         disk is busy, then a null is returned.
  107.  
  108.    EXCEPTIONS
  109.  
  110.    SEE ALSO
  111.  
  112.    BUGS
  113.  
  114.  
  115. disk.resource/GetUnitID                     disk.resource/GetUnitID
  116.  
  117.    NAME
  118.        GetUnitID - find out what type of disk is out there
  119.  
  120.    SYNOPSIS
  121.        idtype = GetUnitID( unitNum ), DRResource
  122.     D0                D0         A6
  123.  
  124.    FUNCTION
  125.  
  126.    INPUTS
  127.  
  128.    RESULTS
  129.     idtype -- the type of the disk drive.  Standard types are
  130.         defined in the resource include file.
  131.  
  132.    EXCEPTIONS
  133.  
  134.    SEE ALSO
  135.  
  136.    BUGS
  137.  
  138.  
  139. disk.resource/GiveUnit                       disk.resource/GiveUnit
  140.  
  141.    NAME
  142.        GiveUnit - Free the disk back up
  143.  
  144.    SYNOPSIS
  145.        GiveUnit(), DRResource
  146.                    A6
  147.  
  148.    FUNCTION
  149.     This routine frees the disk after a driver is done with it.
  150.     If others are waiting, it will notify them.
  151.  
  152.    INPUTS
  153.  
  154.    RESULTS
  155.  
  156.    EXCEPTIONS
  157.  
  158.    SEE ALSO
  159.  
  160.    BUGS
  161.