Commit graph

826 commits

Author SHA1 Message Date
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
Mark Pizzolato
6d04cf814a SCP: add sim_get_tool_path to get the expanded path to a local command
This logic was previously within the static SCP function _get_tool_version
and is now exposed for use elsewhere.
2021-08-28 04:27:41 -07:00
Mark Pizzolato
3f3884ddb6 SCP: Fix memory leak when accessing externally defined environment variables 2021-08-23 12:17:18 -07:00
Mark Pizzolato
0bfb902b56 SCP: Enhance hierarchical help prompting
- A prompt answer which exactly matches a topic name is given
  preference over the potential ambiguity of other topics which start
  with the same text.
- Prompt with the parent topic's prompt when a just displayed subtopic
  has no subtopics.
- Allow either ^D or ^Z entered to act as EOF.

These changes reflect the behavior of the VMS help system which the
hierarchical help system is modeled on.
2021-08-14 19:43:41 -07:00
Mark Pizzolato
f95b20e1f3 SCP: Cleanup potential compiler warnings 2021-08-13 09:09:53 -07:00
Mark Pizzolato
78d3d1b560 SCP: Add register validation tests as part of the SCP library test 2021-08-11 07:28:08 -07:00
Mark Pizzolato
dcbfba0f9a SCP: Fix register formatting and quiet unused variable warning 2021-08-03 13:23:25 -07:00
Mark Pizzolato
77d7df7a56 SCP: HELP command output formatting cleanup
- Add column header to output of HELP device register list.
- Format HELP output for REGISTER, SET and SHOW commands to accommodate long
   descriptor text (wrapping as needed).
- Add HELP DEVICE * to display help for all devices
2021-08-01 18:59:00 -07:00
Mark Pizzolato
2c820dca5c SCP: Pass all external environment variables through to spawned commands
As discussed in #1057
2021-07-31 12:49:56 -07:00
Mark Pizzolato
9ef08cba0d SCP: Allow all external environment variable expansion
as discussed in #1057
2021-07-29 21:17:44 -07:00
Mark Pizzolato
5f8a8cca9d SCP: Avoid using externally defined aliases for SCP commands
As discussed in #1057
2021-07-29 10:15:54 -07:00
Mark Pizzolato
d23942bc37 SCP: Allow ; and # comments on SET and SHOW command lines 2021-06-05 12:24:57 -07:00
Mark Pizzolato
cf1ac44d4a SCP: Allow SET/SHOW commands to operate on explicitly set unit names
simh UNITs that have their name set via sim_set_uname() can now be
referenced via MTAB entries for the related DEVICE as well as attach
commands.
2021-05-30 15:37:01 -07:00
Mark Pizzolato
7008edc561 SCP: Fix SHOW writeenable MTAB entries
As discussed in #1034
2021-04-20 09:28:41 -07:00
Mark Pizzolato
a015e44c10 ALL: Standardize writelock behavior adding global UNIT_WLK & UNIT_WPRT
Historically this functionality was reimplemented within each
DEVICE simulator often with slightly different implementations
and inconsistencies.  Solving this globally within SCP required
changes in many places, but should henceforth be reasonably
managed.

As discussed in #1034
2021-04-19 10:58:51 -07:00