[Simh] (no subject)
nao
nao at tom-yam.or.jp
Thu May 17 05:38:00 EDT 2007
Hi,
There still remains VAX-11/780 UNIX key-in boot code problem under
SIMH v3.7-1, because it stops processing DMAs when CPU halts.
Here are new patches for processing events except ones from recurring
devices (clock and tt input for example) after every run_cmd(). Key-in
boot code for VAX-11/780 Unices properly works with these patches.
Though all emulators are affected, only VAX-11/780 devices are
modified.
I checked PDP-11 Unices to find that their key-in boot code loops so
free from this problem. An alternative solution under VAX is to add
loop code to the end of key-in boot code like PDP-11. It would not be
a very neat dissolution but a realistic compromise.
Enjoy!
Naoki Hamada
diff -ur simh/VAX/vax780_stddev.c simh+/VAX/vax780_stddev.c
--- simh/VAX/vax780_stddev.c Sun Oct 29 15:35:10 2006
+++ simh+/VAX/vax780_stddev.c Thu May 17 16:13:00 2007
@@ -236,7 +236,7 @@
1, 10, 31, 1, 16, 8,
NULL, NULL, &tti_reset,
NULL, NULL, NULL,
- NULL, 0
+ NULL, DEV_REC
};
/* TTO data structures
@@ -290,7 +290,7 @@
1, 0, 0, 0, 0, 0,
NULL, NULL, &clk_reset,
NULL, NULL, NULL,
- NULL, 0
+ NULL, DEV_REC
};
UNIT tmr_unit = { UDATA (&tmr_svc, 0, 0) }; /* timer */
diff -ur simh/scp.c simh+/scp.c
--- simh/scp.c Sun Apr 29 10:18:44 2007
+++ simh+/scp.c Thu May 17 16:12:38 2007
@@ -2420,7 +2420,10 @@
#endif
fprint_stopped (stdout, r); /* print msg */
if (sim_log) fprint_stopped (sim_log, r); /* log if enabled */
-return SCPE_OK;
+
+r = sim_clear_event();
+
+return r;
}
/* Common setup for RUN or BOOT */
@@ -3820,6 +3823,46 @@
/* Empty queue forces sim_interval != 0 */
return reason;
+}
+
+/*
+ sim_clear_event - process only non-recurring event
+
+ Inputs:
+ none
+ Outputs:
+ reason = reason code returned by any event processor,
+ or 0 (SCPE_OK) if no exceptions
+*/
+
+t_stat sim_clear_event (void)
+{
+ UNIT *xptr, *uptr = sim_clock_queue; /* previous and current entry */
+ DEVICE *dptr;
+ t_stat reason = SCPE_OK;
+
+ while ((uptr != NULL) && (reason == SCPE_OK)) {
+ if (uptr != &sim_step_unit) { /* skip step timer */
+ if ((dptr = find_dev_from_unit (uptr)) != NULL) {
+ if ((dptr->flags & DEV_REC) != 0) { /* skip recurring dev */
+ if (uptr->action != NULL) {
+ reason = uptr->action(uptr); /* process it */
+ }
+ if (uptr == sim_clock_queue) { /* if first entry */
+ sim_clock_queue = uptr->next;
+ } else {
+ xptr->next = uptr->next;
+ }
+ uptr->next = NULL; /* sanitize */
+ uptr->time = 0;
+ }
+ }
+ }
+ xptr = uptr;
+ uptr = uptr->next;
+ }
+
+ return reason;
}
/* sim_activate - activate (queue) event
diff -ur simh/sim_defs.h simh+/sim_defs.h
--- simh/sim_defs.h Sat Apr 28 18:16:30 2007
+++ simh+/sim_defs.h Thu May 17 16:12:16 2007
@@ -302,6 +302,7 @@
#define DEV_V_DEBUG 4 /* debug capability */
#define DEV_V_RAW 5 /* raw supported */
#define DEV_V_RAWONLY 6 /* only raw supported */
+#define DEV_V_REC 7 /* recurring device */
#define DEV_V_UF_31 12 /* user flags, V3.1 */
#define DEV_V_UF 16 /* user flags */
#define DEV_V_RSV 31 /* reserved */
@@ -313,6 +314,7 @@
#define DEV_DEBUG (1 << DEV_V_DEBUG)
#define DEV_RAW (1 << DEV_V_RAW)
#define DEV_RAWONLY (1 << DEV_V_RAWONLY)
+#define DEV_REC (1 << DEV_V_REC)
#define DEV_UFMASK_31 (((1u << DEV_V_RSV) - 1) & ~((1u << DEV_V_UF_31) - 1))
#define DEV_UFMASK (((1u << DEV_V_RSV) - 1) & ~((1u << DEV_V_UF) - 1))
More information about the Simh
mailing list