Note: cdchanger requires a 2.1 kernel because it uses ioctl calls in
the IDE CDROM driver, which are not in the 2.0 kernel.

If you are using a 2.0 kernel:

While this cdchanger won't work (cdchanger.c won't compile) you can
still have the system automatically switch slots for you.  See "a
better way" further down in this file.

------------------------------------------------------------------------

		cdchanger

cdchanger is an extension of the example program in the documentation
file (/usr/src/linux/Documentation/cdrom/ide-cd) for the IDE-CDROM
driver which allows a program to change slots of an ATAPI cdrom
changer.

This version of the program has some enhancements to make it
(hopefully) easier to use.

It is normally a setuid (root) program so that it can mount and
unmount the device.  Normally, when switching to a new slot it first
checks if the device is mounted, and if so where and with what
options.  It then unmounts the device, switches to the new slot, and
then remounts the device at the same mount point with the same
options.

Options allow mounting (when not initially mounted) and ejecting a disk.

Unfortunately, ATAPI drives do not allow software to switch to a slot
which does not have a disk in,  so it is usually not possible to
eject an empty slot with software.  So you have to use the buttons.
Stupid.   Also, with earlier kernels you cannot switch to any slot if
the current slot is empty.    This is fixed in later kernels
(e.g. 2.1.90.) 

It can be built (by defining ALLOW_ORDINARY_CDROM) to work with
ordinary (non changer) cdroms, too.  With such devices obviously there
is no slot control, but the automatic unmounting and remounting
feature is available as is the eject option.  When used with tkchanger
you can at the click of a button unmount, eject and when a new disk is
inserted remount an ordinary cdrom.   (In this case you *can* eject when
the slot is empty!)





		tkchanger

A companion program, tkchanger,  is a perl/Tk interface to cdchanger.
This is invoked with the device name,  e.g.
	tkchanger /dev/hdd

This uses the -v (verbose) option of cdchanger to check the device is a
suitable ATAPI changer,  and find how many slots it has.
(Or with a cdrom if cdchanger was build with ALLOW_ORDINARY_CDROM defined.)

It then pops up a little window with a circle for each slot.
Different colours show whether the slot is empty or has a disk, and
which the current disk is.   An extra pop-up window allows controlling
certain options,  and specifically mounting or unmounting.



		credits

cdchanger is extended from:
* Original code (cdload) by Gerhard Zuber <zuber@berlin.snafu.de>.
* Rewritten (cdchange) for the new common cdrom driver interface by
* Erik Andersen <andersee@et.byu.edu>. 
* nahshon@VNET.IBM.COM advised that clearing the O_NOBLOCK status was
  necessary to avoid a condition where the door remained locked.
* Piniek (aka Piotr Ingling) <pingling@elka.pw.edu.pl> pointed out a
  silly bug when ALLOW_ORDINARY_CDROM was defined.




		a better way...

The idea behind cdchanger was to make it easy to switch disks,
without having to specifically unmount an remount each time.   It does
this.   However,  there is a nicer way of doing it -- to have all
slots' disks mounted at different mount points automatically.
See the file Using-autofs for how to do this.


Please let me know of any problems or suggestions.

Richard Sharman <rsharman@magma.ca>
