	WARNING WARNING WARNING -- this version is compiled with a bunch
	of debugging printfs in it. Just before my 2.3+compiler machine
	went away, I took them out but it broke, so you get the version
	with the "idle chit-chat", for which sorry. -- ian

Using Non-SUN CD-ROMs on Solaris 2.x

SCSI is a standard, right? So you can use any vendor's drive
on any SCSI system, right? Wrong. You can't always mix-n-match
due to minor inconsistencies.

The Sun-provided CD-ROM (Sony CDU-8012) has its firmware modified to
use a default blksize of 512 bytes, the UNIX standard (OK, don't flame
Sun, other big UNIX vendors like DEC do the same).  But most SCSI
CD-ROM drives default to 2048-byte blocks.  A few drives (like the
Toshiba 3401) have jumpers or DIP switches to let you select 512 or
2048.  But most, like the AppleCD (Sony CDU-8003) do not.

And indeed the Sun driver tries to set the blksize to 512. But, according
to jk@tools.de (Juergen Keil), it fails:
	Although Solaris 2.x now supports CDROM drives with 2048 bytes default
	logical block size, there are still problems with some drives. A Sony
	CDU-541 (the NeXT CDROM drive) works fine but an (unmodified) Toshiba
	XM-3301 or XM-3401 won't work.  The reason is that the harddisk
	driver doesn't set the SCSI-2 page format bit (PF) in the MODE SELECT
	command when it tries to switch the CDROM drive into 512 bytes/block
	mode.

Sun is aware of and working on this problem - expect a full fix in 2.4.
Solaris 2.3 will actually boot from an AppleCD 300 (at least on some
hardware - I have done this on a Sun IPX, with ROM rev 2.3), but it
gets in trouble when you try to mount CD-ROMs later.

To solve this same problem, Thomas.Tornblom@Nexus.Comm.SE (Thomas Tornblom)
wrote a program, available on cdrom.com's anonymous FTP server as "sun_cd.c",
which simply re-does the MODE SELECT with the correct setting. This is
best for SunOS 4.1.x; you can run it from /etc/rc.local.

However running such a program is not convenient under Solaris 2, because
of the Volume Manager. Accordingly, I have modified the device interface
in the volume manager to work with non-Sun CD-ROMs. ALL I DID WAS GLUE THE
IOCTL FROM TORNBLUM'S PROGRAM INTO THE "dev_cdrom" MODULE OF THE VOLUME
MANAGER.  I didn't write any of this stuff.  And, it should be noted, I
ONLY TESTED IT ON SOLARIS 2.3. It SHOULD work on Solaris2.2, but at
this price, I can't guarantee it!

OK, with the credits out of the way, you probably want to know how to USE
this stuff, right? Now you know you have to do this as root, so be careful, OK?

	1) copy "dev_nonsuncdrom.so.1" into /usr/lib/vold/dev_nonsuncdrom.so.1

	2) edit /etc/vold.conf, changing the line
	
		# Devices to use
		use cdrom drive /dev/dsk/c0t6 dev_cdrom.so cdrom0

	to

		use cdrom drive /dev/dsk/c0t6 dev_nonsuncdrom.so cdrom0

	3) Tell the volume manager to re-read its config file.
		You can't just send it a SIGHUP, you must re-start it.
		/etc/init.d/volmgt stop
		/etc/init.d/volmgt start
		
OK, that's it. Now drop in a HSFS or UFS CD-ROM, like that Catalyst Volume 5
you just got in the mail. If it appears in /cdrom in a minute or so, you're
cool. If you get a bunch of messages about "Warning: block size 2048
not supported", well, something didn't click, you're getting the old
behaviour. Be sure you did all the above steps. [See "warning above" for
a bunch of ioctl...OK messages -- ignore them].

Good luck.

Ian Darwin
ian@sq.com

P.S. Sun gave me the pieces I needed to build this, so that constitutes
their permission to pass on the binary derived from it. This program
is only useful on machines licensed for an running Solaris 2. ObCopNotice:

PORTIONS OF THIS PROGRAM COPYRIGHT (C) 1992, 1993 Sun Microsystems.
