#if 0 Article 9781 (135 more) in alt.cd-rom: From: Thomas.Tornblom@Nexus.Comm.SE (Thomas Tornblom) Subject: Other CDROMS on a Sun, was Sun CD-ROM on PCs??? In-Reply-To: jk@tools.de's message of 15 Apr 93 20: 16:31 GMT Message-ID: Followup-To: alt.cd-rom Sender: news@nexus.comm.se Organization: Communicator Nexus AB References: <1qc5gd$13o@marleen.isi.edu> <1993Apr14.195220.21701@nb.rockwell.com> <1993Apr15.040231.17561@c3p0.novell.de> Date: Tue, 20 Apr 1993 15:51:17 GMT Lines: 68 I got inspired by this and modified a tiny hack I did a while back to allow an Apple CD-ROM to be used on a Sun. As there is nothing in it that depends on the particular brand I guess it would work with other types as well. It justs sets the block size to 512 byte, which is kosher on the Suns. Most other drives seem to use 2k. So get a cable that fits both ends, set the SCSI id to 6, compile the following piece and run it as root. After it has been run you should be able to use it as any Sun CD-ROM. Probably only works on Sparcs running SunOS 4.1.x. When I can find the time I'll do the opposite, set the Sun CD-ROM to 2k to allow it to be used on Macs. ------------- #endif #include #include #include #include #include #include struct uscsi_cmd cmd; union scsi_cdb cdb; u_char md[12] = { /* random data */ 0, /* reserved */ 0, /* medium type */ 0, /* reserved */ 8, /* block descriptor length */ 0, /* density */ 0,0,0, /* # of blocks */ 0, /* reserved */ 0,2,0, /* block length (512b) */ }; main() { int fd; if ((fd = open("/dev/rsr0", O_RDWR | O_NDELAY)) == -1) { perror("open"); exit (1); } cdb.scc_cmd = SCMD_MODE_SELECT; cdb.low_count = 12; cmd.uscsi_cdb = (caddr_t) &cdb; cmd.uscsi_cdblen = CDB_GROUP0; cmd.uscsi_bufaddr = (caddr_t) md; cmd.uscsi_buflen = sizeof(md); cmd.uscsi_flags = USCSI_DIAGNOSE | USCSI_ISOLATE; /* write */ if ((ioctl(fd, USCSICMD, (struct uscsi_cmd *) &cmd)) == -1) { perror("ioctl"); exit (1); } exit(0); } #if 0 -- Real life: Thomas T^6rnblom Email: Thomas.Tornblom@Nexus.Comm.SE Snail mail: Communicator Nexus AB Phone: +46 18 171814 Box 857 Fax: +46 18 696516 S - 751 08 Uppsala, Sweden #endif