public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Asynchronous CDROM Events in Userland
@ 2002-02-04  4:41 Calin A. Culianu
  2002-02-04  5:07 ` H. Peter Anvin
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Calin A. Culianu @ 2002-02-04  4:41 UTC (permalink / raw)
  To: linux-kernel


Is there any way, other than by polling, to have a user process be
notified of a change in status on a cdrom drive?  (Such as if the drive
opens, closes, gets new media, etc)?

Also, come think of it, other types of asynchronous events would be nice
too, like when a cdrom usb device gets hot-plugged into the system, etc.

The current ioctls are inadequate for this type of thing (they are
synchronous in nature). One nice thing would be if we can register SIGUSR
or other types of signals with the cdrom driver(s) so that it can notify a
user process of (cdrom) events it may be interested in.

The reason I ask this is that the current autorun program that comes with
kde is very inefficient because it polls the cdrom drives.  Also, this
program is completely unable to determine that a usb device has come
online, because it basically can't differentiate between bogus /etc/fstab
entries and offline usb devices.

At any rate, if anyone can suggest a way to asynchronously receive cdrom
events in userland, it would be appreciated.

If not what do you guys think about extensions to the cdrom drivers to
handle these types of things?



^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: Asynchronous CDROM Events in Userland
@ 2002-02-05 13:17 David Balazic
  0 siblings, 0 replies; 21+ messages in thread
From: David Balazic @ 2002-02-05 13:17 UTC (permalink / raw)
  To: hpa, linux-kernel@vger.kernel.org

H. Peter Anvin (hpa@zytor.com) wrote :

>Calin A. Culianu wrote:
>
> >>>
> >>Does it spin up the CD-ROM doing so?
> >>
> >
> > Probably it doesn't, but just having the cpu be non-idle when it could
> > otherwise be idle does add up over time. In linux, polling the cdrom
> > *seems* inexpensive enough, but if you look at 'top' it seems to average
> > out to like 1-2% cpu time! (Ok, these stats aren't super-accurate,
> > they're just from running 'top' with the kde autorun tool running).
> >
> > [Admitedly, the autorun tool is written kind of strangely (it does one
> > redundant ioctl, plus it wait()s on its children constantly rather than
> > installing a signal handler), but still.. it would be nice to get those
> > extra cycles for quake3 or wolfenstein...]
> >
> 
> That just indicates a bullsh*t program. It's also pretty certain that

Oh, you didn't see magicdev yet ? :-)
( it is the GNOME counterpart of autorun, only worse )

> these kinds of things don't belong in the GUI; one of the things I'd
> like to do at some point is to write a daemon to mount things on insert
> (vold).

Pleeeeeaaaase do this soon !
Removable media handling in linux just sux. And the key linux developers
looking the other way doesn't help at all.
Maybe the work could be combined somehow with the hotplug system, as there seem
to be some similarities ?

Oh, BTW , did you in your test find any ATAPI device ( CD-ROM and/or writer )
that supports overlapped commands ( the ATA counterpart of disconnect/reconnect ) ?

>
>         -hpa


-- 
David Balazic
--------------
"Be excellent to each other." - Bill S. Preston, Esq., & "Ted" Theodore Logan
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2002-02-06 22:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-04  4:41 Asynchronous CDROM Events in Userland Calin A. Culianu
2002-02-04  5:07 ` H. Peter Anvin
2002-02-04  5:19   ` Calin A. Culianu
2002-02-04 12:43   ` john slee
2002-02-04 15:23     ` Calin A. Culianu
2002-02-04 16:20     ` H. Peter Anvin
2002-02-04  7:04 ` Erik Andersen
2002-02-04  7:57   ` Jens Axboe
2002-02-04  9:33     ` Gregor Jasny
2002-02-04  9:39       ` Jens Axboe
2002-02-04 14:05     ` hugang
2002-02-05  7:43       ` Jens Axboe
2002-02-04 12:16   ` Alan Cox
2002-02-04 20:51     ` oops booting 2.4.18-pre7-ac3 Todd M. Roy
2002-02-05  4:04 ` Asynchronous CDROM Events in Userland Stevie O
2002-02-05  4:28   ` H. Peter Anvin
2002-02-05  4:44     ` Calin A. Culianu
2002-02-05  4:47       ` H. Peter Anvin
     [not found] ` <a3l4uc@cesium.transmeta.com>
2002-02-06 14:22   ` Pavel Machek
2002-02-06 22:48     ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2002-02-05 13:17 David Balazic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox