Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.hardware Subject: Re: More info on A2091 woes Message-ID: <17665@cbmvax.commodore.com> Date: 16 Jan 91 05:35:47 GMT References: <9696@cica.cica.indiana.edu> <1991Jan14.193336.13387@convex.com> <1991Jan15.155835.5230@javelin.es.com> <14480@june.cs.washington.edu> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 183 In article <14480@june.cs.washington.edu> dylan@june.cs.washington.edu (Dylan McNamee) writes: >I have a 2091, and have had very similar experience as Mr. Travis. I >HAVE turned off reselection from both drives (which bugs me, since >reselection is a nice performance enhancement) and still can get the >SCSI devices to hang at will. (Just get both of them busy at once, >with big loads or saves) Hmmm. Are you certain you actually managed to turn off reselection? As I posted before, it's fairly easy to confuse yourself by changing the definition file on the disk, but not actually select the modified definition and save it to the rigid disk block. Maybe I'll whip up a program to verify if a drive has reselection on or off. Please provide more details after you double-check your reselection status. Warning: I hacked this souce to add check_reselect without testing it, though it's pretty simple. The program defaults to reading 68 sectors or so from offset 0 and writing them to the file "rdsk". It's a kindof useful program for mucking with devices at a low-level, originally made for sucking rigid disk blocks off drives for analysis. Error checking is minimal. Other people who have tried turning off reselection and still have problems may wish to try this. All drives must have reselection turned off, one of two won't solve the problem until a new driver is available. If your drives have reselection off, and you still have problems, please send mail to bugs@cbmvax.commodore.com. /* readrdsk.c */ #include #include #include #include #include #include #include #include /* for lattice */ #include #include void main (argc,argv) int argc; char **argv; { int ret = 20; struct IOStdReq *ior = NULL; struct MsgPort *port = NULL; int opened = FALSE,i; char *mem; BPTR fh = NULL; char *name = "rdsk"; char *device = "scsi.device"; int unit = 6, write = FALSE,start = 0,length=17*4*512; int check_reselect = FALSE; for (i = 1; i < argc; i++) { if (stricmp(argv[i],"device") == 0) device = argv[++i]; else if (stricmp(argv[i],"unit") == 0) unit = atoi(argv[++i]); else if (stricmp(argv[i],"write") == 0) write = TRUE; else if (stricmp(argv[i],"read") == 0) write = FALSE; else if (stricmp(argv[i],"start") == 0) start = atoi(argv[++i]); else if (stricmp(argv[i],"length") == 0) length = atoi(argv[++i]); else if (stricmp(argv[i],"check_reselect") == 0) check_reselect = TRUE; else if (stricmp(argv[i],"?") == 0) { /* defaults to read, scsi.device, unit 6, start 0, length 17*4*512, no check_reselect, file "rdsk". */ printf( "usage: readrdsk [device x] [unit y] [Read|write] [start z] [length q] \\\n" "\t\t [check_reselect] file\n"); exit(0); } else name = argv[i]; } if (!(port = CreatePort(0L,0L))) goto cleanup; if (!(ior = CreateStdIO(port))) goto cleanup; if (i = OpenDevice(device,unit, (struct IORequest *) ior,0L)) { printf("Error %d on device open!\n",i); goto cleanup; } opened = TRUE; if (write) { fh = Open(name,MODE_OLDFILE); if (!fh) { printf("Can't open %s!\n",name); goto cleanup; } if (length == 17*4*512) /* bad but quick test */ { Seek(fh,0,OFFSET_END); length = Seek(fh,0,OFFSET_BEGINNING); } } else { if (!(fh = Open(name,MODE_NEWFILE))) { printf("Can't open %s!\n",name); goto cleanup; } } mem = AllocMem(length,MEMF_CLEAR); if (!mem) { printf("can't allocate mem!\n"); goto cleanup; } if (write) { Read(fh,mem,length); /* no error checking */ } ior->io_Data = (APTR) mem; ior->io_Length = length; ior->io_Offset = start; ior->io_Command = write ? CMD_WRITE : CMD_READ; DoIO((struct IORequest *) ior); if (ior->io_Error) { printf("Error %ld on read/write!\n",ior->io_Error); goto cleanup; } if (!write) { if (Write(fh,mem,length) != length) goto cleanup; } if (check_reselect) { /* assumes you did a read from offset 0! */ if (((struct RigidDiskBlock *) mem)->rdb_Flags & RDBFF_NORESELECT) printf("reselect is disabled\n"); else printf("reselect is enabled\n"); } ret = 0; /* success */ cleanup: if (fh) Close(fh); if (opened) CloseDevice((struct IORequest *) ior); if (ior) DeleteStdIO(ior); if (port) DeletePort(port); if (mem) FreeMem(mem,length); exit(ret); } -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com BIX: rjesup The compiler runs Like a swift-flowing river I wait in silence. (From "The Zen of Programming") ;-)