home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / bsd / 4409 < prev    next >
Encoding:
Text File  |  1992-08-19  |  4.3 KB  |  162 lines

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!lll-winken!sol.ctr.columbia.edu!usc!sdd.hp.com!mips!darwin.sura.net!Sirius.dfn.de!math.fu-berlin.de!news.th-darmstadt.de!news.uni-mainz.de!wilbur!grefen
  2. From: grefen@wilbur.uni-mainz.de (Stefan Grefen)
  3. Newsgroups: comp.unix.bsd
  4. Subject: Re: SCSI driver bug when accessing DOS partition
  5. Message-ID: <8675IUH@minnie.zdv.uni-mainz.de>
  6. Date: 19 Aug 92 07:54:47 GMT
  7. References: <1992Aug19.020535.2080@noose.ecn.purdue.edu>
  8. Sender: grefen@wilbur (Stefan Grefen)
  9. Organization: Johannes Gutenberg Universitaet Mainz
  10. Lines: 149
  11. Nntp-Posting-Host: wilbur
  12.  
  13. In article <1992Aug19.020535.2080@noose.ecn.purdue.edu>, tgt@neon.ecn.purdue.edu (Conan the Librarian) writes:
  14. |> I ran across the following Adaptec driver bug when attempting to configure
  15. |> mtools to read an 80 Mb DOS partition d:, which is on a SCSI disk.  The
  16. |> problem: the SCSI driver routine asstart (in the file /sys/i386/isa/as.c)
  17. |> fails with the message "out of range, cannot happen?" (due to
  18. |> nscatter==NSCATTER, which means nothing to me!!).  This subsequently
  19. |> causes the disk_read() routine of mtools (in the file buf_read()) to fail,
  20. |> printing the message "disk_read: read: Device not configured"
  21. |> 
  22. [stuff deleted]
  23. |> Thanks very much.
  24. |> 
  25. |> -tom
  26. I may have a patch for this I hacked as.c to do Scatter/Gather only if needed.
  27. Diffs to as.c follows (usual disclaimer...if it breaks you are lost).
  28.  Hope this helps.
  29. Good Luck
  30.   Stefan
  31. -----------------------------------------------------------------
  32. *** as.c.org    Thu Aug  6 05:23:58 1992
  33. --- as.c    Thu Aug  6 08:10:24 1992
  34. ***************
  35. *** 782,788 ****
  36.   {
  37.       struct buf *bp;
  38.       int blknum;
  39. !     unsigned int physaddr;
  40.       struct ccb *ccb;
  41.       unsigned char *cdb;
  42.       int target;
  43. --- 782,788 ----
  44.   {
  45.       struct buf *bp;
  46.       int blknum;
  47. !     unsigned int physaddr,nphysaddr,ophysaddr;
  48.       struct ccb *ccb;
  49.       unsigned char *cdb;
  50.       int target;
  51. ***************
  52. *** 790,796 ****
  53.       int n;
  54.       char *sp;
  55.       int nscatter;
  56. !     int thistime;
  57.       int nbytes;
  58.       struct partition *part;
  59.       int blkno;
  60. --- 790,796 ----
  61.       int n;
  62.       char *sp;
  63.       int nscatter;
  64. !     int thistime,thistotal;
  65.       int nbytes;
  66.       struct partition *part;
  67.       int blkno;
  68. ***************
  69. *** 870,876 ****
  70.               nblocks = 255;
  71.           total = nblocks * bs;
  72.   if(asverbose)
  73. ! printf("total %d nblocks %d ", total, nblocks);
  74.           /*bp->b_bcount = total;    /* XXX partial tape block read - wrong */
  75.       } else {
  76.   #ifdef nomore
  77. --- 870,876 ----
  78.               nblocks = 255;
  79.           total = nblocks * bs;
  80.   if(asverbose)
  81. !     printf("total %d nblocks %d ", total, nblocks);
  82.           /*bp->b_bcount = total;    /* XXX partial tape block read - wrong */
  83.       } else {
  84.   #ifdef nomore
  85. ***************
  86. *** 890,895 ****
  87. --- 890,897 ----
  88.       n = 0;
  89.       sp = as->scatter_list;
  90.       nscatter = 0;
  91. +     ophysaddr=nphysaddr=vtophys (p);
  92. +     thistotal=0;
  93.       while (n < total && nscatter < NSCATTER) {
  94.           thistime = page_size - ((vm_offset_t)p - trunc_page (p));
  95.   
  96. ***************
  97. *** 899,918 ****
  98.           physaddr = vtophys (p);
  99.           
  100.           if (asverbose)
  101. !             printf ("%d bytes to %x (%x)\n",
  102. !                 thistime, p, physaddr);
  103. !         sp[0] = thistime >> 16;
  104. !         sp[1] = thistime >> 8;
  105. !         sp[2] = thistime;
  106. !         sp[3] = physaddr >> 16;
  107. !         sp[4] = physaddr >> 8;
  108. !         sp[5] = physaddr;
  109. !         
  110.           p += thistime;
  111.           n += thistime;
  112. !         sp += 6;
  113. !         nscatter++;
  114.       }
  115.       
  116.       if (nscatter == NSCATTER) {
  117.           printf("out of range, cannot happen?");
  118. --- 901,938 ----
  119.           physaddr = vtophys (p);
  120.           
  121.           if (asverbose)
  122. !             printf ("%d(%d) bytes to %x (%x,%x)\n",
  123. !                 thistime,thistotal, p, physaddr,nphysaddr);
  124. !         if(physaddr!=nphysaddr) {
  125. !           sp[0] = thistotal >> 16;
  126. !           sp[1] = thistotal >> 8;
  127. !           sp[2] = thistotal;
  128. !           sp[3] = ophysaddr >> 16;
  129. !           sp[4] = ophysaddr >> 8;
  130. !           sp[5] = ophysaddr;
  131. !               thistotal=thistime;
  132. !           ophysaddr=physaddr;
  133. !           nscatter++;
  134. !           sp += 6;
  135. !         } else {
  136. !               thistotal+=thistime;
  137. !         }
  138.           p += thistime;
  139.           n += thistime;
  140. !         nphysaddr=physaddr+thistime;
  141.       }
  142. +     if(thistotal) {
  143. +       sp[0] = thistotal >> 16;
  144. +       sp[1] = thistotal >> 8;
  145. +       sp[2] = thistotal;
  146. +       sp[3] = ophysaddr >> 16;
  147. +       sp[4] = ophysaddr >> 8;
  148. +       sp[5] = ophysaddr;
  149. +       nscatter++;
  150. +       sp += 6;
  151. +      }
  152.       
  153.       if (nscatter == NSCATTER) {
  154.           printf("out of range, cannot happen?");
  155.  
  156.  
  157. -- 
  158. Stefan Grefen   ---   Johannes Gutenberg University Mainz   ---    Germany
  159. Email: grefen@goofy.zdv.uni-mainz.de       ---        Phone:  06131/392415
  160.