Linux-kernel mailing list archive 2000-02,: Re: cdrom for embedded systems

# Re: cdrom for embedded systems

Erik Andersen (andersen@xmission.com)
Sun, 9 Jan 2000 11:16:04 -0700

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Erik Andersen: "Re: Announce: initrd-tftp 0.1"
- Previous message: Alan Cox: "Re: token ring dev->type numbers"

On Sun Jan 09, 2000 at 11:23:28AM +0100, Netnoise wrote:
> How can I intercept when the cdrom's open button is pressed.
> My developing embedded system need to know when the user try to open the
> cdrom... how can I ?
> Thank you

CDROM drives suck in this respect. You have to lock the drive and then
poll GET_EVENT_STATUS, which isn't even guaranteed to be supported since
it is a relativly new feature. Nobody sells CDROM drives that support
async notification, so you will have to poll just like microsoft does.
If you can select the drive for your embedded system, make sure it
supports event status. I have an app lying around somewhere that I wrote
to test if drives support this or not. You can have a copy if you want
it. Also you will be making heavy use of the shiny new CDROM_SEND_PACKET
ioctl which allows you to send any packet to a cdrom drive from user
space via the uniform cdrom driver. Lastly, you are going to be getting
really cozy with the "Mt. Fuji" spec
ftp://ftp.avc-pioneer.com/Mtfuji4/Spec/
so you might as well grab a copy and start reading the section on
PACKET COMMANDS, GET EVENT/STATUS NOTIFICATION.

-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/

- Next message: Erik Andersen: "Re: Announce: initrd-tftp 0.1"
- Previous message: Alan Cox: "Re: token ring dev->type numbers"