>From newsserv!godzilla.zeta.org.au!bde Sat Aug 20 01:53:44 1994 From: newsserv!godzilla.zeta.org.au!bde (Bruce Evans) Newsgroups: stark.freebsd-bugs Subject: 1.1.5 fdprobe fails if cylinder > 67 Date: Thu, 4 Aug 94 00:27:25 +1000 Organization: Gene Stark's home system Distribution: stark NNTP-Posting-Host: home.stark.cs.sunysb.edu To: freebsd-bugs@freefall.cdrom.com Cc: joerg_wunsch@uriah.sax.de Precedence: bulk The floppy head is in an unknown position after booting. If it's on a cylinder > 67, then stepping it out 10 moves it to a cylinder > 77, so recalibration will set NE7_ST0_EC and fdprobe() will fail. If it's on a cylinder less than 10 from the end, then stepping it out 10 may damage it. I think the BIOS usually leaves the head near cylinder 0 and then there is no problem. I think booting from a floppy leaves it on the last cylinder accessed. My boot disk contains 2 kernels and is almost full, so at least one of them is likely to end near the last cylinder. My fix adds 1 second to the probe for each drive. The floppy probe already has 2.3 seconds of delays per drive, so it now has 3.3 seconds of annoying delays per drive :-). The diff includes some cosmetic fixes. spinwait() should not exist, and isn't called except from recent versions of fd.c. Bruce *** sysc/i386/isa/fd.c Sun May 22 22:30:14 1994 --- src/sys/i386/isa/fd.c Wed Aug 3 23:26:04 1994 *************** *** 344,352 **** /* select it */ set_motor(fdcu, fdsu, TURNON); ! spinwait(1000); /* 1 sec */ out_fdc(fdcu, NE7CMD_SEEK); /* seek some steps... */ out_fdc(fdcu, fdsu); out_fdc(fdcu, 10); ! spinwait(300); /* ...wait a moment... */ out_fdc(fdcu, NE7CMD_SENSEI); /* make controller happy */ (void)in_fdc(fdcu); --- 345,359 ---- /* select it */ set_motor(fdcu, fdsu, TURNON); ! DELAY(1000000); /* 1 sec */ ! out_fdc(fdcu, NE7CMD_RECAL); /* avoid seeking off end */ ! out_fdc(fdcu, fdsu); ! DELAY(1000000); /* a second be enough for full stroke seek */ ! out_fdc(fdcu, NE7CMD_SENSEI); /* make controller happy */ ! (void)in_fdc(fdcu); ! (void)in_fdc(fdcu); out_fdc(fdcu, NE7CMD_SEEK); /* seek some steps... */ out_fdc(fdcu, fdsu); out_fdc(fdcu, 10); ! DELAY(300000); /* ...wait a moment... */ out_fdc(fdcu, NE7CMD_SENSEI); /* make controller happy */ (void)in_fdc(fdcu); *************** *** 354,358 **** out_fdc(fdcu, NE7CMD_RECAL); /* ...and go back to 0 */ out_fdc(fdcu, fdsu); ! spinwait(1000); /* a second be enough for full stroke seek */ /* anything responding */ --- 361,365 ---- out_fdc(fdcu, NE7CMD_RECAL); /* ...and go back to 0 */ out_fdc(fdcu, fdsu); ! DELAY(1000000); /* a second be enough for full stroke seek */ /* anything responding */ *************** *** 735,739 **** bad: biodone(bp); - return; } --- 742,745 ----