home *** CD-ROM | disk | FTP | other *** search
/ The Don Maslin Archive / maslin_archive.zip / AARDVARK_Tape_Backups / maslin_c_d_3oct95 / ddrive / dw / dws / int13.doc < prev    next >
Text File  |  1989-09-26  |  13KB  |  376 lines

  1. CompatiCard IV BIOS Notes -- Version 1.01 -- September 26, 1989
  2.  
  3.  
  4. The following information is provided for programmers that need 
  5. to access diskettes sectors directly.  This information is 
  6. provided with no technical support for use by qualified 
  7. programmers.  They are similar in function to the routines 
  8. provided by the system BIOS which you should be familiar with.  
  9.  
  10. Any comments or suggestions should put in writing and sent Attn: 
  11. Software Engineering.  Reasonable requests for additional 
  12. functions may be incorporated into future versions.
  13.  
  14.  
  15.  
  16.         CompatiCard IV BIOS Interrupt 13h Specifications
  17.  
  18.  
  19. These functions are provided by the CompatiCard IV BIOS (either 
  20. ROM or CC4BIOS.SYS) when properly installed.  The CompatiCard IV 
  21. functions are similar to the system BIOS functions provided for 
  22. floppy diskette I/O.  When an interrupt 13h function is 
  23. requested, the CompatiCard IV BIOS will look at the physical 
  24. drive address specified and it will only process requests with 
  25. valid addresses.  An address is valid if it was defined as a 
  26. drive using the DIP switches or when specified in the CC4DRV.SYS 
  27. line of the CONFIG.SYS file.  Any interrupt 13h requests that do 
  28. not contain valid addresses will be ignored and passed to the 
  29. system BIOS for processing.
  30.  
  31. Most of the functions return an error code in the AH register 
  32. upon completion.  In addition, the carry flag (CY) will be set if 
  33. the error code returned in AH is non-zero.  The error codes are 
  34. defined as follows:
  35.  
  36.      AH = 00h  successful completion of operation
  37.           80h  diskette drive was not ready
  38.           40h  seek failure
  39.           20h  general controller failure
  40.           10h  data error (CRC) on diskette
  41.           09h  attempt to DMA across 64K boundary
  42.           08h  DMA overrun
  43.           04h  sector not found
  44.           03h  write protect error
  45.           02h  address mark not found
  46.           01h  bad command passed to driver
  47.      
  48. Some of the functions reference parameters that are kept in the 
  49. BIOS diskette drive parameter table.  The table is pointed to by 
  50. INT 1eh (0:78h).  The layout of the table is as follows:
  51.  
  52.      Offset  Size   Description
  53.  
  54.         0    byte   not used
  55.         1    byte   not used
  56.         2    byte   Number of timer ticks to keep motor on
  57.         3    byte   bytes per sector (0=128, 1=256, 2=512, & 
  58.                     3=1024)
  59.         4    byte   number of sectors on a track (used only by 
  60.                     the FORMAT function)
  61.         5    byte   read/write/verify gap length
  62.         6    byte   not used
  63.         7    byte   format gap length
  64.         8    byte   format fill byte
  65.         9    byte   head settle time (in milliseconds)
  66.        10    byte   motor startup time (in 1/8 seconds)
  67.  
  68. If your program needs to alter any of these parameters from their 
  69. original values, you should copy the original table to a scratch 
  70. area and re-point INT 1eh to the scratch area.  The alterations 
  71. should be made to your copy of the table and not the original.  
  72. Before your program terminates, you must restore INT 1eh back to 
  73. the original table.
  74.  
  75.  
  76. Functions:
  77.  
  78.  0 - reset disk system
  79.           This function can be called after a disk error.  It is 
  80.           not required because the CompatiCard IV BIOS will 
  81.           automatically perform a reset when needed.
  82.  
  83.           Entry:
  84.                AH = 0
  85.                DL = physical drive address (0-15)
  86.  
  87.           Exit:
  88.                CY = 0 if no error
  89.                CY = 1 if error
  90.                AH = error code
  91.  
  92.  
  93.  1 - Get I/O error code from last operation
  94.           This function will return the status code from the last 
  95.           I/O operation performed on the drive. 
  96.  
  97.           Entry:
  98.                AH = 1
  99.                DL = physical drive address (0-15)
  100.  
  101.           Exit:
  102.                CY = 0 if no error
  103.                CY = 1 if error
  104.                AH = error code
  105.  
  106.  
  107.  2 - Read sectors
  108.           This function is used to read from a diskette.  It can 
  109.           be used to read more than 1 sector but all of the 
  110.           sectors to be read must be on the same track.  
  111.  
  112.           Entry:
  113.                AH = 2
  114.                AL = number of sectors to read (1-n)
  115.                ES:BX = address of buffer
  116.                CH = cylinder (0-n)
  117.                CL = sector number
  118.                DH = head (0-1)
  119.                DL = physical drive address (0-15)
  120.  
  121.           Exit:
  122.                CY = 0 if no error
  123.                CY = 1 if error
  124.                AH = error code
  125.                AL = number of sectors successfully read
  126.  
  127.           Note: Sector size, motor on time, motor startup time, 
  128.           head settle time, and gap length are obtained from the 
  129.           BIOS diskette drive parameter table. 
  130.  
  131.  
  132.  3 - Write sectors
  133.           This function is used to write to a diskette.  It can 
  134.           be used to write more than 1 sector but all of the 
  135.           sectors to be written must be on the same track.  
  136.  
  137.           Entry:
  138.                AH = 3
  139.                AL = number of sectors to write (1-n)
  140.                ES:BX = address of buffer
  141.                CH = cylinder (0-n)
  142.                CL = sector number
  143.                DH = head (0-1)
  144.                DL = physical drive address (0-15)
  145.  
  146.           Exit:
  147.                CY = 0 if no error
  148.                CY = 1 if error
  149.                AH = error code
  150.                AL = number of sectors successfully written
  151.  
  152.           Note: Sector size, motor on time, motor startup time, 
  153.           head settle time, and gap length are obtained from the 
  154.           BIOS diskette drive parameter table. 
  155.  
  156.  
  157.  4 - Verify sectors
  158.           This function is used to verify sectors from a 
  159.           diskette.  It can be used to verify more than 1 sector 
  160.           but all of the sectors to be verified must be on the 
  161.           same track.  
  162.  
  163.           Entry:
  164.                AH = 4
  165.                AL = number of sectors to verify (1-n)
  166.                CH = cylinder (0-n)
  167.                CL = sector number
  168.                DH = head (0-1)
  169.                DL = physical drive address (0-15)
  170.  
  171.           Exit:
  172.                CY = 0 if no error
  173.                CY = 1 if error
  174.                AH = error code
  175.                AL = number of sectors successfully verified
  176.  
  177.           Note: Sector size, motor on time, motor startup time, 
  178.           head settle time, and gap length are obtained from the 
  179.           BIOS diskette drive parameter table. 
  180.  
  181.  
  182.  5 - Format track
  183.           This function is used to format a track on a diskette.  
  184.  
  185.           Entry:
  186.                AH = 5
  187.                ES:BX = ptr to buffer containing sector information
  188.                CH = cylinder (0-n)
  189.                DH = head (0-1)
  190.                DL = physical drive address (0-15)
  191.  
  192.           Exit:
  193.                CY = 0 if no error
  194.                CY = 1 if error
  195.                AH = error code
  196.  
  197.           Note: Sector size, format gap length, number of sectors 
  198.           to format, and fill byte are obtained from the BIOS 
  199.           diskette drive parameter table. 
  200.  
  201.           The sector information required for formatting is a 
  202.           collection of four byte address fields.  There should 
  203.           be one address field per sector being formatted.  Each 
  204.           field is made up of four bytes, (C, H, R, N), where 
  205.           C=track number, H=head number, R=sector number, and 
  206.           N=number of bytes per sector (0=128, 1=256, 2=512, and 
  207.           3=1024). 
  208.  
  209.  
  210.  8 - Return drive parameters
  211.           This function is used to return some parameters about 
  212.           the specified drive. 
  213.  
  214.           Entry:
  215.                AH = 8
  216.                DL = physical drive address (0-15)
  217.  
  218.           Exit:
  219.                CY = 0 if no error
  220.                  AX = 0
  221.                  BL - bits 7 to 4 = 0
  222.                       bits 3 to 0 - drive type
  223.                         0 = other type
  224.                         1 = 360KB
  225.                         2 = 1.2MB
  226.                         3 = 720KB
  227.                         4 = 1.44MB
  228.                  BH = 0
  229.                  CL = maximum sectors per track
  230.                  CH = maximum number of cylinders
  231.                  DL = number of primary drives installed
  232.                  DH = maximum head number
  233.               ES:DI = pointer to 11 byte diskette drive parameter
  234.                       table associated with the maximum supported
  235.                       media type for the drive specified
  236.                CY = 1 if error
  237.                AH = error code
  238.  
  239.  
  240.  9 - Set CompatiCard parameters
  241.           This function is used to set parameters for a diskette 
  242.           drive.  Each physical drive get its own set of 
  243.           parameters which are retained unless they are changed 
  244.           using function 9 or DOS is re-booted.
  245.  
  246.           Entry:
  247.                AH = 9
  248.                AL = number of retries after I/O error (0-255)
  249.                CH = double step flag (0=single step and  1=double 
  250.                     step)
  251.                CL = density (0=SD, 1=DD, 2=HD, and 3=ED)
  252.                DL = physical drive address (0-15)
  253.  
  254.           Exit:
  255.                CY = 0 if no error
  256.                CY = 1 if error
  257.                AH = error code
  258.  
  259.  
  260.  10 - Return CompatiCard parameters
  261.           This function is used to return the parameters which 
  262.           are currently set for a drive.  Since each drive gets 
  263.           its own set of parameters, this function can return 
  264.           different parameters according to the physical drive 
  265.           address specified.
  266.  
  267.           Entry:
  268.                AH = 10
  269.                DL = physical drive address (0-15)
  270.  
  271.           Exit:
  272.                CY = 0 if no error
  273.                  AL = number of retries after I/O error (0-255)
  274.                  CL = density (0=SD, 1=DD, 2=HD, and 3=ED)
  275.                  CH = double step flag (0=single step and  1=double 
  276.                       step)
  277.                  BL = diskette drive type (0-9)
  278.                  BH = step rate (in milliseconds)
  279.                  ES is altered on exit
  280.                CY = 1 if error
  281.                AH = error code
  282.  
  283.  
  284.  11 - Return next sector ID
  285.           This function is used to return the next sector ID read 
  286.           from the diskette. 
  287.  
  288.           Entry:
  289.                AH = 11
  290.                CH = cylinder (0-n)
  291.                CL = density (0=SD, 1=DD, 2=HD, and 3=ED)
  292.                DH = head (0-1)
  293.                DL = physical drive address (0-15)
  294.  
  295.           Exit:
  296.                CY = 0 if no error
  297.                  AL = sector size (0=128, 1=256, ...)
  298.                  CL = sector number
  299.                  CH = cylinder number
  300.                  DH = side
  301.                CY = 1 if error
  302.                AH = error code
  303.  
  304.  
  305.  21 - Read DASD Type
  306.           This function is used to return change line 
  307.           availability information. 
  308.  
  309.           Entry:
  310.                AH = 21
  311.                DL = physical drive address (0-15)
  312.  
  313.           Exit:
  314.                CY = 0 if no error
  315.                  AL = 0  drive not defined
  316.                       1  no change line
  317.                       2  change line is available
  318.                CY = 1 if error
  319.                AH = error code
  320.  
  321.  
  322.  22 - Return change line status
  323.           This function is used to return change line 
  324.           status information. 
  325.  
  326.           Entry:
  327.                AH = 22
  328.                DL = physical drive address (0-15)
  329.  
  330.           Exit:
  331.                CY = 0 if AH = 0
  332.                CY = 1 if AH not 0
  333.                AH = 0  change signal not active
  334.                     6  change signal active
  335.  
  336.  
  337.  23 - Set DASD type for format
  338.           This function is used to set some parameters before a 
  339.           format operation. This function is provided for system 
  340.           BIOS compatibility.  The use of function 9 is preferred 
  341.           for new programs.
  342.  
  343.           Entry:
  344.                AH = 23
  345.                AL = 1  360KB diskette in 360KB drive
  346.                     2  360KB diskette in 1.2MB drive
  347.                     3  1.2MB diskette in 1.2MB drive
  348.                     4  720KB diskette in 720KB drive
  349.                DL = physical drive address (0-15)
  350.  
  351.           Exit:
  352.                CY = 0 if no error
  353.                CY = 1 if error
  354.                AH = error code
  355.  
  356.  
  357.  24 - Set media type for format
  358.           This function is used to set some parameters before a 
  359.           format operation. This function is provided for system 
  360.           BIOS compatibility.  The use of function 9 is preferred 
  361.           for new programs.
  362.  
  363.           Entry:
  364.                AH = 24
  365.                CL = number of sectors per track
  366.                CH = number of cylinders
  367.                DL = physical drive address (0-15)
  368.  
  369.           Exit:
  370.               ES:DI = pointer to 11 byte diskette drive parameter
  371.                       table associated with the specified media
  372.                       type
  373.                CY = 0 if error code is 0
  374.                CY = 1 if error code is not 0
  375.                AH = error code
  376.