From owner-freebsd-stable@FreeBSD.ORG Thu Sep 18 18:48:31 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32770106564A for ; Thu, 18 Sep 2008 18:48:31 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA03.westchester.pa.mail.comcast.net (qmta03.westchester.pa.mail.comcast.net [76.96.62.32]) by mx1.freebsd.org (Postfix) with ESMTP id CF92E8FC12 for ; Thu, 18 Sep 2008 18:48:30 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA06.westchester.pa.mail.comcast.net ([76.96.62.51]) by QMTA03.westchester.pa.mail.comcast.net with comcast id GBbW1a00216LCl053JoWqw; Thu, 18 Sep 2008 18:48:30 +0000 Received: from koitsu.dyndns.org ([67.180.253.227]) by OMTA06.westchester.pa.mail.comcast.net with comcast id GJoV1a0034v8bD73SJoV0G; Thu, 18 Sep 2008 18:48:30 +0000 X-Authority-Analysis: v=1.0 c=1 a=QycZ5dHgAAAA:8 a=cyMd1-_WO_i_suH5e24A:9 a=SsXy2l0EPFDNe3jcsMwA:7 a=36TZWzMwRJ30XmDbqOa1PuOHffgA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id EC1F317B81A; Thu, 18 Sep 2008 11:48:28 -0700 (PDT) Date: Thu, 18 Sep 2008 11:48:28 -0700 From: Jeremy Chadwick To: Michel Talon , freebsd-stable@FreeBSD.ORG, jhb@FreeBSD.ORG Message-ID: <20080918184828.GA25072@icarus.home.lan> References: <20080918075306.GA30709@lpthe.jussieu.fr> <200809181618.m8IGIj2P050390@lurza.secnetix.de> <20080918183250.GA48347@lpthe.jussieu.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080918183250.GA48347@lpthe.jussieu.fr> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Subject: Re: floppy disk controller broken X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Sep 2008 18:48:31 -0000 On Thu, Sep 18, 2008 at 08:32:50PM +0200, Michel Talon wrote: > On Thu, Sep 18, 2008 at 06:18:45PM +0200, Oliver Fromme wrote: > > Michel Talon wrote: > > > John Baldwin wrote: > > > > It looks like the ioctl to format a track used to never report failures from > > > > the controller. The newer driver does. What I've done with fdformat is to > > > > make it just ignore the errors in userland instead. Try this: > > > > > > > > Index: fdformat.c > > > > =================================================================== > > > > --- fdformat.c (revision 183112) > > > > +++ fdformat.c (working copy) > > > > @@ -75,8 +75,7 @@ > > > > f.fd_formb_secno(i) = il[i+1]; > > > > f.fd_formb_secsize(i) = secsize; > > > > } > > > > - if(ioctl(fd, FD_FORM, (caddr_t)&f) < 0) > > > > - err(EX_OSERR, "ioctl(FD_FORM)"); > > > > + (void)ioctl(fd, FD_FORM, (caddr_t)&f); > > > > } > > > > > > > > static int > > > > > > This doesn't work any more. This time i get > > > niobe# fdformat fd0 > > > Format 1440K floppy `/dev/fd0'? (y/n): y > > > Processing EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE done. > > > > > > where only the first E takes some time to be printed, and all subsequent > > > ones are printed instantaneously, that is all other formatting is not > > > tried. In principle the formatting process must try each of the > > > "sectors" in turn, and can come up with a series of V and F. > > > > > > Moreover, trying to write to the floppy: > > > niobe# dd if=/dev/zero of=/dev/fd0 conv=noerror > > > dd: /dev/fd0: Input/output error > > > 5+0 records in > > > 4+0 records out > > > 2048 bytes transferred in 4.054404 secs (505 bytes/sec) > > > > > > I don't expect such result. Traditionnally writing works, while reading > > > may fail. > > > > Maybe I misunderstand what you're saying, but ... > > When I try to write to a floppy that has *not* been > > successfully formatted, I very much expect to get > > Input/output error. Anything else would be a bug. > > > > Best regards > > Oliver > > The floppy has certainly be formatted, in the past. Perhaps i > remember badly, i have not used floppies since years, but > in this case the behavior with Windows, Linux and ancient FreeBSD > was that you could write to the floppy, but could encounter errors > while reading. Using dd conv=noerror allowed to recover the valid part. > Under Windows you could very well use floppies partly damaged with > bad blocks or tracks. Here the driver seems to bail out at the first > error, so that the above commands run much faster than they should, > a few seconds, while something of the order of a minute should be > more realistic. I swore in older FreeBSD (2.x days?) there was a command which was actually used for dealing with bad sectors on floppy disks. I might be thinking of badsect(8), can't remember... -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |