Re: CDROM: Hardware tray movement detection

Ricky Beam (root@defiant.interpath.net)
Tue, 26 Aug 1997 20:37:11 -0400 (EDT)


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