IO: DVT_NOTDEV macro incorrect, Device mapping algorithm creates false dispatch points.
This mapped Multi Unit Controller and Single Unit Controller to same device.
DP, DP, MT, RAD: Test for non-existent device returns wrong status.
DP, DK, MT: TIO status should return non-operational for unattached device.
This corrects an error that caused SIO reject when SIO occured before
a pending seek interrupt on a different device.
- Move the interrupt pending test from sigma_io.c into each device.
- Make the sigma_dp.c test a special case that looks for pending
seek interrupts.
Ken's last note led me to look at magtape error handling, and it was
not right. This has resulted in a lot of code changes in sigma_mt.c, but
the changes are mostly mechanical. Instead of trying to be clever and
do channel handling in mt_map_err or at the bottom of the mt_svc
routine, every magtape command now does its own error handling.
This makes the code repetitive, but I hope it is much clearer as a result.
The problems all stem from a single root cause: when an interrupt is
requested - via any one of dozens of mechanisms (uend, normal end,
special request, error, etc), the interrupt routine must be presented
with the full device address, including the unit, which is stored in the
channel data structures. This is so that AIO (acknowledge interrupt)
can retrieve the unit number from the channel data structures and
give it back to the invoking program.
Unfortunately, service routines, error routines, etc were simply using
the base device address, which is good enough for all channel operations
EXCEPT AIO. So the four multi-unit device (RAD, DK, DP, MT) have had
changes to reconstruct the full device address, with unit number, before
any calls into the channel are made.
DP, funnily enough, required the fewest changes. Ken was exactly right
about the need to OR the unit number into dva at the start of the unit
service routine. That had to be done in a few more places where my code
was being lazy.
RAD, DK, MT required many more changes, but they were mostly mechanical.
All references to xx_dib.dva had to be examined and replaced with a full
device address. The full device address had to be reconstructed from the
UNIT pointer and the base device address, through the magic of pointer
arithmetic.
Another sore spot was HIO. HIO stops all the active unit in its tracks
and does a channel UEND on it. The calculation of the unit number in the
UEND was not correct in a few places, notably if DP did a controller reset.
Fixes for the four modules; an updated bug history; and an expanded
design document; are attached.
Historically this functionality was reimplemented within each
DEVICE simulator often with slightly different implementations
and inconsistencies. Solving this globally within SCP required
changes in many places, but should henceforth be reasonably
managed.
As discussed in #1034
These changes facilitate more robust parameter type checking and helps
to identify unexpected coding errors.
Most simulators can now also be compiled with a C++ compiler without
warnings.
Additionally, these changes have also been configured to facilitate easier
backporting of simulator and device simulation modules to run under the
simh v3.9+ SCP framework.