* CMake build infrastructure
The squashed commit that builds and packages releases for the SIMH
simulator suite with CMake, version 3.14 or newer.
See README-CMake.md for documentation.
Adjust the RUNLIMIT to specify instructions instead of wall clock time.
On an unfettered system, the sel32 test completes after some 588 million
instructions. On a slow host system, the system clock tick processing will
add to the total instructions executed. Increase the limit to 750 million
instructions.
Coverity flagged one magtape simulator for having fewer case breakouts
than the range of MTSE_x errors, after they were expanded for
MTSE_LEOT (listed as "V4 compatibility") and MTSE_RUNAWAY (for
Dave Bryan's implementation of erase and erase gap).
According to Dave, it turns out that MTSE_RUNAWAY can only be
returned if the magtape simulator supports and implements a density
specification and the ERASE function. The simulators Bob Supnik wrote
don't meet that criteria, so the expanded errors can't be returned.
Simply add a "default" case to the map logic returning SCPE_IERR for
unexpected cases.
Devices that do single character I/O could be attached to non seekable
host OS devices (tty, pipes, etc.) and thus shouldn't count on fseek()
and ftell(). These DEVICEs on these simulators do single character I/O
and easily can update their POS REGisters to reflect how much data has
been emitted. Changing such a REGister will have no useful effect
when attached to a non seekable file.
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
- Remove unused variable assignment
- Avoid potential out of array indexing due to theoretical array
reference via signed char index. Likely non functional change.
This avoids a potential invalid pointer dereference when formatting
the return value from sim_instr() if it is < SCPE_BASE but greater
than the previously defined static array size.sizeof
Update simh.doc to reflect this generic change.
This implements the principle of "least surprise", in that users won't
normally expect to start overwriting an existing file on these devices.
Real hardware didn't behave that way. A new (empty) file can always
be created with the -N switch on the ATTACH.
Although these devices interpret a -A switch at attach time, they are not
sequential output devices and thus don't have an ambiguous interpretation
of the switch.
Incorrectly mentioned in #821
The -A attach time switch implicitly means to open files in append
mode.
Some devices used -A to indicate ASCII data or AUTOSIZE of disk or
fixed size tapes - DECtape. These devices are either read only devices
(Paper tape readers or card readers), so explicit forcing of the attach
to be -R avoids unexpected positioning errors. The random access
Disk and fixed sized tapes buffer the container contents in memory
so append mode isn't relevant, but care must be taken to assure that
the buffer reading starts at the beginning of the file without regard
to the explicit open mode.
As reported in #821
For the PDP11, this includes deferring the setting of DONE on an error, allowing RSTS V4 to work correctly.
There was a minor (possibly only theoretical) bug in dt_seterr as well.
dt_seterr is supposed to stop the drive. If the drive is accelerating, at
speed, or stopped, it works fine. But if the drive is decelerating, it did
not clear out the "successor" states. In theory, the drive could be in the
middle of reversing - that is, there are successor states of accelerating
(in reverse) and at speed. So the successor states need to be cleared,
or the drive won't actually stop.
The fifth DECtape controller (the PDP8's TD8E) is much simpler and
doesn't have the problem.
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.
1. Added RP03 support and supporting "SET" commands.
2. Fixed implementation of DPCF (it's a full reset and not blocked by BUSY).
3. Fixed handling of JOB DONE flag (not touched by NOP, SEEK, or RECAL).