WD patch...

From: Pat Mackinlay <mackinla_at_nospam.org>
Date: Thu Sep 16 1993 - 12:08:51 PDT

As promised, I've done a little work on the WD server, with quite useful
results. Basically, the other "kludge" parameters should no longer be
needed when running the server at startup. I hope that a simple:

        ../wd/wd d0:readp d1:readp

will work for everyone's disks - it works for mine. The patch is pretty
straightforward, enjoy.

---[begin included patch]---
--- c:\unix\tmp/T0AA.AAA Fri Sep 17 02:42:18 1993
+++ wd.c Fri Sep 17 02:39:04 1993
@@ -161,8 +161,9 @@
                         uint s = parm[unit].w_size * SECSZ;
                         const uint m = 1024*1024;
 
- printf("wd%d: %d.%dM\n", unit,
- s / m, (s % m) / (m/10));
+ printf("wd%d: %d.%dM - %d heads, %d cylinders, %d sectors\n", unit,
+ s / m, (s % m) / (m/10),
+ parm[unit].w_tracks, parm[unit].w_cyls, parm[unit].w_secpertrk);
                         found_first = 1;
                         if (unit < first_unit) {
                                 first_unit = unit;
@@ -460,6 +461,17 @@
         }
         repinsw(WD_PORT+WD_DATA, buf, sizeof(buf)/sizeof(ushort));
         bcopy(buf, &xw, sizeof(xw));
+
+ /*
+ * Give the controller the geometry. I'm not really sure why my
+ * drive needs the little delay, but it did... (pat)
+ */
+ __msleep(100);
+ outportb(WD_PORT+WD_SDH, WDSDH_EXT|WDSDH_512 | (unit << 4) | (xw.w_heads - 1));
+ outportb(WD_PORT+WD_SCNT, xw.w_sectors);
+ if (wd_cmd(WDC_SPECIFY) < 0) {
+ return;
+ }
 
         /*
          * Fix big-endian lossage
--- c:\unix\tmp/T0AA.AAA Fri Sep 17 02:42:24 1993
+++ wd.h Mon Sep 13 01:31:54 1993
@@ -60,6 +60,7 @@
 #define WDC_WRITE 0x30 /* ...write */
 #define WDC_READP 0xEC /* ...read parameters */
 #define WDC_DIAG 0x90 /* Run controller diags */
+#define WDC_SPECIFY 0x91 /* Initialise controller parameters */
 
 /*
  * Read parameters command (WDC_READP) returns this. I think this
---[end included patch]---

-- 
Pat -- Alien lands on head, gives birth to mutant.
Received on Thu Sep 16 12:17:42 1993

This archive was generated by hypermail 2.1.8 : Wed Sep 21 2005 - 19:37:12 PDT