[comp.os.minix] BUG/FIX: floppy errors on 8Mhz AT

comp13@tjalk.UUCP (02/11/87)

BUG REPPORT / FIX
=================

Problem:  couldn't read floppies on 8Mhz AT
Machine:  Kaypro 286i
          Western Digital WD1003-WA3 floppy/HD-controller
Fix:      Routine "fdc_results" (p.490, line 2841) should
          loop until "master available".



Description
-----------
   After  an operation the status-results must be collected  from 
the floppy-disk controller (FDC). This is a loop (L.2850-2861) in 
which the FDC first indicates that is ready to send them. This is 
a  handshake  by which the FDC sets a bit in the  status-word  it 
returns.
  The  current routine only asks once if the controler is  ready; 
if it is not it returns an error. On my 8Mhz machine it took more 
then once to get the status (I didn't count how many times; I set 
the loop-count to 20).

My replacement code is:

2852      j=0; do {
2852a          port_in (FDC_STATUS, &master);
2852b     } while ((status & MASTER)==0 && j++ <MASTER_WAIT);

All linenumbers refer to the book.