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

Re: OK to use timer to periodically check device status?



Nope, the new drives (ATAPI drives) can be put into "Media Status
Notification" mode, and then when you perform a "GET MEDIA STATUS", they'll
tell you whether the user has inserted a disk, changed disks, or press the
eject button. This means we can "know" whether the disk has been changed
without actually reading the disk, but then we must read the disk to get the
new partition table. Don't have to repeatedly read the disk once that is
done, though :-)

----- Original Message -----
From: "Jamie Harris" <jamie.harris@uwe.ac.uk>
To: "Kevin P. Fleming" <kevin@labsysgrp.com>
Cc: <kernelnewbies@nl.linux.org>
Sent: Friday, May 18, 2001 11:18 AM
Subject: Re: OK to use timer to periodically check device status?


> Is this the same sort of polling that the Amiga's used to use to wear out
> their drives in 3 months?  Don't the mtools offer something similiar
> (with the warnings about wearing your floppy drives out).  Of do the new
> floppies provide some nice flag that is set on media change?
>
> cheers
>
> Jamie...
>
> On Fri, 18 May 2001, Kevin P. Fleming wrote:
>
> > I'm a true kernel programming newbie... been browsing the code for
years,
> > and made some small patches, but now it's time for something more
> > significant...
> >
> > The current ide-floppy driver has no useful "media change notification"
> > mechanism, and this causes problems for me and others. I can rectify
this,
> > but the mechanism to do so will require polling the device (probably
once
> > per second or so) for its status.
> >
> > After looking around, it appears that the best way to accomplish this
would
> > be to create a lightweight timer handler function (minimal code
included)
> > and add a kernel timer to invoke that once per second. If the handler
finds
> > significant work to do, should it do it, or queue a task for "later" to
do
> > that? (that work could cause the drive's media to spun up and the
partition
> > table to read, among other things)
> >
> > Anything significantly wrong with this approach? My intention is to make
> > this feature a kernel config selectable option if you choose to include
the
> > ide-floppy driver (and mark it experimental, of course).
> >
> > -
> > Kernelnewbies: Help each other learn about the Linux kernel.
> > Archive:       http://mail.nl.linux.org/
> > IRC Channel:   irc.openprojects.net / #kernelnewbies
> > Web Page:      http://www.kernelnewbies.org/
> >
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  ***    Slowly and surely the UNIX crept up on the Nintendo user...    ***
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/ED d-(++) s:+ a- C+++>++++$ U+++>$ P++++ L+++>+++++ E+(---) W++ N o?
> K? w(++++) O- M V? PS PE? Y PGP- t+ 5 X- R- tv- b++ DI++ D+++ G e++ h*
> r++>+++ y+++
> ------END GEEK CODE BLOCK------
>
>
>
>

-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/