Commit graph

1347 commits

Author SHA1 Message Date
Mark Pizzolato
b611aa2fba Merge remote-tracking branch 'simh/master' 2014-12-30 18:51:47 -08:00
Mark Pizzolato
33781be23b SCP: Added support fo set a fifo opened with sim_fopen() to be non-blocking. 2014-12-30 18:48:42 -08:00
Mark Pizzolato
4381f9acc1 SCP: Added definition of SIM_INLINE when compiling with MSVC, gcc and clang 2014-12-30 18:46:43 -08:00
Mark Pizzolato
76dd31ae02 BESM6: Compiler suggested cleanups (MSVC). 2014-12-30 17:52:13 -08:00
Mark Pizzolato
2819ff634e BESM6: FIx makefile conditional logic detecting available SDL components 2014-12-30 17:49:36 -08:00
Mark Pizzolato
54ec99f95e Visual Studio Projects: Added BESM6 project 2014-12-30 13:43:27 -08:00
Mark Pizzolato
17f6132352 alpha: Compiler suggested cleanups 2014-12-30 11:57:19 -08:00
Leo Broukhis
cc33257836 BESM6: Removed tabs, reindented, removed GNU extensions. 2014-12-30 11:42:52 -08:00
Leo Broukhis
b4eeaa77de BESM6: Converted files to CRLF format
Also added support for loading such files, and a few tests.
2014-12-30 00:41:31 -08:00
Leo Broukhis
659600ff59 BESM6: Added target 'besm6' to makefile; added new files in the BESM6 subdirectory. 2014-12-29 21:13:00 -08:00
Mark Pizzolato
de9fc84fd4 SCP: added flexibility to search specifier parsing to fallback to register value format if the VM supplied parse_sym() doesn't handle the value provided. 2014-12-29 14:03:43 -08:00
Mark Pizzolato
76009709b1 VAX: Minimizing extra work while preparing to idle and attempt to make idle transitions closer to instruction execution costs. 2014-12-29 12:02:21 -08:00
Mark Pizzolato
9e1e32584b SCP: Avoid redundant log and debug output 2014-12-29 03:41:32 -08:00
Mark Pizzolato
b7456e988f SCP: Fix log and debug file reference count management. 2014-12-29 03:40:56 -08:00
Mark Pizzolato
5cb8f4686c VAX780, VAX739, VAX759, VAX8600: Merge branch 'VAX-11-BootBlock-Fixup' - Generic VMB.EXE for *nix VAX operating systems
The native VMB.EXE program historically supported a Boot Block oriented
 boot if Bit 3 of the parameter register (R5) was set when VMB was invoked.
 This Boot Block boot operation reads sector 0 into memory and starts
 execution at offset 2 of the data block in memory.
 When portitions of VMB were migrated into ROM to support the earliest
 MicroVAX system (MicroVAX I) and all subsequent ROM based VMB versions
 the concept of Boot Block booting was extended in these ROM VMB
 implementations.  The change in boot block booting functionality included
 several features:
   1) If a normal boot attempt to a device failed (due to VMB not being
      able to locate a secondary bootstrap program), a boot block boot is
      automatically attempted.  If the Bit 3 of R5 was set, then the
      initial search for a secondary boot block was avoided and a boot
      block boot was immediately attempted.
   2) When performing a boot block boot, the sector 0 contents are examined
      and if these contents conform to the pattern defined for ROM based
      (PRA0) booting, the ROM format Offset, Size, and Starting address
      information is used directly by VMB to load a program into memory
      and control is transferred to that program.  If the contents of
      sector 0 do not fit the pattern required for ROM based booting, then
      the code in sector 0 is executed directly starting at offset 2,
      the same as was originally done with the non ROM based VMB versions.
      Note that this extended behavior allows sector 0 to contain very little
      information and quite possibly no actual boot code.
 Developers of alternate operating systems for VAX computers noticed the ROM
 based boot block behavior and changed their installation media AND the disk
 structures to only provide the minimal boot information required on the
 systems with VMB installed in ROM.

 Since, when this active development of these alternate operating systems for
 VAX computers was happening, the vast majority of development and new system
 deployments were to hardware which had ROM base VMB, no one noticed that
 older systems which booted with the non ROM based VMB could no longer boot
 from new install media or disks formatted with these operating systems.

 This patch addeds the ROM based VMB boot block boot functionality to the
 original dynamically loaded VMB.EXE used by the older systems to boot.

 The patch overwrites some VMB code which exists to support NVAX(1302) and
 Neon-V(1701) systems.  If simh simulators for these systems are ever built
 an alternate location must be found to accomodate this extended logic
2014-12-27 15:21:17 -08:00
Mark Pizzolato
1d530cc48d SCP: Enhanced ASSERT/IF to support expressions which test memory contents. Also enhanced EXAMINE's search capabilities to be able to match multi-byte patterns for VMs which are byte addressable. 2014-12-25 06:19:59 -08:00
Mark Pizzolato
47a0576f09 SCP: Revert prior commit since it was the wrong approach 2014-12-25 06:15:52 -08:00
Mark Pizzolato
0a96584fdf SCP: Added special EXAMINE reference variable "$" usable in conditional expression for the ASSERT and IF commands 2014-12-23 03:09:40 -08:00
Mark Pizzolato
0528e708e7 HP2100: Most recent updates from Dave Bryan 2014-12-23 03:08:05 -08:00
Mark Pizzolato
ef0eae135f HP2100: Add CRCC and LRCC support to the HP 2100 MS simulation. from Dave Bryan
OBSERVATION:  The HP 2100 MS device simulates the HP 7970 B/E magnetic tape
     drives.  The 7970B uses NRZI format, and its associated controller supports
     returning the cyclic redundancy check character and longitudinal redundancy
     check character (CRCC and LRCC) to the CPU.  Typically, these are used only
     by the controller diagnostic, but support is easy to add.

     RESOLUTION:  Modify "hp2100_ms.c" to add a function that calculates CRCC
     and LRCC for reads and writes, and call that function when the CPU requests
     that the controller deliver the values.
2014-12-22 05:50:32 -08:00
Mark Pizzolato
afb5d6277d TAPE: Extensive cleanup of tape operations (gap, end of medium, format change, etc.) from Dave Bryan
256. ENHANCEMENT: Add tape runaway support to the simulator tape library.

     OBSERVATION:  The ANSI specifications for NRZI, PE, and GCR tape recording
     mandate a maximum length of 25 feet for erase gaps.  Currently, an erase
     gap of any length is ignored when reading or spacing.  To allow detection
     of non-compliant tape images, the simulator tape library is enhanced to
     halt positioning and return tape runaway status if a gap of 25 feet or more
     is encountered.

     Runaway detection is enabled by calling the tape library to set the tape
     density in bits per inch.  If this call is not made, erase gaps present in
     a tape image are effectively ignored.  Also, with the addition of a
     separate "set density" call, it is no longer necessary to supply the
     density when writing erase gaps.

     RESOLUTION:  Modify "sim_tape_rdlntf" and "sim_tape_rdlntr" (sim_tape.c) to
     detect tape runaway, and add a new MTSE_RUNAWAY status to sim_tape.h.  Add
     new "sim_tape_set_dens" and "sim_tape_show_dens" functions to set and show
     the bits per inch for a unit, respectively, and eliminate the "bpi"
     parameter to "sim_tape_wrgap" in preference to using the density
     established by a previous "sim_tape_set_dens" call.  Add named constants
     to "sim_tape.h" that specify the density.

257. ENHANCEMENT:  Improve performance when reading or spacing over erase gaps.

     OBSERVATION:  Performance when reading or spacing over erase gaps is poor,
     especially in the reverse direction.  Currently, each 4-byte gap marker is
     read individually, and in the reverse direction, each read is preceded by a
     seek to move the file pointer backward.  This combination causes stream
     cache invalidation and a physical disc access for each gap marker.  As a
     single gap consists of over 1000 markers, performance is far worse than if
     a gap was read as a block.

     RESOLUTION:  Modify "sim_tape_rdlntf" and "sim_tape_rdlntr" (sim_tape.c) to
     buffer reads of gap markers.  Using a 128-element buffer, performance
     improves about thirty-fold.

258. PROBLEM:  Writing an end-of-medium positions the tape image after the mark.

     OBSERVATION:  The "sim_tape_wreom" simulator tape library function writes
     an end-of-medium marker on the tape image.  The intent is to erase the
     remainder of the tape.  The "SIMH Magtape Representation and Handling"
     document states that the tape position is not updated by this function.
     However, the function leaves the tape positioned after the marker.

     A subsequent read would stop at the EOM marker.  However, writing a new
     marker over that one would then allow reading of the data following the EOM
     that supposedly had been erased by the original "sim_tape_wreom" call.

     CAUSE:  The tape position is updated by the internal "sim_tape_wrdata" call
     that is used to write the EOM marker, but it is not reset afterward by the
     function.

     RESOLUTION:  Modify "sim_tape_wreom" (sim_tape.c) to reset the tape
     position to point at the EOM marker before returning.  This prevents
     reading past an EOM marker, and a subsequent write will overwrite the
     marker rather than embed it between data records.

259. PROBLEM:  Reading through an erase gap in reverse may return EOM status.

     OBSERVATION:  A reverse read or spacing operation through an erase gap may
     return end-of-medium status.  Reading or spacing forward through the same
     gap works properly.

     CAUSE:  Writing an erase gap over existing records may produce a gap that
     is longer than requested.  This occurs when truncating the last record to
     be overlaid by the gap would leave a record that is shorter than the
     minimum size allowed (eight bytes for the length words plus two bytes for
     the data).  In this case, the gap is lengthened to overlay the entire
     record.  If the new gap size is not evenly divisible by four, a half-gap is
     metadata marker of value 0xFFFF added to the beginning of the gap.

     If a gap that begins with a half-gap marker is written immediately after
     a previous gap, the "seam" between gaps will contain the bytes FE FF FF FF
     ( FF FF ) FE FF FF FF....  Reading forward across this seam will yield a
     metadata value of 0xFFFEFFFF, which is recognized and handled by seeking
     two bytes back to resynchronize reading.  However, reading in reverse will
     yield the value 0xFFFFFFFF, which is interpreted as end-of-medium.

     RESOLUTION:  Modify "sim_tape_rdlntr" (sim_tape.c) to recognize 0xFFFFFFFF
     as a half-gap marker and resynchronize in response.  End of medium cannot
     occur when reading in reverse, as it is impossible to position the tape
     image beyond an EOM marker.  Therefore, any 0xFFFFFFFF value encountered
     must be a half-gap "seam" originating as above.

260. PROBLEM:  sim_tape_wrgap fails when format is changed from SIMH format.

     OBSERVATION:  The HP 2100 magnetic tape simulator supports erase gaps and
     calls sim_tape_wrgap when commanded to write a gap.  However, if a tape
     format other than SIMH format is selected, the call fails with MTSE_FMT.

     CAUSE:  Erase gaps are not supported in formats other than SIMH, but the
     call should not fail.  Instead, the call should be a "no-operation" if the
     underlying format does not support gaps.

     RESOLUTION:  Modify "sim_tape_wrgap" (sim_tape.c) to return MTSE_OK with no
     action performed if a tape format other than SIMH is selected.

261. PROBLEM:  The magnetic tape format of an attached unit may be changed.

     OBSERVATION:  The magnetic tape library supports several tape image
     formats.  The format to use may be specified either by an "ATTACH -F"
     command or by a "SET <unit> FORMAT" command.  The latter calls the
     "sim_tape_set_fmt" function, which allows the format of a file currently
     attached to be changed.  However, the format is an intrinsic property of
     the tape image file, so changing it once the file has been attached makes
     no sense.

     CAUSE:  Oversight.

     RESOLUTION:  Modify "sim_tape_set_fmt" (sim_tape.c) to return an error
     (SCPE_ALATT, "Unit already attached") if the unit is attached.
2014-12-22 05:48:13 -08:00
Mark Pizzolato
d5f02124f1 DOC: Add missing "SIMH Magtape Representation and Handling" document 2014-12-20 16:02:41 -08:00
Mark Pizzolato
1f41735dcd SCP: Added missing declaration of sim_vm_fprint_stopped 2014-12-20 06:22:41 -08:00
Mark Pizzolato
7256e0908c PDP11: Simplified idle call logic to leave the idle decision to sim_idle().
Removed the unused references to wait_enable which the comments suggest was related to an old style idle.
2014-12-19 08:45:47 -08:00
Mark Pizzolato
549779fb10 PDP10, PDP11, VAX: Adjusted KDP, DUP and DMR/DMC devices to be better behaved when the simulated system is idling.
This may not completely fix the problem identified in issue #99, but it should help
2014-12-19 08:41:10 -08:00
Mark Pizzolato
88d644258e SCP: Allow the VM to print simulator stop message information in lieu of, or in addition to, the default message.
The current implementation of "run_cmd" in scp.c calls "fprint_stopped_gen" (via "fprint_stopped") to print the message associated with the "sim_instr" return status.  Messages associated with VM stops must be provided to the SCP via the "sim_stop_messages" array.

"fprint_stopped_gen" prints the status message in a rigid format: the message string, a comma, the program counter register name, a colon, the current PC value, and the instruction at that address in symbolic format.

For example:

       HALT instruction, P: 24713 (LDA 1)

Only the message string is under the control of the VM.  If additional information is needed, it can only be added before the first comma.

The HP2100 simulator does this for halt instructions, which contain device select code and flag hold/clear bit fields that, in practice, are used to communicate to the operator the significance of the particular halt encountered, rather than to affect the device interface:

       HALT instruction 102077, P: 24713 (LDA 1)

To implement this, the simulator must define the message as a variable and then copy the formatted octal value into the buffer at the appropriate location before returning from "sim_instr".

However, if the VM wants to display a different register value, e.g.:

       Self test #13 complete, STAT: 000020

...this cannot be done without also displaying the program counter, which may be irrelevant for the given stop condition.
2014-12-18 11:16:27 -08:00
Mark Pizzolato
f6ba323891 SCP: Fix bug when debug file is opened with -N option. 2014-12-18 10:41:31 -08:00
Mark Pizzolato
42e7d48c82 SCP: Fixes Cannot show radix, etc. for a device that has no modifiers and SET and SHOW responses for invalid entry are inconsistent. from Dave Bryan
001. PROBLEM:  Cannot show radix, etc. for a device that has no modifiers.

     OBSERVATION:  The default data radix for a device may be set with the SET
     <dev> OCT|DEC|HEX command.  However, if the device does not have a modifier
     table, SHOW <dev> RADIX is rejected with "No settable parameters".

     The same problem occurs for SHOW <dev> DEBUG and SHOW <dev> NAMES.  For a
     device that provides debug printouts, SHOW <dev> MOD will list "DEBUG,
     NODEBUG" among the modifiers, and the SHOW <dev> DEBUG command will display
     the current debug status.  However, if the device does not contain a
     modifier table, SHOW <dev> MOD and SHOW <dev> DEBUG will report "No
     settable parameters", even though SET <dev> DEBUG is accepted and works as
     expected.  For such a device, SHOW MOD will show "DEBUG, NODEBUG" as
     acceptable modifiers.

002. PROBLEM:  SET and SHOW responses for invalid entry are inconsistent.

     OBSERVATION:  Entering SET <dev> <mod> where <mod> is not defined in the
     device's modifier table displays "Non-existent parameter."  Entering SHOW
     with the same parameters displays "Invalid argument."

     Similarly, entering SET <dev> DEBUG for a device that does not have
     debugging capability displays "Command not allowed."  Entering SHOW with
     the same parameters displays nothing.

     In both cases, the messages displayed should be the same for the same
     error.
2014-12-17 21:00:38 -08:00
Mark Pizzolato
e87d40c600 SCP: Add a -Q option to ATTACH -R and ATTACH -N to suppress success status messages. From Dave Bryan 2014-12-17 20:21:17 -08:00
Mark Pizzolato
95740f1f2d SCP: Add a "-N" (new file) option to the SET LOG and SET DEBUG commands. From Dave Bryan. 2014-12-17 20:07:28 -08:00
Mark Pizzolato
03800ae725 SCP: Stop calls VM-provided address printer for PC without REG_VMAD from Dave Bryan
OBSERVATION:  For a simulator stop, sim_vm_fprint_addr (if defined) is
     called to print the value of the program counter, regardless of whether or
     not the register was defined with REG_VMAD.  However, displaying the PC
     value with "examine" calls sim_vm_fprint_addr only if the REG_VMAD flag is
     present.  The displayed value of the PC should be the same in both cases.
2014-12-16 09:02:57 -08:00
Mark Pizzolato
e35081db1f SCP: Avoid duplicate output when run_cmd completes just as is done in sim_printf() 2014-12-16 07:56:21 -08:00
Mark Pizzolato
4f41c53674 SCP: Fixed potential out of bounds array reference while expanding command arguments.
Avoid race condition while producing debug header output from multiple threads.
2014-12-14 13:21:32 -08:00
Mark Pizzolato
18daed6551 PDP11, VAX: Enrich the debug output for the TS device simulation. 2014-12-14 13:14:05 -08:00
Mark Pizzolato
20637cc0df TAPE: Corrected debug output of tape position to be independent of the size of t_addr 2014-12-14 13:13:25 -08:00
Mark Pizzolato
7258490c42 SCP: Fix potential infinite loop when EOF is encountered on stdin for hosts using BSDTTY tty I/O. 2014-12-06 16:14:17 -08:00
Mark Pizzolato
c083b45c14 TMXR, SOCK: Properly declare as const string input only arguments. 2014-12-06 03:50:45 -08:00
Mark Pizzolato
d1b5e3aa27 SCP: Add the # character at the beginning of a line as a comment character. Requested by Kevin Handy 2014-12-05 16:29:17 -08:00
Mark Pizzolato
2030d8fd40 makefile: Removed dependence on libSDL for simulators which don't need SDL support. Fix #164 Suggested by Rhialto. 2014-12-04 19:47:21 -08:00
Mark Pizzolato
c2603539ff SCP: Fix simh console session output of remote console commands to avoid stairstepping as described in issue #165 2014-12-04 15:49:00 -08:00
Mark Pizzolato
1f20041b58 SCP: Added expansion of special built-in environment variable DATE_YC which is the century of the current date. 2014-12-03 10:39:19 -08:00
Mark Pizzolato
cd9a499c94 SCP: Fixed EXPECT processing to properly cleanup after matches. Added display of expect buffer to SHOW EXPECT and extended expect match debugging output. 2014-12-03 09:58:31 -08:00
Mark Pizzolato
45859ffe34 SCP: Fixed SEND command to properly support a bare AFTER=n argument. 2014-12-03 07:36:53 -08:00
Mark Pizzolato
4eed007607 SCP: Restructured timer/co-scheduling activities to support co-scheduling on specific timers 2014-12-02 05:33:59 -08:00
Lioncash
a9ac7c1534 SAGE: Fix loop bounds in m68k_cpu
cache_line has a size of CACHE_SIZE (16), so starting at that index will be outside the bounds of the array.
2014-11-26 12:55:55 -05:00
Lioncash
18ebf299c8 sigma_lp: Fix a fopen leak 2014-11-26 12:53:59 -05:00
Lioncash
499757acb1 sigma_cpu: Fix always true case
This was the equivalent of "if (vec >= 0x52 || vec <= 0x55)".
2014-11-26 12:53:50 -05:00
Lioncash
b881ccdc19 sim_BuildROMs: Fix potential memory leaks and a double fclose. 2014-11-26 08:24:01 -05:00
Mark Pizzolato
1d2742edff DOC: Cleanup PDP10 document 2014-11-21 08:34:52 -08:00
Mark Pizzolato
26bd72ec1e alpha: Compiler suggested cleanup 2014-11-16 14:02:49 -08:00