Re: Of removable devices

From: Erik Andersen (andersen@xmission.com)
Date: Wed Feb 16 2000 - 15:30:56 EST


On Wed Feb 16, 2000 at 08:39:31PM +0100, David Balazic wrote:
>
> For automatic program start ( for those who want it ) a simplified demon
> might be used :
>
> for(EVER){
> wait_for_CD_insertion(); /* code can be ripped from magicdev or
> autorun */
> system(CD_PATH "/autorun"); /* autofs will mount it for us */
> }

wait_for_CD_insertion() can't sleep though. It would have to busy loop polling
the CDROM_DRIVE_STATUS ioctl (windoze does essentially this).

> (*) - this is the problem. Even if both ATA and ATAPI standards specifiy
> a method
> of infroming the host that the eject button was pressed, my cd-rom drive
> does not
> support any method for that ( or I couldn't figure it out ).
> I believe that 99 % of all ATAPI CD-ROM units ( situation with SCSI may
> be better,
> but I wouldn't bet my hat on it ) fail to support this.

Sure you can lock the drive shut and use the CDROM_SEND_PACKET ioctl to slam
out a INQUIRY packet, and if it reports that it supports Mt. Fuji, then you can
shoot out a GET_CONFIGURATION packet and read the results to see if 1) medium
can be locked 2) and supports Morphing. If all is well so far, then you can
send out a GET_EVENT/STATUS_NOTIFICATION packet and check the result to see if
the external request notification class is supported. If it is, then you can
do completely host controlled CDROM drive control (of course since no drives
supports asyncronous host event notification ("Asyncronous Morphing"), you will
need to poll the drive to see any media events.

And then there is the little problem at Mt. Fuji support
is not especially wide-spread at the moment...

 -Erik

--
Erik B. Andersen   Web:    http://www.xmission.com/~andersen/ 
                   email:  andersee@debian.org
--This message was written using 73% post-consumer electrons--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:16 EST