[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Experimental floppy drive detection. Please test.



>  This is the best way I can find of doing floppy detection, other than
>  grepping / sedding the `dmesg' output. (which might really be better
>  since that won't hang for 20-30 seconds trying to open /dev/fd1.)
>  This method is pretty much the same one used by libdetect.  It will
>  also hang for a time on attempting to open /dev/fd1 when it does not
>  exist.  If we decided to grep the `dmesg' output, then a line should
>  be added to the rcS that will dump it to a file at boot, so the part
>  we need won't scroll away after a while.
> 
>  It's weird, because when I open /dev/fd0, which exists, and there is
>  no floppy in the drive, I get an error return from open(), and thus
>  -1 for a file descriptor (and errno is ENXIO).  But when I open
>  /dev/fd1, which does NOT exist, it hangs out for about 20-30 seconds,
>  then returns a file descriptor.  I then have to run an ioctl on that
>  descriptor, and check for an ENODEV.  Weird.  I wish the floppy
>  drives had a listing in the /proc filesystem, like the cdrom's do.
>  That would make this much simpler and there would not be a long pause
>  during the initial detection.

Do not grep dmesg. All the archs and all the drivers have possibly
different ways to printk() this output, and we don't have enough time to
figure out all that. Why not ioctl the devices? If it returns with an
error, then it doesn't exist.

Anyway, IMHO, this is wasted time. With woody and devfs, we wont need to
do any of this. Just opendir and cycle the dirent's in /dev/floppy/ and
you are done. Nothing will exist in there if it isn't configured. Same
goes for cdroms in /dev/cdroms/. Please work on things that are bug fixes,
not features, when we are so close to having a stable dbootstrap. We don't
need to add things that are so untested, and possibly break other things
in the process.

-- 
 -----------=======-=-======-=========-----------=====------------=-=------
/  Ben Collins  --  ...on that fantastic voyage...  --  Debian GNU/Linux   \
`     bcollins@debian.org  --  bcollins@openldap.org  --  bmc@visi.net     '
 `---=========------=======-------------=-=-----=-===-======-------=--=---'


Reply to: