Commit graph

72 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
8854da6c1b ID16, ID32: Fix register macro change missed when merging 3.12-2 2022-09-21 09:02:00 -07: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
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
Davis Johnson
8085f5ea25 ID32: Fix DP unit busy test
The problem turned out to be a call to sim_is_active() from id_dp.c with
an invalid pointer. This surprised me some since this isn’t a module that
changed significantly.

In normal disk operation the driver accesses the disk address (sometimes
called file address in the hardware docs) before accessing the controller
address. The simh disk emulator (dp.c) sets a current disk variable,
dp_svun, to the current disk address when a disk is accessed. It gets
set to 0 initially and under some other circumstances.

The address of passed to sim_is_active() is calculated, in part, by
subtracting the controller address from the disk address. This results
in a bigish negative offset from the beginning of an array if dp_svun
is 0.

The diagnostic sends a disarm-disable (x’c0’) command to every device
address, from 0 to x’3ff’. This hits the controller before the disk,
exercising the error.

This same thing happened in v38-1, but sim_is_active() did not
dereference the pointer passed to it, but scanned an array for that
pointer value. The current version does dereference the pointer.

My crude fix, which does not make me happy, is to replace the call
sim_is_active(uptr) with (dp_svun && sim_is_active(uptr)). This does
give behavior identical to v38-1 and allows me to proceed.
2021-07-21 18:44:35 -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
57071edbfa ID16, ID32: Compiler warning cleanup
- Initialize local state variables to 0.  Non functional changes due
  to lack of depth in static analysis scan.
2020-10-20 03:09:33 -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
4313f9fe3c PDP1, PDP10, PDP11, ID16, ID32, NOVA, VAX: 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-28 07:09:20 -07:00
Mark Pizzolato
f8f7ba3492 I1401, I7094, ID16, ID32, HP2100 and S3: Correct register definitions for checking 2020-03-07 19:59:04 -08:00
Mark Pizzolato
80d9393b83 alpha, HP2100, ID16, ID32, I7094, PDP11 and VAX: Fix array REG definitions
Array REGister definitions have been made consistent by passing the
name of the array object.  This allows proper sizing assessment
to occur in the register validation logic.

Some previously described array REGister initializers were not really
arrays.  Some were structures and others were merely pointers to
someplace in memory that it was desirable to view as a scalar array.

Structures or other blob data should now use SAVEDATA.  Virtual
arrays intended to be interpret some part of memory as scalar data
now use VBRDATA initializers.
2020-03-06 16:29:17 -08:00
Mark Pizzolato
90eddfc733 alpha, HP2100, ID16, ID32, PDP11 and VAX: Normalize array REG definitions
Array REGister definitions have been made consistent by passing the
address of the whole array object.  This allows proper sizing assessment
to occur in the register validation logic.
2020-03-01 12:11:13 -08:00
Mark Pizzolato
7b75c89aaf Interdata 16 & 32: Fix DP device width of RTIME, STIME, and WTIME definitions 2020-03-01 12:09:47 -08:00
Mark Pizzolato
b7b1f427d0 I1401, I7094, ID16, ID32, NOVA, SDS, SIGMA: CONST compatibility with 3.10 2018-03-09 15:55:22 -08:00
Mark Pizzolato
faae90e160 ID16: Fix potential uninitialized variable recording history (COVERITY) 2017-04-11 11:03:41 -07:00
Mark Pizzolato
1c83826b43 ID32: Fix potential uninitialized variable recording history (COVERITY) 2017-04-06 18:11:33 -07:00
Bob Supnik
e1f8e88373 ID16, ID32: Fixed testing of 8b mode and echoed character (COVERITY) 2017-03-20 07:47:42 -07:00
Bob Supnik
6f036bb6aa ID16, ID32: Added mask on EXE repeat count (COVERITY) 2017-03-09 19:49:01 -08: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
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
c221e1ff97 ALTAIR, Interdata, LGP, NOVA: Addition of sim_printf in various places from Bob Supnik 2015-04-03 18:33:31 -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
5551a0dd9c ALL: make sure all useful state is in simh registers while processing events 2015-01-15 12:37:07 -08:00
Mark Pizzolato
30d2db2abe GRI, I1401, I7094, ID16, ID32, LGP, NOVA: Change a few tabs to spaces which had crept in over time. 2015-01-12 12:14:01 -08:00
Mark Pizzolato
c2cef3c051 ALL: Avoid name space collision for the global variable PC when readline is dynamically loaded in many simulators. 2015-01-11 15:22:47 -08:00
Mark Pizzolato
c548b34772 Compiler suggested cleanups. 2014-10-27 17:14:28 -07:00
Mark Pizzolato
2e1167d4a0 Compiler suggested cleanups - mostly const fixups 2014-10-26 17:06:24 -07:00
Mark Pizzolato
4dbac410da SCP: Added const declarations to various APIs to reflect the appropriate usage. Moved parameter values for run_cmd and exdep_cmd to scp.h 2014-10-26 14:52:22 -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
026dd98d83 Merge latest from Bob Supnik 2013-10-12 13:33:01 -07:00
Mark Pizzolato
4e5f910fed Compiler nits for void * assignments from Bob Supnik 2013-09-04 19:50:47 -07:00
Mark Pizzolato
d5ca542102 Changed use of compile #defines which start with a _ character to not do this since defined symbols starting with _ are reserved to local compiler/runtime implementations in the C language. This addresses issue #32 2013-03-12 11:07:58 -07:00
Mark Pizzolato
83c1d80194 Merge branch 'master' into AsyncTmxr
Conflicts merged and missing changes in new modules added as needed for clock co-scheduling.
2013-01-21 16:52:42 -08:00
Mark Pizzolato
dac73b9381 Migrating scp and library global variables to be declared as extern in the appropriate library include file and remove repetitive declarations in referencing modules. 2013-01-10 13:29:15 -08:00
Mark Pizzolato
7b6f7a9871 Set device flags indicating DEV_DISK, DEV_TAPE, DEV_MUX and DEV_ETHER for all simulator devices which use the sim_disk, sim_tape, sim_tmxr, and sim_ether libraries 2013-01-07 12:47:24 -08:00
Mark Pizzolato
50cf91d441 Merge branch 'SerialMux' and compiler suggested cleanup 2012-12-18 09:52:14 -08:00
Mark Pizzolato
b466bdc9c6 Compiler warning cleanup 2012-12-13 13:41:57 -08:00
Mark Pizzolato
a3b0dc38fd Change the semantics of sim_is_active to return a t_bool (which was 98% of how it was used), and added new sim_activate_time to return the time a unit will be activated (the value previously returned). This affected a handful of used of sim_is_active in device implementations which were adjusted to use the sim_activate_time API. 2012-12-12 11:01:00 -08:00
Mark Pizzolato
030d790b4c Asynchronous Timer Support
scp.c, scp.h
	- Change the sim_clock_queue event list to be terminated by the value QUEUE_LIST_END instead of NULL.  This allows easy determination of whether a unit is on a list since when it is not on a list the next pointer is NULL.
	- standardized the usage of UPDATE_SIM_TIME
	- Added support for internal/pseudo devices to support the TIMER and CON-TEL pseudo devices (to enable and disable debugging)
	- Reverted to the prior "SET CONSOLE DEBUG" command semantics since the console debug can be manipulated via the generic "SET <dev> DEBUG" command (i.e. SET CON-TEL DEBUG=TRC;XMT;RCV)
	- Changed "SHOW TIMERS" to "SHOW CLOCKS" to display the current calibrated timer information
	- Added sim_is_active_bool API to return the boolean active status avoiding the potential work walking the list when most callers aren't interested in the event firing time
	- Fixed run_boot_prep to properly record the not queued status of any units which are removed from the sim_clock_queue during initialization
	- Added display of DEBUG, NODEBUG options to the SHOW SHOW command

    sim_timer.c, sim_timer.h
	- Added asynchronous timer capabilities with support for calibration and idling
	- Added internal/pseudo device to support debugging of Idle, Calibration and asynch timer activites.
	- Added suppression of timer calibration when idling has occurred

    sim_tmxr.c, sim_tmxr.h
	- Added tmxr_activate_after and macro definition for sim_activate_after to invoke it for proper behavior with multiplexer devices
	- Added all polling units to the standard timer queue when dropping back to the simulator command prompt to accommodate the potential to disable asynch mode
	- Fixed synchronization to operate with pthread synchronized asynch queue and proper stopping of poll when dropping back to the simulator command prompt
	- Fixed calls to select to have a timeout with properly ranged tv_usec values and dealt with possible EINTR return from select

    sim_console.c, sim_console.h
	- Changed internal/pseudo console telnet device name to CON=TEL
	- Reverted to the prior "SET CONSOLE DEBUG" command semantics since the console debug can be manipulated via the generic "SET <dev> DEBUG" command (i.e. SET CON-TEL DEBUG=TRC;XMT;RCV)
	- Fixed synchronization to operate with pthread synchronized asynch queue and proper stopping of poll when dropping back to the simulator command prompt
	- Fixed calls to select to have a timeout with properly ranged tv_usec values

    sim_defs.h
	- Added necessary unit fields to support asynchronous timing activities
	- Added asynchronous macros to support async timing activities
	- Fixed asynch pthread only macros (not using AIO_INTRINSICS).
	- Fixed the definition of the UDATA macro which was never adjusted to accommodate the insertion of 2 extra fields in the unit structure and thus made the initialization of the unit wait field meaningless.
	- Changed the NOQUEUE_WAIT value from 10000 to 1000000.  This is only used when the sim_clock_queue is empty, which normally never happens on any simulator since they all have clocks and/or other frequently polling devices.  With asynchronous multiplexer and timing support the queue is often empty and this value is then used when calculating idling delays.  If it is too small, idling will be inefficient.  Being large should not be a problem otherwise.

    Interdata/id16_cpu.c
	- removed test of sim_idle_enab before calling sim_idle

    Interdata/id32_cpu.c
	- removed test of sim_idle_enab before calling sim_idle

    vax/vax_cpu.c
	- removed test of sim_idle_enab before calling sim_idle

    vax/vax_stddev.c
	- converted CLK device to use the internal timer service API sim_activate_after to leverage asynchronous timing when available
2012-05-26 07:16:04 -07:00
Mark Pizzolato
0f8e6cfe95 Cleanup for warning messages produced by the clang C compiler. Mostly adding parentheses in conditional assignments and clarification parentheses in complex boolean expressions. 2012-04-29 11:59:44 -07:00
Mark Pizzolato
57008bb8f5 Cleaned up nested comments 2012-04-27 12:36:03 -07:00
Mark Pizzolato
db9bf32112 Merge of Bob's simh-v3.9-0-rc3 2012-04-23 11:50:43 -07:00
Mark Pizzolato
6e813b8364 Merge with v3.9-0-rc2 first pass 2012-03-24 19:46:37 -07:00
Mark Pizzolato
fabdf73bed Compiler cleanup after v3.9-0 merge 2012-03-19 16:07:36 -07:00
Bob Supnik
a9fd3dd518 Notes For V3.8
The makefile now works for Linux and most Unix's. However, for Solaris
and MacOS, you must first export the OSTYPE environment variable:

> export OSTYPE
> make

Otherwise, you will get build errors.

1. New Features

1.1 3.8-0

1.1.1 SCP and Libraries

- BREAK, NOBREAK, and SHOW BREAK with no argument will set, clear, and
  show (respectively) a breakpoint at the current PC.

1.1.2 GRI

- Added support for the GRI-99 processor.

1.1.3 HP2100

- Added support for the BACI terminal interface.
- Added support for RTE OS/VMA/EMA, SIGNAL, VIS firmware extensions.

1.1.4 Nova

- Added support for 64KW memory (implemented in third-party CPU's).

1.1.5 PDP-11

- Added support for DC11, RC11, KE11A, KG11A.
- Added modem control support for DL11.
- Added ASCII character support for all 8b devices.

1.2 3.8-1

1.2.1 SCP and libraries

- Added capability to set line connection order for terminal multiplexers.

1.2.2 HP2100

- Added support for 12620A/12936A privileged interrupt fence.
- Added support for 12792C eight-channel asynchronous multiplexer.

1.3 3.8-2

1.3.1 SCP and libraries

- Added line history capability for *nix hosts.
- Added "SHOW SHOW" and "SHOW <dev> SHOW" commands.

1.3.2 1401

- Added "no rewind" option to magtape boot.

1.3.3 PDP-11

- Added RD32 support to RQ
- Added debug support to RL

1.3.4 PDP-8

- Added FPP support (many thanks to Rick Murphy for debugging the code)

1.3.5 VAX-11/780

- Added AUTORESTART switch support, and VMS REBOOT command support

2. Bugs Fixed

Please see the revision history on http://simh.trailing-edge.com or
in the source module sim_rev.h.
2011-04-15 08:36:09 -07:00
Bob Supnik
9c4779c061 Notes For V3.8
The makefile now works for Linux and most Unix's. Howevr, for Solaris
and MacOS, you must first export the OSTYPE environment variable:

> export OSTYPE
> make

Otherwise, you will get build errors.

1. New Features

1.1 3.8-0

1.1.1 SCP and Libraries

- BREAK, NOBREAK, and SHOW BREAK with no argument will set, clear, and
  show (respectively) a breakpoint at the current PC.

1.1.2 GRI

- Added support for the GRI-99 processor.

1.1.3 HP2100

- Added support for the BACI terminal interface.
- Added support for RTE OS/VMA/EMA, SIGNAL, VIS firmware extensions.

1.1.4 Nova

- Added support for 64KW memory (implemented in third-party CPU's).

1.1.5 PDP-11

- Added support for DC11, RC11, KE11A, KG11A.
- Added modem control support for DL11.
- Added ASCII character support for all 8b devices.

1.2 3.8-1

1.2.1 SCP and libraries

- Added capability to set line connection order for terminal multiplexers.

1.2.2 HP2100

- Added support for 12620A/12936A privileged interrupt fence.
- Added support for 12792C eight-channel asynchronous multiplexer.

2. Bugs Fixed

Please see the revision history on http://simh.trailing-edge.com or
in the source module sim_rev.h.
2011-04-15 08:35:54 -07:00