Topic:  Int 13h 

  Interrupt:   13h

  Title:       Disk I/O Interrupts

  See also:    Diskette Data Memory

  Function     Name

  00h          Reset Disk System
  01h          Get Disk System Status
  02h          Read Sector
  03h          Write Sector
  04h          Verify Sector
  05h          Format Track
  06h          Format Bad Track
  07h          Format Drive
  08h          Get Drive Parameters
  09h          Initialize Fixed Disk Characteristics
  0Ah          Read Sector Long
  0Bh          Write Sector Long
  0Ch          Seek
  0Dh          Reset Fixed Disk System
  0Eh          Read Sector Buffer
  0Fh          Write Sector Buffer
  10h          Get Drive Status
  11h          Recalibrate Drive
  12h          Controller RAM Diagnostic
  13h          Controller Drive Diagnostic
  14h          Controller Internal Diagnostic
  15h          Get Disk Type
  16h          Get Disk Change Status
  17h          Set Disk Type
  18h          Set Media Type for Format
  19h          Park Heads
  1Ah          Format ESDI Drive
                                    -o-
Topic:  Int 13h Function 01h 

  Interrupt:   13h     Function:   01h

  Title:       Get Disk System Status

  Description:                                          [PC] [AT] [PS/2]

     Returns the status of the most recent disk operation. On fixed
     disks, error code 11h (ECC data error) indicates that a
     recoverable error was detected during a preceding Read Sector (Int
     13h Function 02h) function.

     Input                         Output

     AH = 01h                      AH = 00h
     DL = Drive                    AL = Status of previous disk operation
        = 00h-7Fh  floppy disk        = 00h      No error
        = 80h-FFh  fixed disk         = 01h      Invalid command
                                      = 02h      Address mark not found
                                      = 03h      Disk write-protected (F)
                                      = 04h      Sector not found
                                      = 05h      Reset failed (H)
                                      = 06h      Floppy disk removed (F)
                                      = 07h      Bad parameter table (H)
                                      = 08h      DMA overrun (F)
                                      = 09h      DMA crossed 64K boundary
                                      = 0Ah      Bad sector flag (H)
                                      = 0Bh      Bad track flag (H)
                                      = 0Ch      Media type not found (F)
                                      = 0Dh      Invalid number of sectors
                                                 on format (H)
                                      = 0Eh      Control data address mark
                                                 detected (H)
                                      = 0Fh      DMA arbitration level out
                                                 of range (H)
                                      = 10h      Uncorrectable CRC* or ECC.
                                                 data error
                                      = 11h      ECC corrected data error
                                                 (H)
                                      = 20h      Controller failed
                                      = 40h      Seek failed
                                      = 80h      Disk timed-out
                                                 (failed to respond)
                                      = AAh      Drive not ready (H)
                                      = BBh      Undefined error (H)
                                      = CCh      Write fault (H)
                                      = E0h      Status register error (H)
                                      = FFh      Sense operation failed (H)

     H = Fixed disk only
     F = Floppy disk only
     * Cyclic Redundancy Check code
     . Error Checking and Correcting code
                                    -o-
Topic:  Int 13h Function 02h 

  Interrupt:   13h     Function:   02h

  Title:       Read Sector

  Description:                                          [PC] [AT] [PS/2]

     Reads one or more sectors from disk into memory.

     Input                                  Output

     AH = 02h                               If function successful
     AL = Number of sectors                   Carry flag: clear
     CH = Cylinder                            AH = 00h
     CL = Sector                              AL = Number of sectors
     DH = Head                                     transferred
     DL = Drive
        = 00h-7Fh floppy disk               If function unsuccessful
        = 80h-FFh fixed disk                  Carry flag: set
     ES:BX = segment:offset of buffer         AH = Status
                                                   See: Int 13h Function 01h
                                    -o-
Topic:  Int 13h Function 03h 

  Interrupt:   13h     Function:   03h

  Title:       Write Sector

  Description:                                          [PC] [AT] [PS/2]

     Writes one or more sectors from memory to disk.

     Input                                Output

     AH = 03h                             If function successful
     AL = Number of sectors                 Carry flag: clear
     CH = Cylinder                          AH = 00h
     CL = Sector                            AL = Number of sectors
     DH = Head                                   transferred
     DL = Drive
        = 00h-7Fh floppy disk             If function unsuccessful
        = 80h-FFh fixed disk                Carry flag: set
     ES:BX = segment:offset of buffer       AH = Status
                                                 See: Int 13h Function 01h
                                    -o-
Topic:  Int 13h Function 02h 

     On fixed disks, the upper 2 bits of the 10-bit cylinder number are
     placed in the upper 2 bits of register CL.

     On fixed disks, error code 11h indicates that a read error
     occurred that was corrected by the ECC algorithm; in this event,
     register AL contains the burst length. The data returned is
     probably good, although there is a small chance that the data was
     not corrected properly. If a multisector transfer was requested,
     the operation was terminated after the sector containing the read
     error.

     On floppy disk drives, an error may result from the drive motor
     being off at the time of the request. The ROM BIOS does not
     automatically wait for the drive to come up to speed before
     attempting the read operation. The requesting program should reset
     the floppy disk system (Int 13h Function 00h) and retry the
     operation three times before assuming that the error results from
     some other cause.
                                    -o-
