[Simh] yet other VAX-11/780 UNIX patches

nao nao at tom-yam.or.jp
Thu May 17 05:50:58 EDT 2007


Hi,

Running 4BSDs on VAX-11/780 revealed need of other patches.

pdp11_rp.c

The RP driver (/usr/src/sys/vaxmba/hp.c) of 4.2BSD, 4.3BSD,
4.3BSD-reno and 4.3BSD-tahoe waits for DRIVE AVAILABLE bit of CS1
register before data transfers. This bit is always cleared in SIMH so
these Unices cannot operate on RP drives.

From "peripherals handbook 1981-1982", EB-20443-20, p. 326:
>Chapter Disk Registers
>Section RP06 REGISTERS
>CONTROL AND STATUS 1 REGISTER (CS1)
>Bit 11 DRIVE AVAILABLE (PDP-11 ONLY)
>When set, indicates that the selected drive is present, turned on, and
>not being used by the other MASSBUS port. 

I simply set this bit unconditionally.

sim_ether.c

Exclusion code of non-physical network device has a bug which omits
not the very entry but the next one. 

Naoki Hamada
nao at tom-yam.or.jp

diff -ur simh.orig/PDP11/pdp11_rp.c simh/PDP11/pdp11_rp.c
--- simh.orig/PDP11/pdp11_rp.c	Fri Dec 29 11:04:10 2006
+++ simh/PDP11/pdp11_rp.c	Thu May  3 07:12:46 2007
@@ -120,6 +120,7 @@
 #define  FNC_READH      035                             /* read w/ headers */
 #define CS1_RW          076
 #define GET_FNC(x)      (((x) >> CS1_V_FNC) & CS1_M_FNC)
+#define CS1_DRVAVAIL    0004000                         /* drive avail */
 
 /* RPDS, RMDS - drive status - offset 1 */
 
@@ -498,7 +499,7 @@
 switch (ofs) {                                          /* decode offset */
 
     case RP_CS1_OF: case RM_CS1_OF:                     /* RPCS1 */
-        val = rpcs1[drv] & CS1_RW;
+        val = rpcs1[drv] & CS1_RW | CS1_DRVAVAIL;
         break;
 
     case RP_DA_OF: case RM_DA_OF:                       /* RPDA */
diff -ur simh.orig/sim_ether.c simh/sim_ether.c
--- simh.orig/sim_ether.c	Sun Oct 15 14:58:04 2006
+++ simh/sim_ether.c	Mon May 14 19:10:30 2007
@@ -1187,7 +1187,7 @@
     conn = pcap_open_live(list[i].name, ETH_MAX_PACKET, ETH_PROMISC, PCAP_READ_TIMEOUT, errbuf);
     if (NULL != conn) datalink = pcap_datalink(conn), pcap_close(conn);
     if ((NULL == conn) || (datalink != DLT_EN10MB)) {
-      for (j=i+1; j<used; ++j)
+      for (j=i; j<used-1; ++j)
         list[j] = list[j+1];
       --used;
       --i;




More information about the Simh mailing list