From: ishikawa@ds5200.personal-media.co.jp (Chiaki Ishikawa)
Newsgroups: comp.sys.sun.hardware,comp.sys.sun.misc,comp.multimedia
Subject: SUMMARY. Non-SUN SCSI CDROM. It DOES work.
Date: 16 Nov 92 08:11:51 GMT
Reply-To: ishikawa@personal-media.co.jp
Followup-To: comp.sys.sun.hardware
Organization: Personal Media Corp., Tokyo Japan


About 3 weeks ago, I asked the net if a non-SUN SCSI CDROM drive can
be hooked up to a Sun workstation to read the files on CDROM.

I have received many replies. In the end, I could use a little program
posted by Bob Hayes earlier this year to connect DENON DS-253 CD drive
to our sparcstation and read a mounted CDROM file system!

It took me a while to post the summary since I wanted to test the
little program to see if it works with our CDROM drive, and there was
a little trepidation on my side to connect the unknown hardware to
Sparcstation, but I am happy to report that I've found it works!

Thank you again everyone for the answers!

Here are the EDITED answers.

-------------------------------------------------------
Guy Harris
From: pmcgw!uunet!auspex.com!guy (Guy Harris)

The Sun driver probably assumes that the CD-ROM drive can be put into
"512 bytes per block" mode, or is always in that mode. 

The "hsfs_*.o" files implement a High Sierra/ISO 9660 file system, and
in 4.1.2 and later releases also implements the "Rock Ridge"
extensions to better support UNIX-style file names and the like.

----------------------------------------
Clifton Liles
From: Clifton Liles 282-4736 <pmcgw!uunet!sweetpea.jsc.nasa.gov!liles>

My information is other SCSI players will work for everything BUT
booting.  You can not build a system from the distrbution media!  

[Ishikawa comment: I wonder why.]

----------------------------------------
Dan Lanciani
Return-Path: <pmcgw!uunet!burrhus.harvard.edu!ddl>

NEC CDR-72 doesn't work with a Sun-3, using either the SCSI-2 or
SCSI-3 host adapters.  It generated a string of horrible SCSI bus
errors and corrupted the hard disk to the extent that I had to
reformat...

[Ishikawa comment: My colleague who actually tested the connection
told me that he experienced a disk error when he switched on/off the
CD drive while the system is running. So DON'T try to turn on/off the
CD drive WHILE the system is running!]

----------------------------------------
Derek Fawcus
Return-Path: <pmcgw!uunet!eyrie.demon.co.uk!df>

You could look at the linux CDROM file system sources, they're
available on tsx-11.mit.edu and AFAIK it fully implements the ISO
format with rock ridge extensions.

----------------------------------------
Andrew Speedie
From: uunet!cs.bham.ac.uk!A.H.Speedie-SE0

According to a Sun engineer, most CD drives will work on SUN 3/80 and
up, without any special modification to the kernel. The only problem
is that you can only boot from a SUN CD drive and they are SONY drives
with a firmware upgrade. And also you can't boot a 3/80 from a CD.

[ishikawa comment: I have not tested Sun3 hardware yet.]

----------------------------------------
Kasukawa, Masaatsu
From: kasukawa@gssm.otsuka.tsukuba.ac.jp (Masaatsu Kasukawa)
Hikita, Hiroyuki
Return-Path: <hikita@trl.mei.co.jp>

From the two gentlemen above, I have received a copy of an article Bob
Hayes posted earlier this year to comp.sun.hardware. This ultimately
enabled me to connect the DENON DS-253 CDROM drive to a Sparcstation
successfully!  (Unfortunately since it is encased in an external
chassis, and I don't want to open the box right now, I don't know
exactly whose CDROM drive is in the box.)

For your information, I attach the copy of Bob Hayes article: I
believe there must be many people wondering if they can connect
non-SUN CDROM to Sunworkstations.

Thank you again everyone for the information!

ishikawa@personal-media.co.jp

-------- quote --------------------------

From: bob@henson.cc.wwu.edu (Bob Hayes)
Newsgroups: comp.sys.sun.hardware
Subject: SUMMARY: CD-ROMS- not SUN/SONY
Summary: CDROM drives other than Sun/Sony
Keywords: cdrom drives
Date: 5 Feb 92 22:19:25 GMT
Organization: Western Washington University


My original query- can you use a CD-ROM drive other than
a Sony for Suns...Specifically a Toshiba 3301B from a
NeXT... generated several replies, from YES to NO-WAY...

The answer is YES for data, probably yes for audio.
For other drives than Toshiba??? Lets hear your results
when you try it!!

begin SOAPBOX
Let me say *THANKS* to EVERYONE who wrote to express
ANY thoughts !! We need all the discusion that we can handle,
we need all the ideas that we can think of, and then we can
sift for what ideas we need most, and save some for later.

This network stuff is the most far reaching, inclusive,
responsive, and open communications forum to have existed
on the planet! (add more adjectives as required)
May we continue the free, open interchange of ideas and
information!
end SOAPBOX

So what about the CD-ROM stuff??
The problem seems to be in the sector size read from the
scsi interface--- Sun expects 512 bytes, the default format
of the CD1 spec is (mode 1, with ECC) 2048 bytes per 'block'.

Is there an ftp site for the (red/blue/green?? rainbow) books
which have the CD specs and mode descriptions???

This is on a Sun LPC, SunOS 4.1.1b--
Patches which I tried in the kernel were not effective.
I posted. I read the mail. I tried it. IT WORKED!!

And the  GOOD STUFF, Thanks and a tip 'o the hat to Ralph,
who wrote:

~From: rkling@austin.intel.com (Ralph Kling)
	YES, it is possible! I have managed to connect one to a SS-2.
	However, there are a few differences between the SUN (=SONY) drive
	and the Toshiba drive. In particular, the SUN drive seems to use
	a default transfer block size of 512 bytes versus 2048 for the
	Toshiba. I wrote a little program that uses SUNs user-scsi-driver
	to correct this. You have to run that before trying to mount the
	drive! The "unrecognized vendor" message can be neglected.
	If you want to use the CD-audio capabilities you'll have to write
	your own driver (also via SUNs user-scsi-driver) since those commands
	are totally different from the SUN drive. Call Toshiba of America
	(sorry, I lost the number) and order the CD rom drive spec from them
	(will cost you $15).
	One more thing: The scsi-id for the CD rom needs to be 6.
	Good luck!!!

	Ralph


	Here is the program to set the transfer length to 512 bytes:

	-----------
	# include <sys/types.h>
	# include <sys/buf.h>
	# include <sun/dkio.h>
	# include <scsi/targets/srdef.h>
	# include <scsi/impl/uscsi.h>
	# include <strings.h>

	# include <stdio.h>

	char cdrom[] =	"/dev/rsr0";

	extern char *	cdrom_status();

	/* group 0 commands */

	#define TEST		0x00
	#define REZERO		0x01
	#define SENSEREQ	0x03
	#define READ		0x08
	#define SEEK		0x0b
	#define NOP		0x0d
	#define INQ		0x12
	#define MODESEL		0x15
	#define RESERVE		0x16
	#define RELEASE		0x17
	#define MODESENSE	0x1a
	#define STARTSTOP	0x1b
	#define DIAGRCV		0x1c
	#define DIAGSND		0x1d
	#define MEDIUMLOCK	0x1e

	/* group 1 commands */

	#define READCAP		0x25
	#define READEXT		0x28
	#define SEEKEXT		0x2b

	/* group 6 commands */

	#define AUDIOTRACK	0xc0
	#define AUDIOPLAY	0xc1
	#define AUDIOSTILL	0xc2
	#define AUDIOSTOP	0xc3
	#define EJECT		0xc4
	#define CLOSE		0xc5
	#define AUDIOSUB	0xc6
	#define AUDIODISK	0xc7
	#define ROMMODE		0xc8

	/***/

	#define CMDLEN(cmd) ((cmd >= 0x20) ? 10 :  6)

	/***/

	main() {
		int			fd;
		int			i;
		struct uscsi_cmd	ucmd;
		char * 			s_command;
		char *			s_buffer;

		if ((fd = open(cdrom, 0)) == -1) {
			fprintf(stderr, "open: ");
			perror(cdrom);
			exit(1);
		}
		s_command = (char *) malloc(10);
		if (s_command == NULL) {
			printf("malloc error (command)\n");
			exit(-1);
		}
		bzero(s_command, 10);
		s_buffer = (char *) malloc(256);
		if (s_buffer == NULL) {
			printf("malloc error (buffer)\n");
			exit(-1);
		}
		bzero(s_buffer, 256);
		s_command[0] = MODESEL;
		s_command[1] = 0x10;
		s_command[4] = 12;
		s_buffer[3] = 0x08;
		s_buffer[10] = 0x02;
		ucmd.uscsi_cdb = s_command;
		ucmd.uscsi_cdblen = 6;
		ucmd.uscsi_bufaddr = s_buffer;
		ucmd.uscsi_buflen = 4096;
		ucmd.uscsi_flags = USCSI_WRITE;
		i = ioctl(fd, USCSICMD, ucmd);
		close(fd);
		exit(i);
	}
**************** end of Ralph's goodie ****************
I can hear those odd-ball Cd-rom drives being hooked onto
scsi busses already! 
Bob Hayes <bob@cs.wwu.edu>
-------- quote end --------------------------