1
0
mirror of https://github.com/simh/simh.git synced 2026-01-11 23:52:58 +00:00

290 Commits

Author SHA1 Message Date
Mark Pizzolato
18c594004e TMXR: Properly reference incoming socket in tmxr_close_master
A "ringing" (pending incoming) connection is only possible when a
listening socket exists.
2025-07-01 05:44:11 -10:00
Mark Pizzolato
912f421144 CONSOLE: Add general support for SET CONSOLE SPEED=nnn
The original SET CONSOLE SPEED=nnn was added to a allow direct wired
terminal connected to a host system serial port to be a simulator's console.
The current change generalizes all console I/O such that speed is a reliable
option for direct console connections as well as serial and telnet connections.

The simple recipe to get well behaved console output speed is:
1) call tmxr_set_console_units() in the reset routine of the console DEVICE.
2) In the code path that engages console output do something similar
    to this as appropriate for the system being simulated:
        void txdb_wr (int32 data)
        {
        tto_unit.buf = data & 0377;
        tto_csr = tto_csr & ~CSR_DONE;
        CLR_INT (TTO);
        sim_activate (&tto_unit, tto_unit.wait);
        }

3) In the output unit's service routine the console output unit's service
    routine do something similar to this as appropriate for the system
    being simulated:
        t_stat tto_svc (UNIT *uptr)
        {
        int32 c;

        c = sim_tt_outcvt (tto_unit.buf, TT_GET_MODE (uptr->flags));
        if (c >= 0) {
            t_stat r;

            if ((r = sim_putchar_s (c)) != SCPE_OK) {           /* output; error? */
                sim_activate (uptr, uptr->wait);                /* retry */
                return ((r == SCPE_STALL)? SCPE_OK: r);         /* !stall? report */
                }
            }
        tto_csr = tto_csr | CSR_DONE;
        if (tto_csr & CSR_IE)
        SET_INT (TTO);
        }
The almost all of the current simh simulators already are implemented
with logic like the above example.  These will work just fine with the
newly regulated console speed.
2025-06-24 09:57:49 -10:00
Mark Pizzolato
c4d3aadc68 TMXR: Make sure to add single line mux with a destination to open list 2025-03-17 14:51:11 -10:00
Peter Schorn
c7df248f09 SIMH: Fix spelling errors in comments and strings 2024-07-16 12:04:53 -10:00
Mark Pizzolato
d71ce79d13 TMXR: Increase the maximum buffer size for BUFFERed lines to 10 million bytes 2024-04-18 16:35:16 -10:00
Mark Pizzolato
49902b830e TMXR: Add support for tcp port listen backlog
The system default of no extra backlog has generally worked well for
simulated mux devices for a long time since reasonable arrival of
new tcp connections is usually expected to have gaps of minutes.

If, for some reason, connection arrivals in a particular case can
happen multiple times per second, a backlog might be useful.
2023-06-30 03:35:54 -10:00
Mark Pizzolato
f98a925a28 TMXR: Avoid potential NULL pointer dereference after aborted ATTACH 2023-04-09 15:51:50 -10:00
Mark Pizzolato
194b313179 SCP: Fold up include files used by all simulators
- Add common system includes used in may places which are allowed
  and thus added directly in sim_defs.h.
- Separate completely private system data structures and system APIs
  for use only by SCP library routines into sim_scp_private.h.
2023-03-04 17:51:49 -10:00
Mark Pizzolato
08a7dc8417 TMXR: Migrate SEND & EXPECT structures out of TMLN structure
The TMLN structure now has pointers to the line's SEND and EXPECT
structures which are dynamically allocated at attach time.
2023-02-05 05:39:04 -10:00
Mark Pizzolato
a79c583053 TMXR: Remove all SIM_ASYNCH_MUX dependent code
Asynchronous MUX functionality was added long ago and never completely
tested and thus never completed and never actually used.

All of what it was supposed to achieve was independently achieved when
bit rate speed functionality was added.
2023-01-21 09:12:45 -10:00
Mark Pizzolato
1baed4f7d4 PDP11: Properly set DC, DL and DLCJ unit relationships to TMXR structures
Fix problem reported on DC device by Alan Kirby
2023-01-18 01:54:37 -10:00
Mark Pizzolato
6f1538de9c TMXR: Be sure to flush pending output data when enabling logging on a line 2022-12-20 16:26:48 -10:00
Mark Pizzolato
e133994924 TMXR: Emit pending line buffered output to log when line logging is enabled 2022-12-19 12:14:52 -10:00
Mark Pizzolato
107813b11b SCP: Change sim_abort to SIM_SCP_ABORT macro.
SIM_SCP_ABORT is ONLY for use in scp support libraries
2022-07-30 11:18:08 -10:00
Mark Pizzolato
bc98e1c609 SCP: Be sure to flush output files when aborting.
Emit a last gasp message prior to flushing files before aborting.
2022-07-17 13:01:25 -10:00
Mark Pizzolato
06c696385f SCP: Coverity inspired changes 2022-03-06 02:11:57 -08:00
Mark Pizzolato
92415062b5 TMXR: Count per line TCP sessions 2022-03-03 17:41:12 -08:00
Mark Pizzolato
a4054f33b8 SCP: Add command argument passed into library unit test routines 2022-02-07 04:21:16 -08:00
Mark Pizzolato
9f3bd71e66 TMXR: Avoid use of C++ reserved word 2022-02-06 18:23:20 -08:00
Mark Pizzolato
35503f4765 TMXR: Add Access Control List (ACL) support for incoming network connections 2022-02-04 07:59:08 -08:00
Mark Pizzolato
dbc0ea4114 TMXR: Reject serial port attach config for programmaticly configured mux 2022-02-04 07:54:28 -08:00
Mark Pizzolato
67845e4301 TMXR: Add debug output reporting line configuration changes 2022-01-25 16:41:57 -08:00
Paul Koning
5cd1e8b7ac TMXR, PDP11, PDP10, VAX: Add DDCMP sync framer support
This adds support for the "framer" device, which is a USB-connected
device built around a Raspberry Pico that connects to a synchronous
line, either RS-232 or DEC "integral modem" coax connection.  It
implements the framing portion of DDCMP: clock recovery for the
integral modem case, byte sync, and DDCMP frame handling including
CRC.  The actual DDCMP protocol state machine, with its handling of
sequencing, timeout and retransmit, etc. is left to the host
software.  All the design files for the framer may be found at
https://github.com/pkoning2/ddcmp .

This commit adds code to drive the framer from the TMXR library,
allowing it to be used either from simulated DMC-11 or simulated
DUP-11 devices.  Both have been tested, using RSTS/E, RSX-11/M+, and
TOPS-20.

Fixed the one-digit limit on eth<n> device names, the limit is now 2.
2022-01-08 14:24:42 -08:00
Mark Pizzolato
c4bbb75303 TMXR: Fix potential memory leak when already out of memory 2021-08-23 12:08:42 -07:00
Mark Pizzolato
f95b20e1f3 SCP: Cleanup potential compiler warnings 2021-08-13 09:09:53 -07:00
Mark Pizzolato
3597772a08 TMXR, ETHER: Silence potential compiler warnings 2021-06-08 13:39:20 -07:00
Mark Pizzolato
287ebb3ea8 TMXR: Update tmxr_set_lnorder and add test of same 2021-06-08 13:07:03 -07:00
Mark Pizzolato
e353b910ea TMXR: Fix Coverity identified missing status check 2020-12-11 07:18:27 -08:00
Mark Pizzolato
07d37f6d9e TMXR: Clarify comments on API description and variable names
This is all around the tmxr_set_get_modem_bits() API.
This change is non operational, but this clarification would avoid the
mistake made when someone uses or thinks about changing that
API in the future.
2020-11-03 07:58:42 -08:00
Mark Pizzolato
e3572e1a9f TMXR: Fix modem status bit retrieval to also return DTR and RTS
The prior change disabled returning DTR and RTS which the documented
interface was quite specific about actively returning.

The only user of this API which actually cared about DTR and RTS was
the in the pdp11_dmc module.

As reported in #951
2020-11-02 16:42:56 -08:00
Mark Pizzolato
c8a8cca7a3 SCP: Add optional per line multiplexer log files to periodic flushing 2020-10-20 02:47:33 -07:00
Mark Pizzolato
06c878b96a TMXR: Properly report SCPE_STALL when transmit buffer is full 2020-09-27 09:38:10 -07:00
Mark Pizzolato
9a73eb9d9d TMXR: Fix attach TELNET and MESSAGE parsing validation 2020-08-21 12:14:37 -07:00
Mark Pizzolato
c00376d363 TMXR: Properly honor tmxr_set_notelnet and tmxr_set_nomessage APIs 2020-06-26 22:57:57 -07:00
Mark Pizzolato
136e16d54e TMXR: Add option to avoid connect message for incoming TCP connections
As discussed in #843
2020-06-21 14:18:03 -07:00
Mark Pizzolato
5523450d5c TMXR: Add option to disable/enable telnet mux wide 2020-06-21 13:15:33 -07:00
Mark Pizzolato
c8389a7bfd TMXR: Properly control and record modem bits on serial lines
As reported in #877 and #878
2020-06-13 08:58:38 -07:00
Mark Pizzolato
e1a6a997eb REMOTE_CONSOLE: Avoid rate limiting output to remote console sessions
As discussed in #865
2020-06-02 12:06:18 -07:00
Mark Pizzolato
52c1b5416f TMXR: Change output rate limit to 1 ms when cpu is stopped
As reported in #865

When instruction execution is stopped, forced mux output rate limiting
can't leverage instruction execution rate to time inter-character delays.
A direct sleep is used but that has a minimal granularity measured in
milliseconds.  The prior default for a non speed controlled line was 10ms
sleep between character output.  This has been changed to 1ms which
is reasonable for most situations.  Meanwhile, since the remote console
facility uses TMXR, and it has the reasonable ability to generate output
when instructions are not being executed, this is better but not perfect.
2020-06-02 11:42:51 -07:00
Mark Pizzolato
ee1c055abe TMXR: All sockets should default to non blocking 2020-04-13 17:29:42 -07:00
Mark Pizzolato
91550ec291 TMXR: Active outbound TCP connects should be non-blocking
- add testing for socket address parsing
- extend testing for various connect scenarios
2020-04-11 13:08:08 -07:00
Mark Pizzolato
3d2394a2fb SOCK: Add tmxr (and socket) library tests 2020-03-31 09:07:39 -07:00
Mark Pizzolato
89cd649c77 SOCKET: Implement missing non-blocking for TCP sockets opened with connect
Outbound connections are rare and most may have wanted explicit blocking
behavior, so no one noticed the missing non-blocking case.

Any place which did do outbound connects have explicitly added
SIM_SOCK_OPT_BLOCKING so that the prior behavior is preserved.

The SIM_SOCK_OPT_BLOCKING flag is no honored as it was originally
intended to be.
2020-03-18 00:47:48 -07:00
Mark Pizzolato
08d2bafb28 TMXR: Remove the ability to detach a serial port while the simulator is running
As discussed in #782
2020-02-18 13:55:22 -08:00
Mark Pizzolato
0fca58a6da TMXR: Add documentation for the -U switch when attaching to a listen port
As mentioned in #782
2020-02-18 13:31:20 -08:00
Mark Pizzolato
3c9efd7fdb TMXR: Accept names when establishing listen sockets as originally intended
Problem found while testing solution for the problem reported in #767
2019-11-14 13:13:46 -08:00
Mark Pizzolato
d40268d1ac TMXR: Silence GCC 8.3 warning about buffer overrun 2019-09-05 17:41:01 -07:00
Mark Pizzolato
9e71982249 SCP: Avoid potential buffer overflow using sprintf
- avoid warnings about snprintf truncation

As reported in #717
2019-07-02 09:53:56 -07:00
Mark Pizzolato
1a48c543d5 TMXR: Fix tmxr_rqln() when speeds are enabled to avoid aways ready condition. 2019-04-10 15:08:49 -07:00
Mark Pizzolato
3840765c63 TMXR: Properly test when adding debugging options only to DEV_MUX DEVICEs 2019-03-13 06:45:21 -07:00