Subject: Re: i386 floppy driver broken?
To: Charles M. Hannum <mycroft@ai.mit.edu>
From: Jim Wight <J.K.Wight@newcastle.ac.uk>
List: netbsd-bugs
Date: 05/02/1995 10:29:14
"Charles M. Hannum" writes:
>
> > You want /dev/rfd0f.
>
> Does that mean that the comments in /sys/arch/i386/isa/fd.c are wrong then?
>
> [Table omitted.]
>
> Those comments do *not* specify any mapping from the minor number to
> the partition letter. Therefore, your question doesn't make sense.
Is the relationship between the minor number and partition letter
documented anywhere then? If it isn't (I didn't find it) then I think
I made quite a reasonable assumption. The only half-relevant
information I came across was in the 386bsd-faq which porportedly has
some relevance to NetBSD:-
6.5 How can I use mtools with the 'new' floppy naming convention?
With the adoption of BSD 4.4, there is a new way of accessing
the floppy disk drive types. The method uses the minor device
number to specify different media sizes and densities. These
densities are established by a table from the file
/usr/src/sys/arch/i386/isa/fd.c (in NetBSD, your mileage may
vary). The table in FreeBSD's fd.c is likely to be slightly
different.
The order of the entries defines the order of the minor
numbers, so the table below has the following characteristics:
/dev/fd0a 1 /* 1.44MB diskette */
/dev/fd0b 2 /* 1.2 MB AT-diskettes */
/dev/fd0c 3 /* 360kB in 1.2MB drive */
/dev/fd0d 4 /* 360kB PC diskettes */
/dev/fd0e 5 /* 3.5" 720kB diskette */
/dev/fd0f 6 /* 720kB in 1.2MB drive */
/dev/fd0g 7 /* 360kB in 720kB drive */
struct fd_type fd_types[] = {
{ 18,2,0xff,0xcf,0x1b,0x6c,80,2880,1,FDC_500KBPS,2,"1.44MB" },
{ 15,2,0xff,0xdf,0x1b,0x54,80,2400,1,FDC_500KBPS,2,"1.2MB" },
{ 9,2,0xff,0xdf,0x23,0x50,40, 720,2,FDC_300KBPS,2,"360KB/AT"},
{ 9,2,0xff,0xdf,0x2a,0x50,40, 720,1,FDC_250KBPS,2,"360KB/PC"},
{ 9,2,0xff,0xdf,0x2a,0x50,80,1440,1,FDC_250KBPS,2,"720KB" },
{ 9,2,0xff,0xdf,0x23,0x50,80,1440,1,FDC_300KBPS,2,"720KB/x" },
{ 9,2,0xff,0xdf,0x2a,0x50,40, 720,2,FDC_250KBPS,2,"360KB/x" },
};
In my original message I stated that I had apparently achieved >360KB
out of /dev/fd0e (mounted -t msdos) by copying the GENERICAHA kernel
(659600 bytes) to it. After the copy 'ls -l' showed the copied file to
have the same size as the original. However, I have now looked into
this further and discover that when I compare the two files cmp fails
with an EOF error. Shouldn't cp have failed as well?
Jim
---
J.K.Wight@newcastle.ac.uk
Department of Computing Science, University of Newcastle, Tel: +44 191 222 8238
Newcastle upon Tyne, NE1 7RU, United Kingdom. Fax: +44 191 222 8232