Commit graph

185 commits

Author SHA1 Message Date
Mark Pizzolato
d0bd4fbdff TMXR: Enforce output rate limiting when output is produced by instructions
Calls to tmxr_putc_ln() executed directly within instruction simulation code
(as opposed to during event servicing) will delay reasonable times
2017-05-11 08:42:31 -07:00
Mark Pizzolato
1cc845b26c TMXR: Fix various potential buffer overruns (COVERITY) 2017-03-10 11:55:29 -08:00
Mark Pizzolato
0046905f72 TMXR: Added ability to quiet attach message confirmations
-Q switch or SET QUIET will suppress the attach message confirmation
2017-01-23 10:39:41 -08:00
Mark Pizzolato
34ffe98605 TIMER: Fixed generic coscheduling and extended details in debug information 2017-01-17 16:29:55 -08:00
Mark Pizzolato
d5a56e0ab4 SCP: Take care to only write to a socket a single time and when appropriate 2017-01-16 14:25:38 -08:00
Mark Pizzolato
11c0251059 SCP: Make sure that log and debug file I/O use a large (64K) buffer 2017-01-16 12:56:33 -08:00
Mark Pizzolato
c9276407e6 TIMER: Timing corrections and enhancements
- Add support to query remaining usecs on pending events.
- Generalized the sim_interval adjustment in sim_idle to allow more than
   a single decrement.
- More overhead reduction when idling.
- Carry usec values as double through out to fully support long wall clock
   delays.
2016-12-30 10:26:59 -08:00
Mark Pizzolato
e776a37e08 TMXR: Fix tmxr_clock_coschedule() to properly convert to ticks 2016-12-12 12:50:49 -08:00
Mark Pizzolato
180b03107e TMXR: Properly accept ticks rather than instructions in coschedule APIs 2016-12-12 01:51:18 -08:00
Mark Pizzolato
89e372ba92 TIMER: Restore functionality for clocks devices that don't use sim_activate_after
Clock devices which call sim_register_clock_unit or sim_register_clock_unit_tmr
are best behaved if they use sim_activate_after to schedule their tick events.
2016-11-22 01:24:26 -08:00
Mark Pizzolato
39d2944ede TIMER: Add support for catchup clock ticks and cleaned up asynchronous clocks
Asynchronous clocks are now built for all simulators which are built with
SIM_ASYNCH_IO defined.  The default behavior has asynchronous clocks
disabled since this is still experimental, but it can be enabled with
SET TIMER ASYNC.

Catchup clock ticks are now available, but since they're experimental,
they aren't enabled by default.  Catchup ticks are only available if the
simulators clock device calls sim_rtcn_tick_ack to acknowledge processing
of clock ticks.  The VAX simulators have been modified to leverage this.
Catchup clock ticks can be enabled with SET TIMER CATCHUP

Additionally, an idle threshold is provided which can be used to
influence when clock calibration may be suppressed.  The default is not
to suppress calibration activities.

The various timer behaviors are visible with the SHOW TIMER command.

The state of the operating timer facilities is visible with: SHOW CLOCK

Timer events which are queued are visible with the SHOW QUEUE command.
2016-11-16 23:50:53 -08:00
Mark Pizzolato
6e0c26d85a TMXR: simplify #if expression conditions for SIM_ASYNCH_MUX 2016-11-12 13:21:45 -08:00
Mark Pizzolato
afad8ad374 TMXR: Add help indicating speed factor specification for console and mux lines 2016-11-05 02:52:58 -07:00
Mark Pizzolato
c1ca3d4612 SCP: Add missing help mentioning SET CONSOLE SPEED 2016-09-24 05:04:44 -07:00
Mark Pizzolato
b8b95c7b20 TMXR: Avoid closing file descriptor 0 when disabling serial port console output
Properly initialize TMXR structure when attaching to a serial port so a
subsequent close will not attempt to close the uninitialized ring_sock.
2016-07-15 03:58:52 -07:00
Mark Pizzolato
a9e17075ce TMXR: Reworked output to physical serial ports to avoid host OS buffering 2016-07-15 03:55:21 -07:00
Mark Pizzolato
553bc357b9 TMXR: Fix logic to use single character output buffer for serial ports 2016-07-14 08:01:03 -07:00
Mark Pizzolato
f2656acb38 TMXR: Fix logic which interprets DTR transitions 2016-06-19 08:08:19 -07:00
Mark Pizzolato
a24aba69ae VIDEO: Added priority boost to thread performing SDL processing and updates
Reworked all priority adjustment code to leverage a new
sim_os_set_thread_priority API which is coded to use pthreads or OS
priority adjustment APIs as necessary.
2016-06-11 09:52:33 -07:00
Mark Pizzolato
1c551b7b5a TMXR: Use single character output buffer when writing to physical serial ports 2016-06-11 08:28:28 -07:00
Mark Pizzolato
451b53daeb TMXR: Allow Line based logging to be both disabled and enabled before attach
Previously attempts to disable logging for an unattached mux (or line) could
crash the simulator.
2016-05-24 08:53:05 -07: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
4a47113faa TMXR: Properly initialize incoming line ring state to accepe connections 2016-04-13 12:48:33 -07:00
Mark Pizzolato
e05de3e50c TMXR: Provide Modem RING signal to notify MUX line of potential connection
When a new connection arrives it will be bound to the first line found
which has DTR enabled (considering the line order rules).  If none is
available, then all currently unconnected lines will have the RING signal
enabled.  If no such lines exist, the incoming connection is rejected with
"All connections busy".   If a currently disconnected line (with RING
enabled) raises DTR within 3 seconds, then that line gets the pending
connection and all other lines with RING enabled have RING disabled.
If 3 seconds pass without DTR coming up on any line with RING enabled
coming on, all lines with RING enabled will have RING disabled and the
incoming connection will be rejected with "No answer on any connection"
2016-04-08 03:09:51 -07:00
Mark Pizzolato
7b3e63aa75 TMXR: Return modem Ring signal only for connected lines
Ring indicates an incoming call and should preceded carrier coming up,
it shouldn't persist beyond the initial call/session setup.
2016-04-07 16:46:03 -07:00
Mark Pizzolato
3fadb7e376 TMXR: Allow DTR drop to disconnect any network connected line.
Previously, this only worked for lines which had full modem signaling enabled.
2016-04-07 10:19:26 -07:00
Mark Pizzolato
ed4631b8e9 TMXR: Fix RESTORE for full modem lines connected to serial ports
Full modem lines depend on the simulated OS to fully configure the line
parameters (speed, parity, etc.), so setting line speed during a normal
attach violates that behavior.  However, when a RESTORE operation is
being performed, we are obliged to restore the OS set line parameters
which we know were already set by the simulated OS.
2016-04-07 10:09:30 -07:00
Mark Pizzolato
af0420f92b TMXR: Add explanatory messages to attach failures 2016-03-16 12:24:41 -07:00
Mark Pizzolato
9de34d7f60 TMXR: Avoid assigning incoming connections to modem enabled lines which don't have DTR raised. 2016-03-15 17:32:09 -07:00
Mark Pizzolato
c1e7dfcf06 TMXR: Make sure all types of incoming connections properly support telnet
Per line listeners also need to potentially negotiate Telnet options.  Make sure
that the telnet option bookkeeping info is available.
2016-02-14 08:10:00 -08:00
Mark Pizzolato
5da0d954c4 MUX: Add line disconnect message when a simulated line is dropped due to DTR transition,
To promote clarity of experience, a user on a telnet connected line (which
supports modem control signaling) will receive a "Disconnected from
{simulator name}" message when a session is explicitly terminated by the
simulated system.  This allows the user to differentiate that case from the
simulator merely being powered off or otherwise crashing.  This behavior
mirrors the "Connected to the {simulator name}" message that is presented
when the connection is established.
2016-01-25 05:00:07 -08:00
Mark Pizzolato
d8f2647f93 SCP: general const cleanups and const change to sim_vm_parse_addr. 2016-01-24 08:27:08 -08:00
Mark Pizzolato
ca4a690174 TMXR: Fix multi-line input rate limiting logic 2015-12-19 12:12:53 -08:00
Mark Pizzolato
de0d251c75 TIMER, SCP: Change the sim_activate_after APIs to pass the delay value as uint32.
Also change all sim_defs.h structure declarations and references of sim_
structures to use the typedef names everywhere.
2015-12-10 06:33:59 -08:00
Mark Pizzolato
ed5353b4f4 TMXR Properly select the delay time considering all the lines on a mux.
A multiplexer may have a combination of speed limited behaviors on
different lines, and there may be lines which are idle and lines which
are actively receiving input.  Some of the problems described in #252
are fixed by this.
2015-12-08 17:10:05 -08:00
Mark Pizzolato
0938d31e59 PDP11, VAX: MUX input rate limiting works correctly with input arriving on multiple lines concurrently. 2015-11-28 12:49:54 -08:00
Mark Pizzolato
f322f4b044 TMXR: Support input speed limits with a multiplier factor
Many simulators run instructions one or more orders of magnitude faster
than the original systems did.  Limiting simulated serial port input speeds
to legacy bits per second values presents the arriving data much slower
than the original systems ever saw it.  Given the processing capacity of the
simulated systems and the fact that the software and device interfaces
only know how to deal with the legacy speed values there is a need to
provide a way to allow input to arrive faster.  This problem is solved by
providing a speed factor as a part of a speed specification.  For example
a speed can be specified as "speed*factor" or "9600*10".
2015-11-27 13:47:53 -08:00
Mark Pizzolato
62e36241a4 PDP11, VAX: Support multiplexer input speeds greater than 9600bps for console, DZ, VH, DL and DC devices
Each of the speeds greater than 9600bps deliver a character in less than
1ms.  Computing inter-character delays in microseconds therefore can't
be precise enough to be well behaved.  Measuring the inter-character
delays in instructions (scalled by the calibrated clock) gets us the needed
precision.
2015-11-25 04:25:21 -08:00
Mark Pizzolato
0f43551d8c TMXR: Minor typo in help text fixed. 2015-11-19 10:06:25 -08:00
Mark Pizzolato
833ba71c3b PDP11, VAX: Enhance VH, DZ, DL and DCI devices to provide input rate limiting. Fix #246
Data arriving on simulated serial ports can arrive faster than the OS running
on the simulated system can deliber it to user mode programs.  This happens
when chunks of data are delivered to the mux from a network connection.
This can be due to a file transfer program (kermit) running on the other end
of a network connection and the packet size being delivered exceeds the
simulated OS's type ahead buffer size OR from users who paste arbitrary
blocks of data into a telnet or console session.
2015-11-19 08:56:06 -08:00
Mark Pizzolato
53796ba961 TMXR, CONSOLE: Add optional ability to rate limit input data to approximate bps values
A SET CONSOLE SPEED=nnn, where legal values for nnn are common serial
port rates.  The speed value will attempt to limit the input data rates to a
simulator to approximately the specified bits per second.
2015-11-18 10:44:19 -08:00
Mark Pizzolato
d95d32b6d7 TMXR: Return reasonable error status when disconnecting a line without specifying the line 2015-11-01 20:19:59 -08:00
Mark Pizzolato
9fdd8a8706 TMXR: Fix debug output of remaining data after removing telnet negotiation from the input buffer 2015-09-02 16:49:47 -07:00
Mark Pizzolato
77152c6e20 MUX: Fix for connection establishment logic for virtual null modem connections.
Test case provided by Ed Marr using PDP11 DL devices.
2015-08-18 09:52:49 -07:00
Mark Pizzolato
9307fbdf54 MUX: Fix attach parsing of Log File names and no telnet options. Issue found by Ed Marr. 2015-08-16 11:05:44 -07:00
Mark Pizzolato
047a6b856f TMXR: Added delay to assure that simulator internally generated messages get fully transmitted on TMXR lines. 2015-06-26 11:46:49 -07:00
Mark Pizzolato
fa407e678b PDP10, PDP11, VAX, MUX: Fix allowed line attach syntax to accept UDP in any order among attach arguments 2015-05-23 17:08:51 -07:00
Mark Pizzolato
1d3ac294c4 SCP: Make sure that dynamically allocated print buffers have room for NUL character string terminator 2015-03-30 10:15:33 -07:00
Mark Pizzolato
137f825811 SCP: Removed unused conditional compile referenced to HAS_vsprintf_void and HAS_vsnprintf_void. Avoid emitting redundant \r characters when writing to stdout while a simulator is running. Suggestions from Bob Supnik. 2015-03-29 16:21:27 -07:00
Mark Pizzolato
71fe58b33a FRONTPANEL: Added better protocol debug support to debug simulator startup issues 2015-02-26 11:28:08 -08:00