From owner-freebsd-stable@FreeBSD.ORG Thu Sep 18 16:18:48 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 130381065675; Thu, 18 Sep 2008 16:18:48 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 80E0E8FC0C; Thu, 18 Sep 2008 16:18:47 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id m8IGIjOv050391; Thu, 18 Sep 2008 18:18:45 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id m8IGIj2P050390; Thu, 18 Sep 2008 18:18:45 +0200 (CEST) (envelope-from olli) Date: Thu, 18 Sep 2008 18:18:45 +0200 (CEST) Message-Id: <200809181618.m8IGIj2P050390@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, talon@lpthe.jussieu.fr, jhb@FreeBSD.ORG In-Reply-To: <20080918075306.GA30709@lpthe.jussieu.fr> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 18 Sep 2008 18:18:46 +0200 (CEST) Cc: Subject: Re: floppy disk controller broken X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, talon@lpthe.jussieu.fr, jhb@FreeBSD.ORG 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 16:18:48 -0000 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 -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "The most important decision in [programming] language design concerns what is to be left out." -- Niklaus Wirth