Re: floppy disk controller broken



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

_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: fdformat problems on Solaris 8
    ... > I have been unable to format a floppy disk with fdformat. ... First of all as far as I can tell, fdformat is intolerant of ANY errors. ... MSWindows format will suffer almost any indignity and mask out the bad ...
    (comp.unix.solaris)
  • Re: floppy disk controller broken
    ... when testing FreeBSD-7.1-BETA i discovered that the floppy disk ... controller doesn't work correctly. ... Processing fdformat: ioctl: Device not configured ... It looks like the ioctl to format a track used to never report failures from ...
    (freebsd-stable)
  • Re: How do I format a 1.44Mb floppy disk in a laser servo drive?
    ... DOS format? ... The fdformat utility does not appear to work with a floppy disk: ...
    (comp.os.linux.hardware)
  • Re: How do I format a 1.44Mb floppy disk in a laser servo drive?
    ... How can I format a 1.44Mb floppy disk in DOS ... The fdformat utility does not appear to work with a floppy disk: ...
    (comp.os.linux.hardware)
  • Re: superdrive info
    ... The Superdrive floppy disk is a 1.44M PC format capable Apple drive. ... It can read 800k Apple disks, 720k PC format and 1.44M formatted floppy disks when hooked to a the right controller. ... Oh yes, on a Mac the floppy drive works as advertised, on the II you will need the Apple 3.5" controller card, aka 'superdrive' controller. ...
    (comp.sys.apple2)