From owner-freebsd-stable@FreeBSD.ORG Thu Sep 18 07:53:10 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 075D51065672 for ; Thu, 18 Sep 2008 07:53:10 +0000 (UTC) (envelope-from talon@lpthe.jussieu.fr) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by mx1.freebsd.org (Postfix) with ESMTP id A8E5A8FC0C for ; Thu, 18 Sep 2008 07:53:09 +0000 (UTC) (envelope-from talon@lpthe.jussieu.fr) Received: from parthe.lpthe.jussieu.fr (parthe.lpthe.jussieu.fr [134.157.10.1]) by shiva.jussieu.fr (8.14.3/jtpda-5.4) with ESMTP id m8I7r7iA017309 ; Thu, 18 Sep 2008 09:53:08 +0200 (CEST) X-Ids: 168 Received: from niobe.lpthe.jussieu.fr (niobe.lpthe.jussieu.fr [134.157.10.41]) by parthe.lpthe.jussieu.fr (Postfix) with ESMTP id 9301589E88; Thu, 18 Sep 2008 09:53:06 +0200 (CEST) Received: by niobe.lpthe.jussieu.fr (Postfix, from userid 2005) id 83FAF10B; Thu, 18 Sep 2008 09:53:06 +0200 (CEST) Date: Thu, 18 Sep 2008 09:53:06 +0200 From: Michel Talon To: John Baldwin Message-ID: <20080918075306.GA30709@lpthe.jussieu.fr> Mail-Followup-To: Michel Talon , John Baldwin , freebsd-stable@freebsd.org References: <20080917150433.GA3585@lpthe.jussieu.fr> <200809171713.39694.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200809171713.39694.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (shiva.jussieu.fr [134.157.0.168]); Thu, 18 Sep 2008 09:53:08 +0200 (CEST) X-Virus-Scanned: ClamAV 0.93.3/8275/Thu Sep 18 03:16:55 2008 on shiva.jussieu.fr X-Virus-Status: Clean X-Miltered: at jchkmail.jussieu.fr with ID 48D208E3.008 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Enveloppe: 48D208E3.008/134.157.10.1/parthe.lpthe.jussieu.fr/parthe.lpthe.jussieu.fr/ X-j-chkmail-Score: MSGID : 48D208E3.008 on jchkmail.jussieu.fr : j-chkmail score : . : R=. U=. O=. B=0.009 -> S=0.009 X-j-chkmail-Status: Ham Cc: freebsd-stable@freebsd.org 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 07:53:10 -0000 On Wed, Sep 17, 2008 at 05:13:39PM -0400, John Baldwin wrote: > On Wednesday 17 September 2008 11:04:33 am Michel Talon wrote: > > Hello, > > > > when testing FreeBSD-7.1-BETA i discovered that the floppy disk > > controller doesn't work correctly. Trying to format a floppy (perhaps > > with bad blocks) i get: > > Processing fdformat: ioctl(FD_FORM): Device not configured > > instead of the normal E letter. I then checked the same problem is > > present on FreeBSD-6.3 and it has been reported by Beech Rintoul (*) in > > 2006! Of course the floppy disk driver is particularly messy, but > > this is not pretty. > > > > (*) i386/103862: Error with fdformat > > 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 > > > -- > John Baldwin 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. Here reading fails with incoherent messages: dd: /dev/fd0: Device not configured 3+0 records in 3+0 records out 1536 bytes transferred in 2.595216 secs (592 bytes/sec) repeated a large number of times. But nothing in dmesg, contrary to the tradition which showed the defective sectors. In conclusion i am under the impression that the in kernel driver is severely botched. Of course nobody uses floppies any more, but this is quite ugly. -- Michel TALON