From owner-freebsd-hackers Thu Jan 10 15:50:29 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (Postfix) with ESMTP id 009BD37B421 for ; Thu, 10 Jan 2002 15:50:12 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.9.3/8.9.3) with UUCP id AAA02896; Fri, 11 Jan 2002 00:50:05 +0100 (CET) Received: (from j@localhost) by uriah.heep.sax.de (8.11.6/8.11.6) id g0ANkr675063; Fri, 11 Jan 2002 00:46:53 +0100 (MET) (envelope-from j) Date: Fri, 11 Jan 2002 00:46:53 +0100 From: Joerg Wunsch To: Julian Stacey Cc: Terry Lambert , Nils Holland , freebsd-hackers@freebsd.org Subject: Re: FreeBSD Floppy driver needs enhancement... Message-ID: <20020111004653.A69116@uriah.heep.sax.de> Reply-To: Joerg Wunsch References: <200201102126.g0ALQeA55983@jhs.muc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200201102126.g0ALQeA55983@jhs.muc.de>; from jhs@jhs.muc.de on Thu, Jan 10, 2002 at 10:26:40PM +0100 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG As Julian Stacey wrote: > Would be nice, Joerg W. (cc'd) looked in that direction somewhat > I recall, I can't remember how far he got, I do recall some patches > I didnt get to try, can't remember quite what for, Joerg, can > you recall ? Use "fdread -r" for this (FreeBSD-current only). > Anyway, if anyone does offer such a read(), I'll add it to valid(). Well, it's not that simple. Have a look at how fdread implements it... Basically, there's no way how a Unix read(2) can both return (erroneous) data /and/ simultaneously notify the caller there has been an error. The hack is that you explicitly need to turn off driver error reporting once you know about your bad sector, then read the sector with error reporting turned off, and eventually turn it on again to continue. -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message