Commit graph

4634 commits

Author SHA1 Message Date
Lars Brinkhoff
c6b9402f8c VAX: Add UW device to 8600 and 8200.
The VAXstation 100 "unibus window" interface board should work with
any Unibus VAX.
2024-06-08 14:45:06 -04:00
Patrick Linstruth
c55b964921 AltairZ80: Changes to JAIR devices
I was having problems with the JAIR device keeping up with received
data at 57.6K.

This PR makes the following changes to the JAIR devices:

- Refactors the service routines into STAT, TX and RX units
- Adds a 128-byte input ring buffer
- Corrects a null pointer exception
- Adds overrun status bit implementation
- Removes a tab with spaces
2024-06-08 13:55:57 -04:00
Patrick Linstruth
1e4a43d8f8 AltairZ80: Adds Cromemco DAZZLER and JS1 devices
Adds Cromemco Dazzler and JS1 joystick devices
Adds vid_render_set_logical_size() to sim_video.c
2024-06-08 13:55:30 -04:00
Richard Cornwell
5b3e28263c KA10: Removed tabs that got added by accident. 2024-06-08 13:54:58 -04:00
B. Scott Michel
c37d26a370 IBM 1130: GUI resource file, RegSanityCheck fix
- Add the missing ibm1130.rc GUI resource file to the Windows build so
  that the GUI renders correctly.

- Set the add_simulator TEST_ARGS  to "-g" to fix an edge case Heisenbug
  encountered during Github CI/CD tests where ibm1130 appears to hang
  indefinitely on the Windows runners.

  The cause is the GUI's Pump() thread function being prematurely
  terminated before all GUI resources are acquired. The net result is an
  infinite loop in the MS C runtime trying to exit the process with
  unstable internal state. (Separate patch: synchronization across main
  and Pump() threads to ensure resource acquisition completes.)

  This issue never shows (cannot show) up on non-Windows platforms or
  the SIMH makefile.

- Ibm1130/ibm1130_cr.c

  - Fix printf() warnings (format should be long, not int)
  - Signed/unsigned mismatch, size_t for array indexing
  - Comment out the unused trim() function.

- Ibm1130/ibm1130_cpu.c, ibm1130_gui.c: Remove undefined static functions.
2024-06-08 13:51:23 -04:00
Olaf Seibert
c0b00f48e1 Avoid super-inefficient use of strlen(). 2024-06-08 19:43:58 +02:00
Olaf Seibert
b6ae88bd1c I650: Avoid allocating large card decks on the stack.
Allocate them dynamically instead.
2024-06-08 19:43:58 +02:00
Olaf Seibert
3ffd20c1fa Non-letters are not allowed in shell function names. 2024-06-03 16:48:50 -04:00
Richard Cornwell
4396394313 KA10: Remove unneeded file. 2024-05-21 17:06:39 -04:00
Richard Cornwell
1cb2f3b96c KA10: Fix divide error on KS10, add in some devices.
Fix divide of 0 on KS10 processor.
       Fix write access for auxiliary processor memory.
       Updated support new PIDP10 panel.
       Allow eight Unibux ports on the TEN device.
       Added GE DATANET-760 device to PDP6
       Removed USER mode restriction for idle detection.
       Added Data Disc 6600 Television Display System.
2024-05-21 17:06:39 -04:00
Richard Cornwell
9515201238 I7000: Updated general card reader, printer and magtape
Card reader handle EOF correctly.
         Line printer proper handling of paging.
         Magtape clean up debug message.
         Update 7010, 7070, 7080 for EOF handling.
2024-05-21 17:06:39 -04:00
Richard Cornwell
fdbf79145a B5500: Cleanup some warning from CMAKE. 2024-05-21 17:06:39 -04:00
ken rector
debd1774ae sigma: Implement CM (Chaining Modifier) flag to IOP simulation in sigma_io.c 2024-05-21 16:01:43 -04:00
B. Scott Michel
c77bb2ea71 Github CI/CD: checkout@v4, macos matrix updates
- Per Github messages, upgrade checkout@v3 to checkout@v4 due to an
  upgrade to Node.js.

- macos-11 is now a defunct image runner. Homebrew packages either have
  to compile from source or no longer install correctly.

- Update the macos compile matrix. Set CPACK_SUFFIX environment variable
  to indicate macOS hardware platform: macos-14 is M1, whereas macos-12
  and macos-13 are x86_64.

- Added notes with respect to the matrix.strategy runner images. The
  makefile builds use "-latest" because they don't produce artifacts,
  while (*) the CMake builds enumerate the images for which artifacts (+)
  are produced and the runner image's name is part of the artifact.

(*) "Whilst" for the rest of the Anglosphere.
(+) "Artefact" for the rest of the Anglosphere.
2024-05-21 15:59:01 -04:00
Ender Wiggin
8c1fb2ea3a Update deps.sh
Changed "arch" to "arch-linux"
2024-05-21 15:58:12 -04:00
Ender Wiggin
2102b01f2d Update deps.sh 2024-05-21 15:58:12 -04:00
Ender Wiggin
4edbd76c85 Added an option for Arch Linux.
Added an option that uses pacman to install everything, therefore making setup simpler for Arch users.
2024-05-21 15:58:12 -04:00
B. Scott Michel
191b2131e9 CMake: Make generate.py reusable
Make generate.py resuable outside of open-simh, as suggested and
motivated by Richard Cornwell's simulator repository.

- Make the "experimental" rule optional. Do not generate a Python
  "KeyError" if the rule is missing.

- Add documentation on how to use the CMake infrastructure outside
  of open-simh: Customize the packaging.py script, season to taste.

- Update the KA10 simulator customization, moving it to its own
  Python script, simgen/pdp10_simulator.py. Preparatory move that
  anticipates additional frontpanel and display options.

- generate.py option "--skip-orphans": Skip the orphaned simulator
  check (i.e., don't cross-reference the simulators in packaging.py
  with what was scraped from the makefile.)

- Add "TEST_ARGS" argument to CMake's add_simulator function so that the
  IBM 1130 simulator can pass to "-g" on the command line to disable the
  GUI when running RegisterSanityCheck, i.e.:

    ibm1130 RegisterSanityCheck -g

  This fixes an edge case Heisenbug encountered during Github CI/CD
  tests where ibm1130 appears to hang indefinitely on the Windows
  runners.

  The cause is the GUI's Pump() thread function being prematurely
  terminated before all GUI resources are acquired. The net result is an
  infinite loop in the MS C runtime trying to exit the process with
  unstable internal state. (Separate patch: synchronization across main
  and Pump() threads to ensure resource acquisition completes.)

  This issue never shows up on non-Windows platforms or the SIMH makefile.

- cmake/generator.py, cmake/simgen: Add a "test_args" keyword argument
  to the BasicSimulator constructor that holds the tests argument
  parameter emitted as the "TEST_ARGS" argument to a simulator's
  add_simulator(). Ensure that the IBM 1130 emits 'TEST_ARG "-g"' in its
  add_simulator().

- scp.c: reset_all_p() adds 'P' to the existing switches, versus saving
  sim_switches and ONLY setting the 'P' power-up reset switch. Net effect
  is that the IBM 1130 simulator actually sees the 'G' flag that inhibits
  the GUI during the console device reset.
2024-05-21 15:57:21 -04:00
Peter Schorn
24f145ad16 AltairZ80: Updated docs to include latest devices 2024-03-17 19:09:21 +01:00
ken rector
ffe537a621 Fix three kinds of error in I/O modules. Discovered while getting standalone System Exerciser to run.
IO: DVT_NOTDEV macro incorrect, Device mapping algorithm creates false dispatch points.
This mapped Multi Unit Controller and Single Unit Controller to same device.
DP, DP, MT, RAD:  Test for non-existent device returns wrong status.
DP, DK, MT: TIO status should return non-operational for unattached device.
2024-03-15 13:39:45 -04:00
Patrick Linstruth
e444c674f6 AltairZ80: Enable interrupt event after BOOT 2024-03-13 10:31:05 -04:00
B. Scott Michel
ae9e57f659 SCP: sprint_val comma bug, GH: Remnant symlinks
- Fix comma separator code segmentation fault: "ndigit - 3" can become a
  very large unsigned number for ndigit < 3.

- dir_cmd: Allocate WildName from heap to reduce stack pressure.

- Github CI/CD: Remnant symlink issue reappeared, afflicting the
  makefile-based build. For better or worse, the workaround is now
  dependent on specific Python versions that must be removed, unlinked
  and any remnant symlinks that HomeBrew decided it needed to install in
  /usr/local/bin. The Python upgrade is triggered by the sdl2_ttf
  package.

  According to the Github image maintainers, this is an old, known issue
  in macOS images that originates inside of Homebrew.
2024-03-12 11:51:19 -07:00
B. Scott Michel
c47e933a60 CMake: Reduce excess quoting
cmake/cmake-builder.ps1 added quotes to arguments that contained spaces,
so that arguments printed correctly for progress output. This introduced
excess quotes that caused CMake (and likely other MS apps) confusion or
argument misinterpretation.

Instead of CMake seeing a single "Visual Studio 17 2022", CMake was
actually seeing "\"Visual Studio 17 2022\"".

This patch only adds the additional quotes when reporting progress or
emitting debug output. Otherwise, command line arguments are passed
unmolested.
2024-02-23 16:07:47 -05:00
Richard Cornwell
a58849613b SIM_CARD: Fixed issues caused by last commit to sim_card.c 2024-02-15 20:14:21 -05:00
Richard Cornwell
1a1396d0ba I7000: Group update for IBM 7000 series simulators.
I7010 updated to pass diagnostics.
        I7080 updated to pass diagnostics.
        I7090 updated to better pass 9IOT
              updated to allow Stress and other applications to run better.
        Updated card punch to allow input of card decks for overpunching.
2024-02-01 16:53:53 -05:00
Richard Cornwell
e425c75d0d KA10: Fix RH10/20 to allow access to registers during transfer. 2024-02-01 16:53:53 -05:00
Richard Cornwell
e0b08b3894 KA10: Fix random hang on DP disk drives. 2024-02-01 16:53:53 -05:00
Richard Cornwell
fc7b65cb47 KA10: Poll quicker for Chaosnet packet when there's traffic. 2024-02-01 16:53:53 -05:00
Richard Cornwell
2eaa31f10e B5500: Make sure Lines per page gets initialized properly. 2024-02-01 16:53:53 -05:00
Tony Lawrence
6a1b5685fd PDP11: RP11: Make sure to advance DA after every I/O
It looks like disk controllers, which automatically update
disk address (DA) after completion of I/O, are expected to do
so even if there was no data transfer because of I/O errors.
I was studying RSX-11's Error Logger documentation and
examples are clearly offsetting disk addresses backwards
by one when I/O errors are reported by the controller.

Since once the controller has found the DA-specified sector,
the I/O begins regardless of the condition of the sector (bad
or good data) or ability to transfer the contents between the
disk and the memory.  If an error occurs (NXM, for instance)
the operation would stop (with the error reported) at the end
of the sector.  So if, for example, the bus address register
had a bad address from the get-go, no data would be able to
transfer at all, yet DA should still be updated with DA + 1
once the controller asserts the DONE bit.

This patch makes sure that DA is always advanced when I/O has
actually been commenced.
2024-02-01 12:56:04 -05:00
Patrick Linstruth
2a5f758aad AltairZ80: Adds SET CPU RESIZEMEMORY and other
Changing the CPU type or MEMORY size/configuration causes memory
resources mapped by other devices to be removed. This is not made
clear by "HELP CPU" and the user has no feedback that this is
happening.

This PR does the following:

1) HELP SET CPU shows that SET CPU MEMORY requires a value.
2) Feedback is provided if the value is omitted or not properly formatted.
3) Unmapped memory resources caused by a SET CPU command are displayed
   on the SIMH console.
4) Adds a SET CPU RESIZEMEMORY command that resizes system memory
   without unmapping other device memory resources.
2024-02-01 12:55:50 -05:00
David Gesswein
d9f2d39c56 PDP8: Fix missing clock pre-calibration instruction set due to typo 2024-02-01 12:55:07 -05:00
Mark Pizzolato
7a6a325580 ETHER: Make sure SET NOASYNC is effective for Ethernet devices
- Make sure that asynchronous mode can't be changed if devices using
   sim_ether are already attached.
- Add missing DEV_ETHER type flag for the only sim_ether using device
   that didn't already have it.
2024-02-01 12:54:53 -05:00
Patrick Linstruth
b273cac59e ALTAIRZ80: Fixes problem with MEM dump command
The MEM dump command would not display past SET CPU xK memory
size. This prevented displaying ROMs or other RAM windows when
a lower amount of memory was specified. This PR changes MEM to
always display a minimum of a 64K regardless of main RAM size.
2024-02-01 12:52:59 -05:00
Patrick Linstruth
3b4333dfcc ALTAIRZ80: Adds JAIR devices to simulator
Josh's Altair/IMSAI Replacement (JAIR) is a single board computer
(SBC) for the S100 bus. I created this device to assist a friend
with getting IMP and CBBS working on his JAIR. Without having a
JAIR myself, AltairZ80 to the rescue!

The following devices are added:

JAIR   - The main JAIR board I/O and ROM
JAIRS0 - Serial Port 0 (COM1)
JAIRS1 - Serial Port 1 (COM2)
JAIRP  - Parallel Port

This was a bit challenging because the JAIR uses an on-board SD
card with FAT file system to hold its BIOS and CP/M disk images.
The ATTACH command is used to mount SD card images to the
simulator. The simulator emulates the SD card interface for
read/writing SD card sectors. These images are easily mounted on
a Mac making moving files around easy. I do not know about Windows.
These same images can be written to an SD card and used with real
JAIR hardware, which may be useful for JAIR owners.

The serial and parallel ports fully support TMXR. Host serial ports
and sockets may be attached to these devices.

I am working on a GitHub repository containing an SD card image and
init script that will boot CP/M 2.2 on the JAIR simulator.

Is this device one that should be added to AltairZ80?
2024-02-01 12:52:41 -05:00
Patrick Linstruth
560f30d144 SCP: Adjust timer calibrations if SET THROTTLE x/t type is enabled
SCP doesn't initially adjust timer calibrations if SET THROTTLE x/t
type is enabled causing large delays in event dispatches. This PR
runs the timers through the same calibration adjustment loop as
other throttle types.
2024-02-01 12:52:24 -05:00
Patrick Linstruth
6925456d51 ALTAIRZ80: Add 1K RAM to SOL20 device
The Sol-20 provides 1K RAM at C800. This was discovered to be missing
when issuing a "SET CPU 24K" command. Without the CPU providing RAM
at C800, the Sol-20 would not function. This PR corrects the problem
by having the SOL20 device provide its own 1K RAM at C800.
2024-02-01 12:52:06 -05:00
B. Scott Michel
a275c71170 SCP: Reduce compiler warnings on LP64 platforms
(Note: Reducing compiler warnings across all, but primarily LP64
platforms, is a long term objective.)

Reduce compiler warnings on LP64 platforms (macOS, Windows) and 32-bit
builds (Win32). Prefer 'size_t' for pointer arithmetic, array indexing
and extents; 'int' hasn't been used for these purposes for many years
and across many ANSI standards. N.B. that conversions from int or int32
to size_t cause the compiler to zero-extend the value, which is
inefficient.

Refactor printf() format modifiers into sim_printf_fmts.h. Add the
SIZE_T_FMT modifier for better portability, especially on LP64 platforms
where size_t is unsigned long and sizeof(size_t) > sizeof(int).

3B2: Fix known size_t printf() format.
2024-02-01 12:51:32 -05:00
B. Scott Michel
d9d0e8bd74 CMake: Updates
Issue #294: "apple silicon build problem(s?)": If the "--flavor/-f" flag
is not specified on the command line, then complain loudly, print help
and exit. The script used to default to "Unix Makefiles".

Updates:

- Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG
  library is detected/present for screen capture support.

- Add "clang64" to the list of MinGW64 platforms for which the
  .travis/deps.sh script can install build dependencies.

- Add PThread4W_FOUND to the condition that sets async I/O for Win32
  when using vcpkg for build dependencies.

- Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to
  build 64-bit Windows executables.

- Use simulator AIO only where needed by the simulator (i.e., the
  simulator calls/uses AIO_CHECK_EVENT in sim_instr())

  - Add "USES_AIO" flag to add_simulator() to mark a simulator that
    acutally uses asynchronous I/O.

  - Build "_aio" SIMH core library variants that have AIO turned on,
    link with the "_aio" variant when a simulator sets USES_AIO.

  - Emit a warning message when WITH_ASYNC is False (CMake configuration
    option) to notify the user/developer that some functionality will be
    crippled.

  Affected simulator builds: 3b2 family, PDP-6, PDP-11, VAX family,
  IMLAC and TT2500. The makefile and cmake/generate.py also updated
  to remain in sync with CMake.

  N.B.: Simulators still link with the underlying platform's threading
  library. SEL32 requires pthreads or equivalent threading library,
  independent of AIO.

- cmake/cmake-builder.sh

  - New "--no-aio" flag: Build simulators without async I/O.

  - New "--no-aio-intrinsics" flag: Don't build async I/O using compiler
    compare-exchange, atomic load intrinsics.

- cmake/cmake-builder.ps1

  - New "-noaio" flag: Build simulators without async I/O.

  - New "-noaiointrinsics" flag: Don't build async I/O using compiler
    compare-exchange, atomic load intrinsics.

CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name
must now be an absolute path. Relative paths no longer accepted.
Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH
was first implemented.
2024-02-01 12:51:13 -05:00
B. Scott Michel
f4c39a325c SCP: Add'l memory sanitization fixes
Initialize de-dup'ed debug line buffer:

  realloc(NULL, size) == malloc(size), which is uninitialized space.
  This causes the Clang memory sanitizer to detect an attempt to read
  uninitialized memory when debug_line_buf and debug_line_buf_last are
  different lengths. While the uninitialized space may never actually be
  compared, the memory sanitizer emits a strong hint to not do stupid.

  The sanitizer trips in the i650 simulator on the first memcmp(),
  debug_line_buf has 108 characters, debug_line_buf_last has 56
  characters (uninitialized space follows the 56 characters, tripping
  the sanitizer.)

  - memset() debug_line_buf and debug_line_buf_last to zero so that
    memcmp() will always gracefully return non-zero if somehow memcmp()
    ends up going past the end of either buffer.  Should never happen in
    practice, but theory always gets mugged by reality.

  - Keep track of debug_line_buf_last's comparison length (i.e., up to
    the '\r') and only execute memcmp() when this length equals the
    current debug_line_buf comparison length (end - endprefix + 1).

  - Added a log deduplication test to "testlib" command to ensure that
    nothing broke as a result of this fix.

Network ACL check in sim_addr_acl_check:

  The memory sanitizer found an off-by-one bug in sim_addr_acl_check
  while executing "testlib". This makes CIDR network ACLs functional,
  e.g., "127.0.0.1/32" is interpreted properly and the associated
  "testlib" test passes.
2024-02-01 12:50:52 -05:00
Paul Koning
c077c22d24 PDP11: fix disassembly of reg,src instructions
This corrects the disassembly of MUL, DIV, ASH, and ASHC so it works
correctly when the register is not R0.
2023-12-18 14:33:06 -05:00
B. Scott Michel
625b9e8d45 CMAKE: Python distutils obsoleted.
Python 3.12 will not have the distutils package in the standard library.
The TextFile class is particularly useful when reading [Mm]akefiles, and
recreating its functionality would be painful.

Stash a local copy of the last version of distutils.text_file.py and use
it. Do not rely on distutils being present or installed.
2023-11-28 09:51:29 -05:00
Tony Lawrence
dd49f851a4 PDP11: RP11: Remove duplicate checks (now only done in svc routine) 2023-11-28 09:51:01 -05:00
Lars Brinkhoff
7797344bf9 PDP11, VAX, KS10: Speed up Chaosnet polling when there is traffic. 2023-11-28 09:49:35 -05:00
Lars Brinkhoff
1ed26cfb0e KS10: Make Chaosnet work. 2023-11-28 09:49:35 -05:00
Tony Lawrence
47cf74ac4b PDP11: TA11/TU60 fix identification 2023-11-28 09:48:36 -05:00
B. Scott Michel
b3465af64e CMake: cmake-builder.sh "-c" takes an argument 2023-11-28 09:47:36 -05:00
B. Scott Michel
dfda031f23 CMake: Multiple targets, clean cache
Two updates suggested by Paul Koning:

- Enable building multiple simulator targets using a comma-separated list,
  e.g.: pdp8,pdp11,3b2

- Unconditionally clean CMake's cache each time the script is invoked.
  This eliminates confusing CMake configuration messages when CMake
  changes or updates, and CMake policies change.

  The most recent policy change was IMPORT_LOCATION, which is now
  mandatory for interface libraries. An old CMake configuration cache
  doesn't reflect the import library IMPORT_LOCATION property, which
  caused confusing warning messages. The cure is removing the old cache
  and reconfiguring.
2023-11-28 09:47:36 -05:00
Paul Koning
cc76d9a70d
Update README.md
Add Coverity scan status badge
2023-11-27 10:55:16 -05:00
Christian Gauger-Cosgrove
2396fd0349 PDP-11, VAX: Expand DTYPE mask size, fix RF35, add new devices to RQ sim
The disk type mask width (UNIT_W_DTYPE) was increased to six (6) bits, doubling
the possible number of disk types definable to sixty-four (64).
The RF35 was not entered in either the drv_tab or drv_types tables, causing any
set command issued for the drive type defined after the RF35 -- the RF71 through
RF73, as well as any disk defined after the RF73 -- to act incorrectly.
The ESE20 solid state disk and ESE50 series of solid state disks are
added based on simple drive geometry and size information without any parameters
for bad block management (not that it is used in the simulation anyways). The
ESE50 series drives are labelled as they are in the MSCP specification document,
the Ultrix-32 v4.5 disktab, and the Media Type noted in the "ESE50 SDI Solid
State Disk User Guide" (EK-ESE50-UG.B01):
 * ESE50-A: ESE52
 * ESE50-B: ESE56
 * ESE50-D: ESE58
The RD33 is added based on the geometry of the Microscience HH-1090 hard disk
drive, with the bad block management information calculated from the bad block
information for the other RDxx series drives.
The RX18 is added based on the geometry of the RX180 floppies in the VT-180
"Robin" CP/M system, which are noted in the MSCP specification document as a
possible device. Specific information is taken from the "VT-180 Series Technical
Manual" (EK-VT18X-TM-001).
2023-11-21 16:26:52 -05:00