From: Bruce.Weinel@p1.f456.n632.z3.fidonet.org (Bruce Weinel)
Newsgroups: comp.periphs.scsi
Subject: Are unsolicited interrupts possible?
Date: Sun, 13 Dec 1992 06:13:51

jeffj@krfiny.uucp (J. Jonas) was heard in "The Pit" saying to  All

  JJ> Can SCSI devices give unsolicited interrupts for things like "I am
  JJ> being turned off"  "my disk is being ejected" "a CD-ROM has just been
  JJ> inserted"  "I feel sick"?
  JJ> 
  JJ> Apple floppy disks don't have an eject button: you must eject the
  JJ> floppy by software control (or use the emergency eject button). (BTW:
  JJ> the Sun Sparcstations do the same thing). Do the Apple CD-ROM players
  JJ> have an eject button? (I don't have one nor have I seen one).

Yes and no. My LMSI drive has no eject button (inserting the ISO carrier
extracts
the disk, but don't do it), my Toshiba has an electronic eject button (which
is disabled by SCSI command) and my Matsushita [Panasonic] has a mechanical
eject button (that shouldn't be used). On a Macintosh the system must know
that
a disk is going TO BE (not HAS BEEN) removed in order to permit the desktop
to be updated before the medium is removed.

Even though this rationale does not apply to CD ROM devices, which can't be
updated, that is how the drivers work. Therefore, eject a CD ROM just like a
floppy or Syquest: drag it to the trash. For multi-session/partition ROMS,
drag
_all_ icons to the trash. After the icon has been removed from the desktop the
disk will be ejected (Toshiba) or a dialog box will appear (Matsushita)
telling
you its safe to eject it or you can manually remove it (LMSI). Failure to
follow
this procedure will seriously confuse the system software.

  JJ> What happens if you press the eject button. I can guess
  JJ> 
  JJ> a) nothing: during the CPU's powerup, the CD-ROM player was sent a
  JJ> command to disable the eject button. But does pushing the button set a
  JJ> status bit that can be read back to see if the button was pressed?

Most likely, but it depends on the device and its driver.

  JJ> b)it causes an interrupt but won't eject the disk: during the CPU's
  JJ> powerup, the CD-ROM player was sent a command to disable the eject
  JJ> button. Pressing the button won't cause a local disk unload, but
  JJ> informs the bus master that the drive needs attention.
  JJ> 
  JJ> (hmmm - in a multimaster environment, who is the drive to cry for
  JJ> attention.  It may not always be device 7).

Not likely, for mastering and several other reasons.
 
  JJ> Must you poll the CD-ROM drive for status to tell when a disk has been
  JJ> removed or inserted, or can the drive interrupt upon change of status?
  JJ> PC floppy drives have a 'disk changed' line (ST506 interface) that the
  JJ> controller may use to interrupt the device driver. How does SCSI do
  JJ> that? -- Jeffrey Jonas

SCSI must be polled for status, unless an operation is in progress which can
give status on completion, but the Macintosh works as explained above. In
addition,
SCSI has commands to enable/disable media removal and all of the Mac drivers
I've seen (not just CD ROM) disable removal when a unit is "mounted" (Mac
term)
and then enable removal on "unmount" of the drive.

===============================================================================
The opinions expressed by this point are not necessarily those of NCR
Australia.
    --Bruce L. Weinel            "We take customer satisfaction personally"
 * Origin: Howls from "The Pit" BBS (03) 321-3295 (3:632/456.1@fidonet)