Commit graph

39 commits

Author SHA1 Message Date
Mark Pizzolato
6a90ed44c7 VMS_BUILD: Fix build on OpenVMS/VAX host
As discussed in #394
2017-02-08 21:18:02 -08:00
Mark Pizzolato
c3496e4aa6 TMXR: Reworked output to physical Serial ports for VMS and Windows hosts
The goal being to have output to physical serial ports complete without host
OS level buffering so that what is transmitted via the serial port has correct
timing with respect to I/O completion status within a simulator.

Linux, OS X, and various other *nix host platforms still need work here.
2016-07-14 13:53:41 -07:00
Mark Pizzolato
4065f47f8c SCP: Add sim_strncasecmp for platforms which may not have strncasecmp
Consolidated the existing two previously implementations which existed in
sim_serial and sim_ether.
2016-07-12 09:23:46 -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
9d2079df68 SERIAL: Fix extra probes to start at 0. 2016-02-01 06:54:55 -08:00
Mark Pizzolato
de72cba08b SERIAL: Add probes for common serial port names on NetBSD.
Fixes #273
2016-01-31 11:55:41 -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
ef9d1adce1 PDP10, PDP11, VAX: const cleanup 2015-02-13 06:18:24 -08:00
Mark Pizzolato
2e1167d4a0 Compiler suggested cleanups - mostly const fixups 2014-10-26 17:06:24 -07:00
Mark Pizzolato
6ce8d99cd8 SCP: Added generic output routine sim_printf to output to stdout and sim_log (and sim_deb when enabled)
The goals here being to simplify calling code while getting consistent output delivered everywhere it may be useful.

Modified most places which explicitly used sim_log or merely called printf to now avoid doing that and merely call sim_printf().
2014-03-28 08:20:05 -07:00
Mark Pizzolato
02cb5c2d88 Compiler suggested cleanups.
Mostly silencing noise warnings, but bugs were found in sim_console.c and pdp11_dmc.c
2014-02-14 17:07:45 -08:00
Mark Pizzolato
2e85e74699 SCP: Various cleanups.
- Avoid assignments of void * values.  Cast all memory allocation return values to appropriate types.
- Add output to sim_log where missing in various places.
- Fixed issue with lost file positions after a restore for devices which leverage the UNIT_SEQ flag.
2013-11-20 09:13:27 -08:00
Mark Pizzolato
65edda68ad SERIAL: For writes to serial ports, accept both EAGAIN and EWOULDBLOCK as non-error conditions for all *nix hosts 2013-11-04 12:15:26 -08:00
Mark Pizzolato
651780c481 Remove stray tab characters which crept in over time 2013-06-03 06:29:01 -07:00
Mark Pizzolato
d964df4eea Compiler suggested cleanups 2013-05-09 14:02:48 -07:00
Mark Pizzolato
eb1452913f Force return of SCPE_OPENERR when the same serial port is opened more than once. 2013-04-07 15:28:02 -07:00
Mark Pizzolato
01ee219f01 Fixed some HP-UX serial I/O functionality from Mikulas Patocka
We need to set buffer to 1 character and turn off the timeout.
Otherwise, HP-UX buffers 4 characters before making them available
to read().
2013-03-22 10:28:09 -07:00
Mark Pizzolato
a262dd9c14 Compiler indicated cleanups 2013-03-19 01:11:22 -07:00
Mark Pizzolato
7756cb8cd4 Added HP-UX Serial port detection (for SHOW SERIAL) from Mikulas Patocka 2013-03-18 05:53:39 -07:00
Mark Pizzolato
de483074e6 Cleanup for build on VMS 2013-03-16 11:44:34 -07:00
Mark Pizzolato
4ff56d6c15 Changed all internal #ifdef's which were conditional on __linux to be conditional on either __linux or __linux__. Some platforms (PPC) don't define __linux when gcc is invoked with -std=c99. 2013-02-20 21:57:02 -08:00
Mark Pizzolato
e3207c2009 Compiler suggested cleanups 2013-01-23 05:07:44 -08:00
Mark Pizzolato
674e56b376 Fixed compile issues on some Linux platforms 2013-01-03 08:01:43 -08:00
Mark Pizzolato
9356b0cb1e Changed Linux serial port enumeration to leverage kernel provided device information in /sys/class/tty 2013-01-02 15:15:01 -08:00
Mark Pizzolato
af93ca96c3 Added /dev/ttyAMAn devices as possible serial port lines on *nix systems.
Fixed reset disconnect logic for serial lines
2012-12-26 10:51:19 -08:00
Mark Pizzolato
3346f4a32c Fix build on VMS (IA64) 2012-12-19 12:45:03 -08:00
Mark Pizzolato
0450a9b430 Compiler suggested cleanup 2012-12-15 07:56:42 -08:00
Mark Pizzolato
c046a29cba Fix reference to sim_deb 2012-12-14 15:53:59 -08:00
Mark Pizzolato
883ad6bf5c Fixed sim_write_serial to return 0 when the non blocking write fails with the expected errno of EAGAIN 2012-12-14 03:27:18 -08:00
Mark Pizzolato
b466bdc9c6 Compiler warning cleanup 2012-12-13 13:41:57 -08:00
Mark Pizzolato
c6c66487ac Compiler suggested cleanups 2012-11-30 13:22:15 -08:00
Mark Pizzolato
388e13eb3a sim_serial.c Fixed VMS serial code after testing. 2012-10-22 14:58:56 -07:00
Mark Pizzolato
3311f4d581 sim_serial.c Added initial serial support for VMS hosts 2012-10-22 09:07:45 -07:00
Mark Pizzolato
757969ef40 Fixed bugs found during testing by Mark Benson
sim_serial.c

    - Fixed error message printing when retry is merely needed

sim_tmxr.c
     - Fixed parsing to properly recognize a listen port argument of "nnn;notelnet".
     - Fixed buffer wrap output condition.
2012-10-20 07:46:29 -07:00
Mark Pizzolato
02cb620c9b Change to support serial ports on multiplexer devices without any changes to existing multiplexer device emulation code.
Added support for per line tcp listen ports.
Added support for per line outgoing tcp/telnet connections.

Removed DEV_NET from pdp11_dz and pdp11_vh emulators to allow proper restore of
2012-10-17 08:40:01 -07:00
Mark Pizzolato
24696892fd Merge branch 'DMC11' into SerialMux
Conflicts:
	scp.c
	sim_ether.c
	sim_ether.h
	sim_tmxr.c
2012-10-16 15:50:38 -07:00
Mark Pizzolato
c77bdb20f1 Added scp SHOW SERIAL command
Fixed Ethernet formatting of open device names
Fixed serial generic naming to accomodate for the fact that an OS list of serial devices might not include devices which are already opened.
2012-04-25 17:04:48 -07:00
Mark Pizzolato
b2ebd56f9c Generalized serial port naming syntax to refer to host serial ports by the name 'serN' while continuing to allow the use of specific host device names.
Fixed some parsing issues in tmxr_attach_line.
2012-04-22 16:46:10 -07:00
Mark Pizzolato
bc36e9dde5 Adds serial port support to the multiplexer library.
It also modifies the HP 2100 and PDP11 multiplexers to add serial support as demonstrations of the capability that, one day, might be extended to all simulators.  I have tested the HP support, but I relied on Holger Veit to test the DEC stuff, so I can't guarantee that it works.  I also relied on Holger to test under Linux, so the same caveat applies.

    The changes needed in the device simulators are relatively small.  For example, if you look at the patches for "hp2100_baci.c", you'll note that most of them are documentation changes.  The only things of note are:

 - an expansion of the TMXR initializer

 - additional code in the "attach" routine to try attaching a serial port
   if attaching a socket fails

 - additional code in the "detach" routine for the same reasons

The HP MPX device (hp2100_mpx.c) needs a tiny bit of additional support from the ATTACH and DETACH commands.  Specifically, SCP was modified to set a flag ("sim_unit_ref") to indicate whether ATTACH MPX or ATTACH MPX0 was done, i.e., to differentiate between a device and a unit attach (recall that SCP treats these as both referring to unit 0).  This is needed because the socket attaches (logically) to the device, whereas a serial port attaches to a line.  Without this flag, the attach routine cannot differentiate between ATTACH MPX and ATTACH MPX0, as the distinction is lost by the time the VM's attach routine is called.  This support isn't needed for the HP MUX device because the socket attaches to a different device than the lines do.

    MPX also requires a bit more work due to the capability to mix serial and Telnet lines on the same multiplexer (BACI is a single-line terminal device).

    The attached PDF contains revisions to the "Writing a Simulator for the SIMH System" publication that documents the additions and changes to the multiplexer library for serial port support.  User documentation for serial port support currently exists only in the initial comments in "sim_tmxr.c"; I will add the appropriate text to the "SIMH User's Guide" if we decide to add this to the release version.
2012-04-19 19:18:15 -07:00