SCSI device driver PROBLEM

Matthias Urlichs urlichs at smurf.sub.org
Sun Oct 14 02:12:22 AEST 1990


The following occurs on A/UX 2.0 sf (Seeding Final), on my IIfx.

The SCSI device driver I'm currently writing tries to do the following:

ds_ioctl(...) {
[ struct scsireq *r; initialize r; general handwaving ]

   int ds_ret();
   r->faddr = ds_wakeup();
   r->cmdlen		= ...;
   r->datalen		= ...;
   r->senselen		= ...;
   r->driver		= (long) r;
   ret = scsimgrs[MGR(dev)].s_req(ID(dev), r, (struct vio *)0);
   if (ret) {  [...] }
   sleep(r, PZERO);		/* wait for the request to finish */

   [ check errors, return data ]
   return(0);
}

int
ds_ret(req) struct scsireq *req;
{	wakeup(req);
	return(0);
}

The big problem is that whenever r->datalen is >= 512, nothing happens:
Everything seems to work, r->datasent ends up being equal to r->datalen, the
command is performed on the disk, but the buffer I'm trying to read the data
from ends up unchanged.
This may or may not have something to do with the fact that with 512 bytes,
the A/UX 2.0 SCSI system decides to start using DMA.

Any insights are appreciated -- I'm basically stumped by this, and I _need_
this. (It's going to be a free implementation of (a subset of) the MacOS
SCSI Manager under A/UX, and everything else already works. I even found out
how to patch out that pesky SST_MORE error.)

Trace (trying to read the first 512 bytes off hard disk ID 5):
(Note that the dump of the first 8 Bytes is wrong -- the HD has a valid
partition map at the beginning. Buffer length & address are correct.)

7 12906300.5     STA 00 cs=      bs=    M   dcl=0082 md=     0000 IDLE>NEWTASK>CHOOSE
7 12906301.5     STA 00 cs=      bs=    M   dcl=0080 md=     0000 CHOOSE>NEWTASK>RUN
0 12906301.5     STA 00 cs=      bs=    M   dcl=0080 md=     0000 scsitask top
7 12906301.5 SEL STA A0 cs= B S. bs=    M   dcl=0080 md=     0000 selected
7 12906301.5 DOU SEL 00 cs= B    bs=    M   dcl=0080 md=     0000 scsitask top
0 12906301.5 CMD SEL 00 cs= BR   bs=        dcl=0080 md=     0000 task req wait
0 12906301.5 CMD CMD A0 cs= BR . bs=    M   dcl=0080 md=     0000 SPH_CMD Read
0 12906301.5 DOU CMD 00 cs= B    bs= D      dcl=0080 md=  d  0000 08000000 0100
0 12906302.5 DIN CMD 00 cs= B    bs= D      dcl=0080 md=  d  0000 scsitask top
0 12906302.5 DIN CMD 45 cs= BR   bs=        dcl=0080 md=     0000 task req wait
0 12906302.5 DIN DAT 45 cs= BR   bs=    M   dcl=0080 md=     0000 SPH_DIN 512 spd 5
0 12906302.5 DIN DAT 45 cs= BR   bs=    M   dcl=0005 md=e d  0512 dmaR 512 @12017084
7 12906303.5 DIN DAT 45 cs= BR   bs=    M   dcl=0005 md=e d  0512 RUN>DMA>DMA
2 12906303.5 DIN DAT 00 cs= B    bs=E  IM   dcl=0047 md=e d  0000 irq:R512 L0 C 47
2 12906303.5 STA DAT 00 cs= BR . bs=E  I    dcl=0047 md=e d  0000 scsiirq-EOP
7 12906304.5     DAT 00 cs=      bs=........dcl=.... md=     .... DMA>EOP>EOP
2 12906304.5 STA DAT 00 cs= BR . bs=E       dcl=0080 md=  d  0000 00000000 00000000
7 12906305.5 STA DAT 00 cs= BR . bs=E       dcl=0080 md=  d  0000 EOP>WAITP>WPHASE
7 12906305.5 STA DAT 00 cs= BR . bs=E       dcl=0082 md= bd  0000 spinwait req
7 12906305.5 STA DAT 00 cs= BR . bs=        dcl=0082 md= b   0000 pretend phase int
7 12906305.5 STA DAT 00 cs= BR . bs=        dcl=0082 md= b   0000 WPHASE>PHASE>RUN
0 12906305.5 STA DAT 00 cs= BR . bs=        dcl=0080 md= b   0000 scsitask top
0 12906305.5 STA DAT 00 cs= BR . bs=        dcl=0080 md= b   0000 task req wait
0 12906305.5 STA STA 00 cs= BR . bs=    M   dcl=0080 md= b   0000 SPH_STAT
0 12906305.5 MIN STA 00 cs= B    bs=        dcl=0080 md= bd  0000 00 Good
0 12906306.5 MIN STA 00 cs= BR . bs=   I    dcl=00C0 md= bd  0000 scsitask top
0 12906306.5 MIN STA 00 cs= BR . bs=        dcl=0080 md= b   0000 task req wait
0 12906306.5 MIN STA 00 cs= BR . bs=    M   dcl=0080 md= b   0000 SPH_MIN
2 12906306.5 MIN STA 00 cs= BR . bs=    M   dcl=0080 md= b   0000 00 Command Complete
7 12906307.5     STA 00 cs=      bs=    M   dcl=0080 md=     0000 RUN>DONE>NOTIFY
7 12906308.5     STA 00 cs=      bs=    M   dcl=0080 md=     0000 NOTIFY>DONE>CHOOSE
7 12906309.5     STA 00 cs=      bs=    M   dcl=0080 md=     0000 CHOOSE>DONE>IDLE
, OK 0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0, Trans 512
7 12906310.5     STA 00 cs=      bs=    M   dcl=0082 md=     0000 IDLE>NEWTASK>CHOOSE

-- 
Matthias Urlichs -- urlichs at smurf.sub.org -- urlichs at smurf.ira.uka.de     /(o\
Humboldtstrasse 7 - 7500 Karlsruhe 1 - FRG -- +49+721+621127(0700-2330)   \o)/



More information about the Comp.unix.aux mailing list