and read a sector from
                              ; within the FAT (which ought to be
                              ; good if the disk is to work)
     push    bx
     push    cx
     push    dx
     cli
     mov     al,DRVNBR
     cmp     al,MAXDRIVE
     ja      drive_checked    ; don't check if we're looking at a hard drive
                              ; assume the hard drive is OK and ready
begin_check:
     mov     cx,3
recheck_loop:
     push    cx
     mov     bx,offset DIRBUF   ; temporarily use the directory buffer
                                ; ES:BX point to the input buffer
     mov     ah,2               ; read sectors into memory
     mov     al,1               ; # of sectors to read
     mov     ch,0               ; track
     mov     cl,4               ; sector to read -- somewhere in the FAT
     mov     dh,0               ; head #
     mov     dl,DRVNBR
     dec     dl                 ; so that drive # is in the form 0=A, 1=B
     int     13h
     pop     cx                 ; restore the count
     cmp     ah,0
     je      drive_checked      ; CF=1 means that the read failed, so retry
     mov     ah,0
     int     13h                ; reset the drive
     loop    recheck_loop
     inc     RETRIES
     cmp     RETRIES,1          ; see how many times we've been here
                                ; IBM recommends trying a BIOS call 3 times
                                ; to make sure the disk is ready.  We
                                ; give one retry if it doesn't work the
                                ; first time.  If it doesn't work the
                                ; second time, MDIR aborts.
     ja      drive_checked
     mov     al,DRVNBR
     add     al,'@'
     mov     byte ptr error_drive,al
     mov   