Commit graph

153 commits

Author SHA1 Message Date
Mark Pizzolato
a9a91420b0 SCP: Properly define sim_name array to avoid potential overrun 2017-03-29 07:43:11 -07:00
Mark Pizzolato
fa7e350c78 SCP: Avoid potential invalid pointer reference (Coverity) 2017-03-29 07:02:46 -07:00
Mark Pizzolato
34d29d3160 SCP: Add sim_strlcpy and sim_strlcat for platforms missing strlcpy and strlcat 2017-03-27 07:51:13 -07:00
Mark Pizzolato
7a1b35ae12 SCP: Add DEL/RM command to facilitate portable command files 2017-02-16 07:36:35 -08:00
Mark Pizzolato
692b9abe5f SCP: Add ability to descriptively name UNITs
This allows a device simulator to specifically name the units that it uses
for different purposes.  This info is visible in the output of SHOW QUEUE
and debug output.

Once specified or dynamically determined (as previously occurred with
each call to sim_uname()), that name is saved for fast delivery on subsequent
calls.  This will remove some overhead when running with debugging on.
2017-02-06 10:27:01 -08:00
Mark Pizzolato
665ebf0fd1 FRONTPANEL: sim_frontpanel API version 4 release
Add simulator side register bit sampling with averaged sample values
delivered across the API at specified rates.
2017-02-04 10:48:13 -08:00
Mark Pizzolato
e36873f466 TIMER: Fix coscheduling functionality to produce consistent results
Added debug CHECK option to the sim_timer_activate_after() to verify
that coscheduled events actually have sim_activate_time_usecs() results
which are consistent with each other.
Additionally, coschedule tick processing now properly counts down
pending coschedule queued activities.
2017-01-18 23:53:46 -08:00
Mark Pizzolato
af1603f000 SCP: Add missing sim_strcasecmp() for host platforms without strcasecmp()
sim_strncasecmp() was previously provided.  Now both forms are available.
2017-01-17 21:54:01 -08:00
Mark Pizzolato
d8dbc7e6b5 SCP: Migrate all stdio writes to pass through SCP provided Fprintf() 2017-01-14 20:48:09 -08:00
Mark Pizzolato
c9276407e6 TIMER: Timing corrections and enhancements
- Add support to query remaining usecs on pending events.
- Generalized the sim_interval adjustment in sim_idle to allow more than
   a single decrement.
- More overhead reduction when idling.
- Carry usec values as double through out to fully support long wall clock
   delays.
2016-12-30 10:26:59 -08:00
Mark Pizzolato
ae52f4c331 TIMER: Add correct sim_activate_time functionality for all timer cases.
Also:
- allow a timer to dynamically stop itself (by calling sim_rtcn_calb
   with tps=0), and then to start the internal timer to provide a calibration
   baseline if necessary.
- Fix coschedule interval computation when the queue is empty.
- Properly select the correct timer for coscheduling without a specific tmr
- Properly adjust the coschedule queue's next time value when entries are
   canceled.
- Cleaned up throttling to behave well with all potential throttling rates and
   to make visible what is happening when boundaries are reached.
2016-12-15 09:57:34 -08:00
Mark Pizzolato
b98ece819b DISK: Extended and corrected autosize logic for disk attach.
Previously only the actual size of the container file was used when
attaching a disk.  This was correct only when the size of the container
file actually aligned with the simulated disk drive.  disks created with
sim_disk_attach automatically write to the last sector of a simulated
disk file when the disk is created.  Therefore, auto sizing worked correctly
for any disk created with sim_disk_attach.

Disk images created with simh prior to 4.X would only write to the
portions of the disk drive when the simulated system writes data.  These
disk images would only be properly sized if the simulated operation of
the disk had actually written to the last block of the disk.  Auto sizing of
these disks would usually size the resulting disk incorrectly and strange
behaviors might occur when using such an incorrectly auto sized disk.

Fixes #357
2016-11-29 18:53:52 -08:00
Mark Pizzolato
ff95fb8ec2 SCP: Add warning about reset when RUN command is used multiple times.
The RUN command implicitly resets all devices which may have unexpected
consequences for a novice user.

The logic now produces a warning about this side effect when more than one
RUN command is executed in the same simulator session.

An explicit RESET command suppresses this warning for a subsequent RUN
command.

A RUN command with the -Q switch also suppresses this warning.
2016-11-18 05:20:06 -08:00
Mark Pizzolato
39d2944ede TIMER: Add support for catchup clock ticks and cleaned up asynchronous clocks
Asynchronous clocks are now built for all simulators which are built with
SIM_ASYNCH_IO defined.  The default behavior has asynchronous clocks
disabled since this is still experimental, but it can be enabled with
SET TIMER ASYNC.

Catchup clock ticks are now available, but since they're experimental,
they aren't enabled by default.  Catchup ticks are only available if the
simulators clock device calls sim_rtcn_tick_ack to acknowledge processing
of clock ticks.  The VAX simulators have been modified to leverage this.
Catchup clock ticks can be enabled with SET TIMER CATCHUP

Additionally, an idle threshold is provided which can be used to
influence when clock calibration may be suppressed.  The default is not
to suppress calibration activities.

The various timer behaviors are visible with the SHOW TIMER command.

The state of the operating timer facilities is visible with: SHOW CLOCK

Timer events which are queued are visible with the SHOW QUEUE command.
2016-11-16 23:50:53 -08:00
Mark Pizzolato
efabcb9856 SCP: Added routine to format time in seconds down to usecs 2016-11-04 22:59:33 -07:00
Mark Pizzolato
222ae77436 SCP: Add sim_brk_message() to facilitate easy reporting of matched breakpoints.
Also extended the optional VM supplied routines to include sim_vm_sprint_addr.
Simulators which provide sim_vm_fprint_addr should also provide
sim_vm_sprint_addr with sim_vm_fprint_addr reworked to leverage
sim_vm_sprint_addr internally.  sim_vm_sprint_addr is currently only used by
sim_brk_message() which is an API which a simulator may choose to use if
it supports multiple breakpoint types,
2016-09-01 14:32:01 -07:00
Mark Pizzolato
e06b815d2a SCP: Record breakpoint match details in globals
sim_brk_match_type and sim_brk_match_addr can be used to generate
appropriate messages relating to the breakpoint match.
2016-08-31 11:56:47 -07:00
Mark Pizzolato
f82d3f8994 SCP: Breakpoint enhancements
- Reliable support for multiple breakpoint types
- Optional separate breakpoint types defined concurrently with the same address
2016-08-31 08:10:38 -07:00
Mark Pizzolato
b4f3d6c6d8 SCP: Breakpoint cleanup.
- Add detailed error message info while parsing breakpoint commands
 - Properly limit breakpoint class values to reflect available mask bits
 - Declare globally sim_brk_npc since it is a documented API
 - Revise simh_breakpoints.doc to reflect current behavior
2016-08-26 14:35:00 -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
8b08e6c2d9 SCP: Allow spawn commands to not require space after ! 2016-05-30 04:14:45 -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
0897320a16 SCP: Add TYPE/CAT command 2016-01-28 06:49:56 -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
bbd5f9bf95 SCP: Add internal device debug state to output of SHOW DEBUG command 2015-12-19 11:26:27 -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
ad3dc29d5d SCP: Added flag indicating to device simulations that an event dispatch is active 2015-12-06 05:34:27 -08:00
Mark Pizzolato
099dd40657 SCP: Add sim_activate_after_abs API like sim_activate_abs only specifying a used time delay. 2015-11-18 09:41:16 -08:00
Mark Pizzolato
6da2be7d7b ALL: remove need for sim_debug calls to be enclosed in braces to avoid dangling else compiler warnings 2015-10-15 16:12:25 -07:00
Mark Pizzolato
86d1e36f29 all VAX, PDP11: Add initial NAT based ethernet connectivity via SLiRP.
This should work on all byte addressable host systems using GCC/clang to build.

The QEMU slirp code has been pried out of QEMU and stubs have been created to solve where the current slirp is entangled with the QEMU code.  Ths slirp/simh directory contains all the necessary include and glue files to make this useful.  Everything in the slirp directory is unmodified QEMU code.
2015-10-15 12:59:32 -07:00
Mark Pizzolato
73d7aee71f SCP: Add printf style format argument validation for all functions which take printf arguments.
These include: sim_printf(), sim_messagef(), Fprint() and sim_debug().

Fix current use of these functions which had invalid arguments.
2015-10-09 04:12:25 -07:00
Mark Pizzolato
c3a879da2d VAX: Change to load ROMs or other boot code directly from built in memory arrays.
Prior logic attempted to load the desired file from the current default directory and if that failed wrote the in memory boot code image to the desired file and then retried the desired load..

A user can still explicitly load a ROM image with a "LOAD -R romfile.bin" command prior to a BOOT attempt if they want to test or otherwise run with a different ROM.
2015-09-28 09:19:38 -07:00
Mark Pizzolato
0986c6ff9e VAX750: Fixed ROM based boot from console TU58
Problem was the console storage output buffer was masked with a WMASK instead of a BMASK (it is only a 8 bit register).
Also, the input interrupt processing cleared the output interrupt state instead of the input interrupt state.  This would only be a problem when interrupts are actually used instead of polled I/O.
2015-09-17 17:48:02 -07:00
Mark Pizzolato
78399f10cb SCP: Added a SCREENSHOT command to record the video display window. 2015-09-17 11:49:01 -07:00
Mark Pizzolato
bd2f592918 Revert "SCP: Remove ASCII source code character set dependency"
This reverts commit 7c7b44e409.

The prior commit didn't work for static initializers.  There are other ASCII dependencies in simh.  They should all be solved together or not at all.
2015-08-07 00:54:23 -07:00
Mark Pizzolato
7c7b44e409 SCP: Remove ASCII source code character set dependency
Provide reasonable behavior on any platform which doesn't use ASCII as a character set.  Method suggested by Dave G4UGM.
2015-08-03 12:35:08 -07:00
Mark Pizzolato
325e369bfd FRONTPANEL: Added mount and dismount commands for removable media 2015-04-04 16:37:43 -07:00
Mark Pizzolato
41978eca80 All: Convert from C runtime library perror() to sim_perror so that all messages will arrive in the same place(s). 2015-04-03 19:56:37 -07:00
Mark Pizzolato
d75c072235 VAX, VAX780, VAX8600, MicroVAX1, MicroVAX2: Stabilize SAVE/RESTORE capabilities to allow restore of older version VAX and VAX780 save images and to properly allow simulator restores of processor model variations as discussed in #197 points 1 & 2 2015-03-30 13:52:48 -07: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
aae9e55a39 SCP: More allow command files to contain UTF-8 data.
- Provide a sim_islower(), sim_isalpha(), sim_isprinit(), sim_isdigit(), sim_isgraph(), sim_isalnum()  which make sure that the character being examined as an unsigned char.
2015-01-05 14:08:03 -08:00
Mark Pizzolato
256bbdddc9 SCP: Allow command files to contain UTF-8 data.
- Ignore a UTF_BOM sequence at the beginning of command files.
- Provide a sim_isspace() which makes sure that isspace only considers the character being examined as an unsigned char.
2015-01-04 06:59:56 -08:00
Mark Pizzolato
6ec6b6ab1f SCP: Provide an API to display alternate error message text while returning SCPE status. 2014-12-31 14:32:10 -08:00
Mark Pizzolato
1f41735dcd SCP: Added missing declaration of sim_vm_fprint_stopped 2014-12-20 06:22:41 -08:00
Mark Pizzolato
2e1167d4a0 Compiler suggested cleanups - mostly const fixups 2014-10-26 17:06:24 -07:00
Mark Pizzolato
4dbac410da SCP: Added const declarations to various APIs to reflect the appropriate usage. Moved parameter values for run_cmd and exdep_cmd to scp.h 2014-10-26 14:52:22 -07:00
Mark Pizzolato
e8358703be SCP: Fix NOEXPECT to actually delete a single indicated expect rule. Allow expect actions to be provided. Fix match buffer management when expect regular expressions are in use. 2014-10-25 11:14:36 -07:00
Mark Pizzolato
ebf4e0cb64 SCP: Add support for legacy form of console expect and send string commands (from Dave Bryan) 2014-10-23 05:58:43 -07:00
Mark Pizzolato
5a4bbbad8d SCP: Extended EXPECT and SEND to have more flexible activation delays
- EXPECT will now tolerate a HALTAFTER=n parameter which delay the simulator stopping execution for n instructions.  Unpredictable behavior will happen if multiple EXPECT conditions see matching data before the first actualy halt occurs.
- SEND has an AFTER=n argument which delays the initial stuffed data from being input for at least n instructions.  It also has a DELAY=m argument which specifies the minimum number of instructions which must execute between stuffed input data.
- Changed run_cmd() to no longer clear pending breakpoint actions before starting instruction execution.
- Added a -Q switch to the commands which dispatch through run_cmd() (RUN, STEP, NEXT, GO, BOOT, etc.).  This switch will suppress status output when execution stops.  This will allow sequences of breakpoint action commands to silently execute when needed.
2014-10-20 16:47:33 -07:00