              README FOR LINUX SONY CDU-535/531 DRIVER
              ========================================

This is the third release of the Sony CDU-535 (and 531) driver for
Linux.  There are no new features or bug fixes in this release.
It just brings the patches up to a more recent kernel (0.99p12/p13) .
I do not think I will have the time to add new features
like DMA support so if anyone else wants to pursue it, please do.

IMPORTANT: If you are using the first release of this driver, note that
           the device number has changed from 15 to 21, you will have 
           to recreate your devices!

This package contains a linux device driver for the Sony CDU-535
CDROM drive.  This is one of the older Sony drives with its own interface
card (Sony bus).  The DOS driver for this drive is named SONY_CDU.SYS -
when you boot DOS your drive should be identified as a SONY CDU-535.  The
driver probably works with a CDU-531 also since I used that drive's
documentation to write the driver -- Sony said they were very similar. 
One user reported that the driver worked on drives OEM'ed by Procomm, 
drive and interface board were labelled Procomm.

The linux driver is based on Corey Minyard's sonycd 0.3 driver for the
CDU-31A.  I just changed the commands that were sent to the drive to
correspond to the CDU-535 commands and registers.  There were enough
changes to let bugs creep in but it seems to be stable.  I was able to
tar an entire CDROM (should read all blocks) and built ghostview and
xfig off Walnut Creek's X11R5/GNU CDROM.  xcdplayer and workman work
with the driver.  Others have used the driver without problems except
those dealing with wait loops (fixed in this release).  Like Minyard's
original driver this one uses a polled interface (this is also the
default setup for the DOS driver).  I have not tried it with interrupts
or DMA enabled on the board.

REQUIREMENTS
============

	- Sony CDU-535 drive, preferably without interrupts and DMA 
	  enabled on the card.

	- Drive must be set up as unit 1.  Only the first unit will be 
	  recognized

	- linux kernel source and gcc compiler

FILES
=====
	README		- this file
	sony535-0.3.diffs - diffs to the kernel necessary for the driver
	CHANGES		- list of changes between this version and previous
			  versions of the driver

INSTALLATION
============

1. Untar the distribution someplace.  (Ok, so you've already done that.)
   For the examples below I assume that you untar into the /usr/src/sony535-0.3
   directory.

	cd /usr/src
	gunzip -c sony535-0.3.tar.gz | tar xvf -

2. Apply the patch sony535-0.3.diffs in the directory that holds the
   linus source directory (normally /usr/src).  This is where you
   normally apply patches.  I.E., if linux is in /usr/src/linux,
   apply the patch in /usr/src.

	cd /usr/src
	patch -p0 <sony535-0.3/sony535-0.3.diffs >& patch.log

   This will patch cleanly with the Linux 0.99p12 kernel.
   If you have applied other patches (such as the
   SLS ones) check patch.log to see if any of the patches failed.  If
   they did, you will have to make the changes by hand.

3. If your Sony interface card is not at the default address of 0x340,
   you will have to modify the file linux/kernel/blk_drv/sonycd535.c, 
   changing the CDU535_ADDRESS define on line 122 to the address on
   your board.  If you are not sure of your board address, check
   the documentation and jumpers or check your CONFIG.SYS file
   under MSDOS. In CONFIG.SYS, the address is given using the /B parameter
   to the SONY_CDU.SYS driver (except don't put the 'H' at the end).  Enter
   the same number in hex (put 0x in front of the number).

4. Make a device with major number 21, minor number 0.  Use the command:

	mknod /dev/cdu535 b 21 0

   Then create a symbolic link from /dev/cdu535 to /dev/cdrom:

		ln -s /dev/cdu535 /dev/cdrom

   This link will allow SCSI and Sony drive to be handled with the same
   drivers.  Minyard wrote the Sony driver to have the same IOCTL interface
   as the SCSI driver, so commands should work fine on both.  If you
   want to run something that expects a SCSI CDROM drive, create a
   symbolic from /dev/cdu535 to /dev/sr0 (useful for workman)

	rm /dev/sr0
	ln -s /dev/cdu535 /dev/sr0

5. Reconfigure the kernel (make config) and answer "y" to the Sony CDU-535
   CDROM prompt.  Make sure you also answer "y" when it asks if you want 
   the ISO9660 filesystem.  This is the filesystem used by CD-ROMs.  Do a 
   "make dep", "make clean", then rebuild the kernel ("make").  Make a
   boot floppy using the command "make zdisk" (make sure a new floppy
   is in the A: drive).

6. Reboot and try it out.  If all goes well you will get a message
   during startup saying that the Sony CDROM drive was found.  The command 
   to mount a CDROM is:

	mount -r -t iso9660 /dev/cdrom /cdrom

   (Make the directory /cdrom first if it does not already exist.)

NOTES:
======

1) The drive MUST be turned on when booting or it will not be recognized!

2) when the cdrom device is opened I disable the eject button to keep the
   user from ejecting a mounted disk and replacing it with another.
   Unfortunately xcdplayer and workman also open the cdrom device so you
   have to use the eject button in the software.  Keep this in mind if your
   cdrom player refuses to give up its disk -- exit workman or xcdplayer, or
   umount the drive if it has been mounted.

THANKS
======

Thanks to Corey Minyard who wrote the original CDU-31A driver on which
this driver is based.  Thanks to Ken Pizzini and Bob Blair who provided 
patches and feedback on the first release of this driver.

Ron Jeppesen
ronj.an@site007.saic.com
