Subject: Re: i386 floppy driver broken?
To: None <netbsd-bugs@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: netbsd-bugs
Date: 05/01/1995 08:00:24
>>> You want /dev/rfd0f.
>> Does that mean that the comments in /sys/arch/i386/isa/fd.c are
>> wrong then?
> Those comments do *not* specify any mapping from the minor number to
> the partition letter. Therefore, your question doesn't make sense.
(Well, of course the _comments_ don't _specify_ anything.) If you're
not assuming some canonical mapping between minor number and partition
letters, then how can you say "[y]ou want /dev/rfd0f"? That assumes
that /dev/rfd0f is set up to be the minor device you think/expect.
The question seems reasonable to me. If that table is indexed by minor
device number, it would appear that the comments are wrong. If not,
the answer is a simple "no", preferably with a remark explaining that
the table is not indexed that way. In neither case do I see any reason
to call into question the mapping between minor numbers and partition
letters (which really means mostly /dev entry names).
On reading the rest of fd.c, looking for uses of the fd_types[] array,
I find fd_dev_to_type(), which gets called by Fdopen(). The index into
fd_types[] appears to be _one less than_ the (low three bits of the)
minor device number, if the minor number is nonzero; minor zero
corresponds to the default type, obtained from the NVRAM at boot.
Thus, to attempt to provide a useful answer to the question, no, it
doesn't mean the comments are wrong, because the table indices are
shifted by one: first entry in the table corresponds to fd0b. Thus,
the `3.5" 720kB' entry would be fd0f. How peculiar - that's just what
mycroft said you wanted. :-)
der Mouse
mouse@collatz.mcrcim.mcgill.edu