Commit graph

169 commits

Author SHA1 Message Date
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
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
ef9d1adce1 PDP10, PDP11, VAX: const cleanup 2015-02-13 06:18:24 -08:00
Mark Pizzolato
9accae5905 BESM6 and VAX: Cleanup for building on VMS 2015-02-12 12:32:39 -08:00
Mark Pizzolato
c7131700c0 Remote Console: Enhancements
- Accept input comments
 - Allow leading and trailing spaces in remote console input commands
 - Force prompt to be "sim> " or "SIM> " when in a master mode console session. "SIM> " used during single command mode.
 - Enhance performance of single command mode input processing by processing all available input characters before actually flushing output buffers

TMXR API extension to add tmxr_input_pending_ln that reports the existence of additional input data

TMXR also now conforms to revised sim_sock API changes
2015-02-11 09:48:05 -08:00
Mark Pizzolato
d6e60b88b7 TMXR: Extend Telnet option negotiation to explicitly reject uninteresting options. Fix #177 2015-01-21 06:05:20 -08:00
Mark Pizzolato
b8940f4e32 TMXR: Add default debug bits for SEND/EXPECT operations 2015-01-06 08:24:44 -08:00
Mark Pizzolato
c083b45c14 TMXR, SOCK: Properly declare as const string input only arguments. 2014-12-06 03:50:45 -08:00
Mark Pizzolato
4eed007607 SCP: Restructured timer/co-scheduling activities to support co-scheduling on specific timers 2014-12-02 05:33:59 -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
02e90de6a4 SCP: Added EXPECT and SEND commands to react to data from and inject data into the simulated console port (and other MUX ports)
Ideas based on Dave Bryan's console halt efforts.

	sim> SEND {<mux>:line} {DELAY=n,}"string"

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
Delay is optional and once set persists for subsequent SEND operations to the same device.  Delay defaults to 1000.  The DELAY value is a minimum number of instructions which must execute before the next character in the provided string will be injected to the console port.  The DELAY value has effect between the characters delivered as well.  "string" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).

Each device (console, and each line in each mux) has a separate value for DELAY.

An arbitrary number of 'expect' conditions can be defined.  The command syntax is:

              sim> EXPECT {<mux>:line} {[cnt]} "matchstring" {actioncommand {; actioncommand ...}}

Where <mux> is the name of the device pointed to by the TMXR structure.  If <mux>:line isn't specified, then the console device is implicitly being referenced.
"matchstring" requires quotes and within the quoted string, common C escape character syntax is available (\r\r\t, etc.).  The quotes used can be single or double quotes, but the closing quote must match the opening quote.  The match string might be extended to allow the use of perl style regular expressions in the "matchstring" when a -R switch is specified on the command line.

              sim> EXPECT "Enter Color: "  SEND "Red\r"; g

A specific 'expect' condition can be removed with:

              sim> NOEXPECT {<mux>:line} "matchstring"

All 'expect' conditions can be removed with:

              sim> NOEXPECT {<mux>:line}

'expect' conditions can be examined with:

              sim> SHOW EXPECT {<mux>:line}

Expect rules are one-shots (i.e. they disappear once a match has occurred) unless they are explicitly described as persistent with the -P switch.
The -C switch is available when defining expect rules.  The effect of a rule defined with the -C flag is that when an expect match occurs for that rule, ALL rules are cleared for that device (console or <mux>:line).
2014-10-14 10:49:24 -07:00
Mark Pizzolato
f6eb4bc4f5 SCP: Fix buffered console implementation to correctly retain buffering attributes across independent SET CONSOLE commands 2014-05-11 06:16:46 -07:00
Mark Pizzolato
746e5ab88c SCP: Fix reporting of console's buffering status. Fix parsing of MUX settings which were simply interpreted by matching a single token. Reported by Mark Bensen. 2014-05-05 05:30:35 -07:00
Mark Pizzolato
84707acc7e Compiler suggested cleanup 2014-04-11 09:39:19 -07:00
Mark Pizzolato
74482ce448 PDP10, PDP11, VAX: Make sure that the DMC and DUP devices produce the right messages when an attach is attempted to an already attached line 2014-04-06 16:42:10 -07:00
Mark Pizzolato
ff0191cf29 TMXR: Properly enable packet mode (as inherited from the main mux) on each line. Only produce modem debug output when modem signals have changed. Cleanup the output of SHOW MUX. 2014-04-02 13:07:26 -07:00