Commit graph

94 commits

Author SHA1 Message Date
B. Scott Michel
8b14bb69be
CMake build infrastructure II (#53)
* 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.
2023-05-17 20:18:42 -04:00
Bob Supnik
28fd79ef06 All LP and CD devices: Removed use of ftell for pipe compatibility
Merge changes from v3.12-2
2022-06-16 16:13:46 -07:00
Bob Supnik
8d49d8c297 All Tape DEVICES: Added extra case points for new MTSE definitions
Merge changes from v3.12-2
2022-06-16 16:13:46 -07:00
Bob Armstrong
eac94b4bdb H316: update IMP 00readme.txt to match current code 2022-03-20 16:39:03 -07:00
Bob Armstrong
2a63d939d3 H316: Coverity update - remove dead code; fix formatting 2022-03-16 10:56:21 -07:00
SpareTimeGizmos
b779bfc1cd H316: Fix missing initialization and remove dead code found by Coverity 2022-03-15 08:35:47 -07:00
Mark Pizzolato
8c325db1ab Various Magtape Devices: Handle Coverity report of tape error status cases
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.
2022-03-13 11:23:11 -07:00
Lars Brinkhoff
70af29ac0c H316: The UDP code doesn't need anything from h316_defs.h.
Removing this line makes it easier to reuse the h316_udp.c file in
other simulators that want to use the IMP-host interface.
2021-11-01 18:17:46 +01:00
Lars Brinkhoff
1e4401fd84 H316: Call the host interface TX service routine.
The modem and host interface TX services should both be called from
the RTC device, but when the host interface was implemented the call
was not added.
2021-10-21 14:16:23 +02:00
Lars Brinkhoff
5dcc00ea10 H316: Fix debugging host interface messages. 2021-10-21 14:14:21 +02:00
Lars Brinkhoff
4e162c0586 H316: Signal the host/IMP ready bits in the host interface.
This adds a new flag to the host interface UDP packages to indicate
the ready bit of the sender.  The flag comes along all packets, but an
empty packet can be sent to change the ready status without
transmitting data.
2021-10-21 14:14:04 +02:00
Lars Brinkhoff
53e81819e0 H316: Fix reading messages from the host interface.
The 1822 IMP-host interface carefully handshakes every bit
transferred.  Thus the DMC facility can read messages piecewise.  The
IMP uses this to read a 32-bit leader first, and process the rest or
the message in another round.

The IMP expects the 1822 end of message bit not to be set until after
the entire message has been read.
2021-10-21 14:10:20 +02:00
Lars Brinkhoff
3baaf6c028 H316: Fix host interface word counts.
The host interface uses the UDP packet format from the modem
interface, with an additional flags word.  Ensure the flags are
not included in the word count.
2021-10-18 14:25:59 +02:00
Mark Pizzolato
e519c93ebf H316, NOVA, PDP11, PDP8, PDP18B, KX10: Record Sequential updates consistently
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.
2021-06-08 14:25:23 -07:00
Mark Pizzolato
68e407ba0f ALL: Correct help text in "SET <unit> LOCKED" MTAB entries 2021-04-19 15:22:15 -07:00
Mark Pizzolato
a015e44c10 ALL: Standardize writelock behavior adding global UNIT_WLK & UNIT_WPRT
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
2021-04-19 10:58:51 -07:00
Mark Pizzolato
962552b213 H316: Compiler warning cleanup
Fix inconsistent statement indentations.
2020-10-19 12:28:25 -07:00
Mark Pizzolato
ae825c9afb All: Declare sim_stop_messages as an array SCPE_BASE long
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.
2020-09-02 15:56:07 -07:00
Mark Pizzolato
4099330616 H316: Open LPT, PTP devices for append
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.
2020-04-30 05:18:47 -07:00
Mark Pizzolato
614ad52091 All: Fix devices that attach files and have special meaning for -A switch
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
2020-03-22 09:54:54 -07:00
Mark Pizzolato
a2300fcf95 H316: Fix format types in debug messages 2020-02-17 19:16:15 -08:00
Mark Pizzolato
36a732b26f H316: Update error and warning messages to properly use SCP APIs 2020-02-16 17:30:20 -08:00
Mark Pizzolato
bbb545d4bd H316: Add Bob Armstrong's Readme documentation for the IMP tests 2020-02-16 17:25:54 -08:00
Charles Anthony
e8bceec8e2 H316: Implement the IMP host interface.
- From Charles Anthony passed through Lars Brinkhoff
- Cleaned up for cross platform builds - Mark Pizzolato
2020-02-15 13:19:37 -08:00
Mark Pizzolato
4fe9ae7f76 H316, Ibm1130, S3: Silence GCC warnings about potential format truncation 2019-12-30 17:44:15 -08:00
Mark Pizzolato
437e5a4bb5 H316: Use snprintf() to avoid potential buffer overflow 2019-07-16 04:12:42 -07:00
Mark Pizzolato
85770281fb H316: Remove Coverity indicated warnings rather than declaring them intentional 2019-07-07 19:29:30 -07:00
Mark Pizzolato
b437bfc280 H316: Avoid name space collision for the global variable PC
When dynamic loading readline, it intenally defines/references a variable
named PC which collides with a simulator defined global variable and
readline doesn;'t work for SCP ommand recall and possibly interferes with
simulator operation.
2018-12-31 09:56:10 -08:00
Mark Pizzolato
05f682115c H316: Avoid potential buffer overflow for UDP connect string 2018-08-27 12:09:25 -07:00
Mark Pizzolato
6c425cc790 H316: Expose RTC INTERVAL and QUANTUM values in registers update testrtc.cmd
testrtc.cmd updated with dynamically computed timing information
2018-05-24 13:39:28 -07:00
Bob Supnik
5b5e0f9c35 H316, I7094, NOVA, PDP1, PDP10, PDP8, SDS: Coverity singleton errors
Most history routines defined a local sim_eval of the proper length, but the
erroneous ones were fixed length machines that defined an integer variable
instead of an integer array of length 1. The VAX used the global sim_eval.
The changes follow the VAX practice.
2017-09-07 09:59:04 -07:00
Bob Supnik
a040eb4e32 I1401: Fixed MTF length checking (COVERITY) 2017-03-20 07:43:41 -07:00
Bob Supnik
fa62a00fd0 GRI, H316, I7094, NOVA, SDS, sigma: Annotate switch case fall through (COVERITY) 2017-03-13 10:44:51 -07:00
Mark Pizzolato
d8dbc7e6b5 SCP: Migrate all stdio writes to pass through SCP provided Fprintf() 2017-01-14 20:48:09 -08:00
Mark Pizzolato
5531ccb175 ALL: Massive 'const' cleanup
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.
2016-05-15 15:25:33 -07:00
Mark Pizzolato
230e588b5d ALL: Merge with Supnik-Current 2015-05-10 06:05:11 -07:00
Mark Pizzolato
41978eca80 All: Convert from C runtime library perror() to sim_perror so that all messages will arrive in the same place(s). 2015-04-03 19:56:37 -07:00
Mark Pizzolato
fb3c5327b7 H316: Merge updates from Bob Supnik and Bob Armstrong (Instruction decoding) 2015-04-03 18:49:44 -07:00
Mark Pizzolato
e768629009 SCP: Added the capability for EXAMINE command output to be written directly to a socket. 2015-02-21 12:40:36 -08:00
Mark Pizzolato
54a4845fb2 ALL: Revert "ALL: make sure all useful state is in simh registers while processing events"
This reverts commit 5551a0dd9c.

The original idea was that the state being put into simh registers would be required to have all useful information available when remote console executed commands.  These steps were taken from the code that sim_instr() executed as it was exiting.  After this change was made it was realized that once a remote console command executed it might change state that directly affected instruction execution.  To solve this, the logic that executes before the instructions in sim_instr() would then need to be executed whenever the event dispatch processing completed.  This approach is messy, burdensome and potentially a lot of overhead for every event dispatch even though almost none of the event dispatches would be for remote console command execution.  A completely different approach was suggested by J. David Bryan.  That alternative approach would be to have remote console commands execute outside of the sim_instr() routine.  Thus allowing the existing prelude and postlude code in sim_instr() to be performed naturally and let the remote console activities run in the same context as all other simh commands.  Recent changes to scp and sim_console implement this alternative approach and thus these original changes are completely irrelevant and are thus being removed.
2015-02-15 12:42:32 -08:00
Mark Pizzolato
0b015efcac Compiler suggested cleanup 2015-02-11 12:25:11 -08:00
Mark Pizzolato
1fb209c275 SOCKETS: Cleanup, simplify and extend the sim_sock API set.
Cleanup/Simplification by:
	1) removing irrelevant master flag variable from sim_close_sock and thus sim_err_sock
	2) change previous boolean feature arguments (datagram, nodelay, reuseaddr) to flag bits in a single option argument.  This allows for features to be added by new flag bits which don't change the calling signatures.
	3) changed all status returns to be int (vs t_stat) with success being 0 and error being -1
	4) removed unneeded simh specific type references to allow sim_sock to be used by n
Extended API by providing flags to influence socket setup/behavior:
	SIM_SOCK_OPT_REUSEADDR	Retains prior behavior when sim_switches had -U set
	SIM_SOCK_OPT_DATAGRAM	UDP socket setup provided for when prior datagram argument was specified
	SIM_SOCK_OPT_NODELAY		TCP Nagle disable provided for when prior nodelay argument was specified
	SIM_SOCK_OPT_BLOCKING	Blocking socket mode (detault is non blocking)
2015-02-11 09:41:18 -08:00
Mark Pizzolato
5551a0dd9c ALL: make sure all useful state is in simh registers while processing events 2015-01-15 12:37:07 -08:00
Mark Pizzolato
c548b34772 Compiler suggested cleanups. 2014-10-27 17:14:28 -07:00
Mark Pizzolato
995ab8f1e2 More General cleanup migrate to using sim_printf vs separate calls to printf and fprintf(sim_log). 2014-10-24 14:37:37 -07:00
Mark Pizzolato
3256c10c77 General cleanup migrate to using sim_printf vs separate calls to printf and fprintf(sim_log). 2014-10-22 17:12:14 -07:00
Mark Pizzolato
3951ad2432 Cleanup of unneeded global extern declarations 2014-10-10 08:18:15 -07:00
Mark Pizzolato
0e753b7c45 Compiler indicated cleanups 2014-01-06 13:14:16 -08:00
Mark Pizzolato
c1aa85d944 H316: Updated H316 and IMP documentation and addition of IMP modem loopback functionality and testing (from Bob Armstrong) 2013-12-03 06:56:38 -08:00
Mark Pizzolato
8810571d7e H316: Improve IMP error recovery when a remote host is restarted. 2013-12-02 12:00:48 -08:00