Commit graph

840 commits

Author SHA1 Message Date
Peter Schorn
e4ad37eccc SCP: Fix possible memory corruption issue 2023-04-07 09:17:46 +02:00
Mark Pizzolato
374e3b8e71 SCP: Change declaration of get_yn() to have boolean argument and return value
- Fix improper get_yn() use in test library logic

Reported by Peter Schorn
2023-04-06 13:00:52 -10:00
Mark Pizzolato
decbe5b76b Various simulators: Set line endings to CRLF for consistency, remove stray tabs
Project standard source code has tabs converted to spaces and CRLF line
endings.

Other text files have CRLF line endings.
2023-03-19 16:51:27 -04:00
Timothe Litt
949359fd42
Update version to identify Open SIMH builds
This is to prevent confusion when questions come in.

Plus, a little advertising never hurts.

The version output will now include "Open SIMH", and the version
number will be '4.1.*' rather than '4.0.*'.
2023-02-02 16:09:22 -05:00
Bob Supnik
4562408a5f Common code: various bugfixes; Mac "Classic" and OS/2 support has been removed 2023-01-31 14:49:35 -05:00
Peter Schorn
ce791138b5 SCP: Remove dead code in sim_sanity_check_register_declarations 2022-12-05 12:16:52 -05:00
Patrick Linstruth
92e40cb1c8 SCP: Add VM-specific messages to %TSTATUS% expansion
Clean up variable expansion help
2022-11-30 12:27:19 -05:00
Patrick Linstruth
3ec3e3aa8f AltairZ80: Fix HALT stop code conflict with ON ERROR
AltairZ80 uses 0 for the VM-specific HLT instruction stop code.
SCP defines SCPE_OK as 0.
SCP uses 0 to mean all errors ("ON ERROR").

The command "ON 0" will generate "%SIM-ERROR: Invalid argument: 0".

This PR changes the HALT stop code from 0 to 5.
2022-11-27 17:14:57 -05:00
Tony Lawrence
57837528ae SCP: Word order in "set def" error 2022-11-27 14:39:58 -05:00
Mark Pizzolato
5250eb866d SCP: Update HELP SET ON to also describe INHERIT and NOINHERIT options
Add missing help information reported in #130
2022-11-27 14:39:12 -05:00
Paul Koning
110183e258 simh ui: replace "readline" by "editline".
This avoids infecting SIMH with the GPL license, since readline,
very surprisingly, is GPL rather than LGPL.

The replacement package is "editline", which has a useable license.
2022-10-01 16:38:55 -04:00
Ken Rector
bef5b821f0 SCP: Fix parenthesis to avoid potential compiler warnings 2022-07-01 07:23:35 -10:00
Ken Rector
755cb9ccff SCP: Add parenthesis to avoid potential compiler warnings 2022-07-01 07:13:22 -10:00
J. David Bryan
4dde5a69a4 SCP: Updated REG macros and manipulation APIs
- Rewrote get_rval, put_rval to support fields within arrays of structures
- REG "size" field now determines access size
- REG "maxval" field now determines maximum allowed value

Merge from v3.12
2022-06-24 15:39:45 -07:00
Bob Supnik
cc6f8ee8ee SCP: Fixed bug in byte deposits if aincr > 1
The PDP11 and VAX have length switches - B, W, and (VAX) L - to
override the default parsing of numberic display or input as words
(PDP11) or longwords (VAX CPU) or bytes (VAX byte devices).
This worked fine if every value is filled in. On the PDP11:

sim> ideposit -b 0-3
0:    1
1:    2
2:    3
3:    4
sim>

But if the user skips an input, IDEPOSIT advances by 2, not 1:

sim> ideposit -b 0-3
0:    1
1:    (cr)
3:    4
sim>

This change now produces the correct behavior.

PDP-11 simulator V3.12-2
sim> id -b 0-3
0:      1
1:
2:      3
3:      4
sim>
2022-06-17 08:23:29 -07:00
Anthony Lawrence
bcaed7d0b0 SCP: Fix incorrect disk size reporting when t_addr is 32 bits 2022-06-14 20:21:21 -07:00
Mark Pizzolato
b2dd269d7a SCP: Expand sprint_val target buffers with one extra byte 2022-03-13 20:08:54 -07:00
Mark Pizzolato
ee545a4828 SCP: Assure that all formatted numbers have sufficient buffer space 2022-03-13 13:23:05 -07:00
Mark Pizzolato
e3dbe93e35 SCP: Coverity fixes 2022-03-09 15:53:10 -08:00
Mark Pizzolato
857f725470 SCP: Avoid a Coverity complaint about getenv() 2022-03-08 00:02:07 -08:00
Mark Pizzolato
a50dca0ff0 SCP: Normalize writelock/read only behavior
Setting a unit to write locked specifically allows only read access.
- If this is done while a unit is attached, it is up to device logic to
  limit write activity until it is detached.
- If this is done while a unit is not attached, a subsequent attach
  opens the container read only.
2022-03-04 21:13:37 -08:00
Mark Pizzolato
abd756ebad SCP: Allow unattached errors to halt with a specific unattached message 2022-03-03 17:40:27 -08:00
Mark Pizzolato
4a45fda672 SCP: assure that t_stat is returned in sim_call_argv() 2022-02-28 10:12:33 -08:00
Mark Pizzolato
9bd945679d SCP: Add new sim_call_argv() API.
call a routine with C style argc, argv parsed arguments
2022-02-28 07:44:39 -08:00
Mark Pizzolato
d960c96f56 SCP: UNIT_BUFABLE isn't always set with UNIT_MUSTBUF
UNIT_BUFABLE without UNIT_MUSTBUF means that uptr->filebuf is managed
outside of attach_unit's authority.  The buffer copy must always be allocated
if UNIT_BUFABLE is set so that there is space to store the initial loaded copy.

Fix #1122
2022-02-14 19:30:30 -08:00
Mark Pizzolato
eac0e5680b DISK: Add SET NOAUTOSIZE - disable autosize when attaching existing containers
This is a global command possibly for folks who have configurations which
always explicitly specify the drive type they want a particular unit to be
before they attach a container to the unit.  The side effect of this will
be to avoid the addition of drive type describing meta data to disk
containers.
2022-02-14 15:06:34 -08:00
Mark Pizzolato
3949f62e89 SCP: Use sim_messagef for all error paths in attach_unit and sim_disk_attach 2022-02-14 04:00:04 -08:00
Mark Pizzolato
315a07cbc7 SCP: Avoid writing out memory buffered devices on detach that haven't changed
As discussed in #1109
2022-02-13 22:50:37 -08:00
Mark Pizzolato
6187b0519a SCP: Support output formatting for long DEVICE and UNIT names
This extends fe4a2a28b to include support for long unit names as well.
2022-02-12 15:19:51 -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
2209f25086 SCP: Add a success or failure indicator preceeding messages 2022-02-06 11:16:57 -08:00
Mark Pizzolato
54eda7a050 SCP: Extend BITFIELDS to allow alternate descriptions for same fields 2022-02-04 07:56:15 -08:00
Mark Pizzolato
dd92be296c SCP: Add host system processor name to SHOW VERSION output 2022-02-04 07:51:08 -08:00
Mark Pizzolato
370bfe006d SCP: Avoid using strlcpy for overlapping string copy 2022-01-16 07:44:15 -08:00
Mark Pizzolato
b5052c81d6 makefile, SCP: Enrich support for compile time SIM_VERSION_MODE
- Pass make command line SIM_VERSION_MODE argument into the compiler.
- Tolerate quoted and unquoted SIM_VERSION_MODE values.
2022-01-15 10:01:49 -08:00
Mark Pizzolato
b24e3580dc SCP: Add clarifying context to various device/unit error messages 2022-01-12 12:17:21 -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
fa5e0ed157 SCP: Assure that debug writes that check errno get a correct value
The original solution provided in response to #957 needs to be adjusted
to reflect that errno is only guaranteed to be set by fwrite() if an error
occurred. otherwise a non zero value may have been set by some other
call elsewhere in the program.  All other cases where errno is explicitly
check in simh, it is only done after receiving a return status from a
system call.

Fix problem reported in #1108
2022-01-06 12:18:10 -08:00
Mark Pizzolato
ff4c7b154e SCP: Minor Coverity cleanup 2022-01-02 09:47:33 -08:00
Mark Pizzolato
cea76d59bd SCP: Add newer baseline libreadline support. 2021-12-15 16:52:49 -08:00
Mark Pizzolato
c5cd38afbf SCP, makefile: Rename build conditional HAVE_DLOPEN to SIM_HAVE_DLOPEN
Some dependent packages on some platforms may also define HAVE_DLOPEN
and that definition may have different syntax or semantics.  This change
avoids the potential symbol conflict.

As reported in #1098
2021-12-04 17:44:57 -08:00
Mark Pizzolato
3621db4e6a SCP: Prefer Posix 'command -v' over 'which' 2021-12-04 11:48:49 -08:00
Mark Pizzolato
6d9a55d351 SCP: Provide commit id information when archived simh content is used 2021-11-01 15:33:43 -07:00
Mark Pizzolato
079e4780d2 FIO: Add support to set file access and modify times 2021-10-31 04:20:39 -07:00
Mark Pizzolato
e897dfc3c9 SCP: Fix missing void parameter declarations 2021-09-30 21:08:01 -07:00
Mark Pizzolato
feec1da242 DISK, TAPE: Add optional library specific DEVICE context structure
- add disk and tape library initialization routines
- cleanup snprintf arguments
- truncate disk container trailing zero sectors when zapping
2021-09-20 12:28:11 -07:00
Mark Pizzolato
2834bfb1f9 SCP: Avoid 'not found' error in tool path locater on Windows 2021-09-20 07:37:14 -07:00
Mark Pizzolato
0bc77c4d90 PDP11, VAX: Add or correct help output for some SET commands
As discussed in #1077
2021-09-10 11:38:37 -07:00
Mark Pizzolato
82f9f5b966 SCP: Allow for simulator specific processing of DO commands. 2021-09-06 10:18:36 -07:00
Mark Pizzolato
d57b182701 SCP: Expose _sim_vdebug for use by external libraries 2021-09-06 09:58:41 -07:00