Re: CDROM: Hardware tray movement detection

James Mastros (root@jennifer-unix.dyn.ml.org)
Tue, 26 Aug 1997 23:39:40 -0400 (EDT)


On Tue, 26 Aug 1997, Ricky Beam wrote:
> Letting the chips fall where they may, I quote Tim P. Gerla:
> >My question:
> >
> >Is there any way to detect *hardware* tray movement, and afterward, detect
> >a disk change?
>
> I'm sure there the drive will generate any async event to notify you of a
> disk being inserted -- well, some SCSI drives might. The easiest way would
> be to install a self-renewing kernel timer to "poll" the drive for a disk
> change. Most other OSs that support media change detection do that -- Win95,
> WinNT, Solaris, ... And, it has the virtue of being down-right simple.
>
> Once auto media change detection is available, all sorts of things become
> possible. I, for one, have a drive that closes the tray when polled, so
> workman is constantly closing the drive while I'm change the CD -- not good.
>
> --Ricky

I'm not quite certian that I follow you: your CD drive closes when it is
queried what disk it has in it. Then you appear to say that you want the
kernel to poll peridocly instead of userspace. Wouldn't this have the same
effect (the CD drive dosn't know about userspace/kernelspace)?

In any case, hardware media change detection sounds like a Good Thing. You
need to watch out, however, that the cd-rom is running DMA. Otherwise, you
will freeze up every poll interval, and that would be a Bad Thing.

-=- James Mastros