CompuServe Thread

SCSI-Interface

3 messages in this thread
#163299From: john elemansMar 10, 1994 1:54 PM
Steve, Sorry I took so long to respond. There definitely is a sequence of commands. They are not the ones that you have listed, though. First, if you are not sure of the state of the device, then you may need to do a request sense etc., but you should usually know what is going on. I start out by reseting the device that I am using when I start. Here is the sequence of scsi commands that you need; This example performs a request sense; scsiINQ.opCode = REQSENSE; scsiINQ.logicalUnit = 0x00; scsiINQ.res1 = 0; scsiINQ.res2 = 0; scsiINQ.allocationLength = sizeof(dvSensePage); scsiINQ.controlByte = 0; firstInstr.scOpcode = 2; /* scNoInc */ firstInstr.scParam1 = (long)&senseData; firstInstr.scParam2 = sizeof(dvSensePage); secondInstr.scOpcode = 7; /* scStop */ secondInstr.scParam1 = 0; secondInstr.scParam2 = 0; if(0 != (gErr = SCSIGet())) return; if(0 != (jErr = SCSISelect(unitID))) return; cErr = SCSICmd((Ptr)&scsiINQ,6); rErr = SCSIRead((Ptr)&firstInstr); cmpErr = SCSIComplete((short *)&status,(short *)&message,2000); sErr = SCSIStat(); You always need SCSIGet, SCSISelect, SCSICmd, SCSIRead (or SCSIWrite), SCSIComplete. I think the SCSIStat is optional. But remember that all this is for the old SCSI manager only. The new one is different, completely.
#163678From: SyndesisMar 13, 1994 1:10 PM
I haven't picked up Apple's SCSI developer kit yet. Do you know of other good sources of direct SCSI programming examples?
#163835From: Dave OvertonMar 14, 1994 8:34 AM
The Developers CD has a sample Disk Driver in Progress. Dave Overton