1
0
mirror of https://github.com/simh/simh.git synced 2026-05-16 02:02:15 +00:00
Commit Graph

5124 Commits

Author SHA1 Message Date
Jeff Epler
ee7c4ec51f SWTP6800: Correct flags computation for SBC A
When compiling with `-O -Wall -Werror`, the compiler produced
a diagnostic that `op1` was used uninitialized in these
two locations.

Similar to the implementation of `case 0xC0: /* SUB M imm */`,
save the initial value of the `A` operand in `op1` so that the
flags can be computed correctly.
2026-05-08 07:19:57 -10:00
Mark Pizzolato
5981b637b7 ETHER: Update VDE support for VDE2
- Accept all allowed vde connection specifiers.
- Avoid using the vde_open_args parameter since it no longer operates
  consistent with the original documentation.
- Continue support for the legacy simh vde port number specifier
  vde:switch-path{:port} is transformed to vde:switch-path[port]
- Provide the vde switch port description to include the connecting
  simulator type, its pid and the device name in that simulator

Changes inspired by discussion in https://github.com/open-simh/simh/issues/542
2026-05-08 07:19:46 -10:00
Perry E. Metzger
ba514d6feb SCP: Fix expression evaluation wrong buffer parsed after environment lookup
This bug report was generated by Codex on Perry Metzger's codebase.

Summary

In scp.c, SCP expression evaluation can parse the wrong string after
_sim_get_env_special() returns a value.

The failure occurs when:
      - the expression element is not a register name
      - _sim_get_env_special() finds a numeric value
      - the returned pointer is not the local string buffer passed by
        the caller, but some other backing storage, such as a host
        environment string

In that case, sim_eval_expression() incorrectly parses string instead of
the pointer returned by _sim_get_env_special().

User-visible effect

A numeric expression that refers to a host environment variable can evaluate
incorrectly.

Example:

SIMH_TEST_EXPR_VALUE=41
expression: SIMH_TEST_EXPR_VALUE + 1
expected: 42
actual:   1

The + 1 still works, but the left-hand variable is parsed from the wrong
buffer, so it contributes 0.
2026-04-21 06:50:21 -10:00
Perry E. Metzger
25fa20b92f SCP: Fix sim_exp_check() stale capture-group cleanup bug
Symptom
After one regex match with more capture groups, a later regex match with
fewer groups could leave stale _EXPECT_MATCH_GROUP_n values behind from
the earlier match.

Example:

      1) A first match exports:
            - _EXPECT_MATCH_GROUP_0=ab42
            - _EXPECT_MATCH_GROUP_1=4
            - _EXPECT_MATCH_GROUP_2=2
      2) A later match with only one subgroup exports:
            - _EXPECT_MATCH_GROUP_0=cd7
            - _EXPECT_MATCH_GROUP_1=7
      3) _EXPECT_MATCH_GROUP_2 incorrectly remained "2" instead of
          being cleared or blanked.

Cause
sim_exp_check() tracked the prior regex state in a static
sim_exp_match_sub_count, but it updated that count incorrectly after a
successful match.

It stored the wrong bound for later cleanup, so the loop that blanked
stale _EXPECT_MATCH_GROUP_n entries did not run far enough.
2026-04-20 11:43:24 -10:00
Perry E. Metzger
d1d85b5a0e FIO: Fix Big Endian sim_fwrite() error
This problem was discovered by Codex initiated by Perry Metzger.

sim_fwrite() in sim_fio.c has a bug in the big-endian/swapped write
path. When a write spans more than one internal flip buffer, the
function advances its source pointer by size * count on every chunk
instead of by size * c, where c is the number of elements actually
written in that chunk.

This causes later chunks to read from the wrong part of the caller's
buffer, which corrupts the file contents.

Why this is wrong
    sim_fwrite() may break the caller's write into multiple pieces:

    nelem   is the number of elements that fit in the flip buffer
    nbuf    is the number of chunks to write
    c       is the number of elements in the current chunk

    After writing one chunk, the source pointer must advance by the
    size of that chunk:

        sptr = sptr + size * c;

    But the original code advanced by the size of the entire original request
    every time:

        sptr = sptr + size * count;

    That is only correct if there is exactly one chunk.
2026-04-16 16:02:54 -10:00
Mark Pizzolato
722302c45b TIMER: Add facility to restore memory to 0 after pre-calibration
PDP8, PDP11, PDP10, VAX and SDS simulators have memory restored to
zero after pre-calibration is performed.
2026-04-16 06:38:22 -10:00
Mark Pizzolato
4af6470df1 makefile: Simply identify each separate build step clearly
- More details are displayed when multiple targets are being built with
  or without parallel build activities.
- Display relative path displays when building.  Avoid noisy full path info.
- Pass jobs value in CI builds since some versions of GNU Make don't
  expose the -j value in the MAKEFLAGS internal variable.
2026-04-07 13:56:22 -10:00
Mark Pizzolato
5654a8fba0 PDP1, PDP8, PDP11 and PDP18b's: Properly detach when tape off reel is detected
- This change avoids the possibility of mangling a tape image if the tape
  type auto detection (12b, 16b, 18b) has changed the in memory tape
  format.
- Anyone who wants the off reel detection to have the simulator drop
  back to a sim> prompt should have a non-zero value in the STOP_OFFR
  register.
2026-04-07 12:00:48 -10:00
Mark Pizzolato
b0f160fc5a SCP: Properly handle filebuf allocation and freeing during ATTACH and DETACH
- avoid a memory leak under some conditions
- avoid a segfault under some conditions
2026-04-06 14:06:35 -10:00
Mark Pizzolato
31fee4aa7c Appveyor: Update macOS image to Monterey and leverage parallel builds for all 2026-04-05 20:34:15 -10:00
Mark Pizzolato
4922eba111 makefile: Setup for best behavior for parallel builds when available or desired
- display build progress better when parallel building is happening
- avoid prompting about building dependencies during CI builds
2026-04-05 20:21:46 -10:00
Ken Rector
0a68d7ab23 SDS: Add a front panel application for the SDS simulator (sdscp) 2026-04-05 20:15:17 -10:00
Mark Pizzolato
139dbe4f9a FRONTPANEL: Cleanup potential build warnings 2026-04-05 20:07:31 -10:00
Mark Pizzolato
abdc5318cb VAX: Use better random console telnet port number during build tests
This avoids some platform cases where SO_REUSEADDR isn't always
effective and on some build hosts being done in parallel, a simple
time based random value isn't unique enough.
2026-04-05 20:06:56 -10:00
Mark Pizzolato
692dcd3796 SCP: Add SIM_PROCESS_PID built-in variable
- SIM_PROCESS_PID is potentially useful in simulator scripts to provide
  a currently unique value.
2026-04-05 20:05:08 -10:00
Mark Pizzolato
72b7d03184 TIMER: Tolerate and record host system time jumps while idling
Additionally, tolerate clock change during initialization
2026-04-05 20:04:18 -10:00
Lars Brinkhoff
070341a89f H316: Fix IMP host port 3 and 4 device addresses.
IMP host port 3 should be device 50, and port 4 is 51.  This was
reversed.
2026-04-02 08:01:26 -10:00
Patrick Linstruth
9e3d414ef2 Altair8800: New Devices and Bug Fixes
This update to the Altair8800 simulator includes:

Adds MITS hard disk controller device
Adds FarmTek FDC+ disk controller device (1.5MB)
Adds iCOM 3712/3812 disk controller device
Adds Processor Technology VDM1 video device
Fixes boot bug in TARBELL and VFII devices
TARBELL returns 0xff for DMA status if 1011
Fixes DAZZLER vertical blank status timing
Adds DDT command to control DDT-style output
Improves MEMORY dump display
2026-03-31 16:16:10 -10:00
Mark Pizzolato
be3c7b4386 makefile: Add comments describing SOURCE_CHECK option 2026-03-31 16:14:17 -10:00
Mark Pizzolato
4e7f28ed1c PDP11: Correct REGister declarations for DL11-C/DL11-D/DL11-E/DLV11-J devices 2026-03-31 16:14:17 -10:00
Mark Pizzolato
042f0bd841 SCP: Fix SRDATA macros to properly size the structure element in its array 2026-03-31 16:14:17 -10:00
Mark Pizzolato
45b804e947 TMXR: Add serial line speed 230400 bps and missing 76800 bps on *nix 2026-03-31 16:14:17 -10:00
Richard Cornwell
ba89e0a468 KA10: Fixed DP seek done to not move uptr. 2026-03-31 16:14:17 -10:00
Mark Pizzolato
682c59edcf SCP: Properly match DEVICE only MTAB entries and fix flush queueing 2026-03-31 16:14:17 -10:00
Mark Pizzolato
bdd2612a8a PDP11: Enable EIS as an option on the PDP 11/40 2026-03-31 16:14:17 -10:00
Mark Pizzolato
ae805f7818 CONSOLE: Reliably identify running under a debugger on *nix hosts 2026-03-31 16:14:17 -10:00
John D. Bruner
e177a89210 SCP: Ensure null termination for mbuf.buf in sim_snprint_sym 2026-03-31 16:14:17 -10:00
John D. Bruner
c6ec912cbe SCP: Set appropriate uptr when SHOWing something in the default device (CPU)
- Avoid null pointer dereference in these cases

Credit (John D. Bruner) for reporting the problem.  His fix wasn't complete.
2026-03-31 16:14:16 -10:00
Mark Pizzolato
6e279976f6 CONSOLE: Support changing console DEVICE
Also behave correctly after a SET CONSOLE NOSERIAL command is entered.
2026-03-31 16:06:15 -10:00
Patrick Linstruth
627e6a6b13 Altair8800: New DAZZLER, PMMI devices and other features
Adds Cromemco DAZZLER video device
Adds PMMI MM-103 modem device
Adds SET RAM PROT/UNPROT=pages
Adds Martin Eberhard's CDBL ROM

Corrects file format for cromemco and pmmi header files.
2026-01-18 21:16:00 -05:00
Mark Pizzolato
a9b3369657 SCP: Useful minor updates
- Enhance file name extension matching logic to allow for file names
  that are enclosed in quotes ('' or "").
- Normalize exported environment variables that describe the Git
  Commit Id.
- Minor update to help for the ZAPTYPE command.
2026-01-02 12:51:01 -10:00
J. David Bryan
0bb4a9a4cd SOCK: Fix buffer overreach when simplifying IPv4-mapped IPv6 addresses 2026-01-02 06:52:10 -10:00
Patrick Linstruth
99a9a74e48 Altair8800: Adds new MITS 88-ACR (ACR) cassette device
BUS: Update formatting
SIO: Do not attach to BUS when disabled
Changed CONST to const
2026-01-02 08:18:21 -05:00
Mark Pizzolato
c31ea266e2 ETHER: Add support for Omni OS and Open Indiana plus bridged network support
- Some versions of Omni OS no longer include sys/filio.h in sys/ioctl.h
- Add more robust support for locating OS tools in scp.c
- SHOW VERSION output displays SunOS host system specific info

Fix #1238
2025-12-14 13:43:34 -10:00
Mark Pizzolato
fc460853ad VAXen: Cleanup processor build test message 2025-12-14 13:43:34 -10:00
Mark Pizzolato
6fce72d9bc FIO: Add current SunOS __illumos__ to SourceCheck platform defines 2025-12-14 13:40:43 -10:00
Mark Pizzolato
9c20f9ca35 makefile: Add support for building all simulators on illumos (Open Indiana)
- Proper compiler detection selects 64bit libraries when gcc generates
  64bit code.

Fix #1237
2025-12-09 16:43:14 -10:00
Mark Pizzolato
89b992d468 linc: Change line endings to simh CRLF standard
These file got missed when the linc simulator was original added
2025-12-08 12:45:09 -10:00
Richard Cornwell
e9908577fe CARD: Clean up comments on sim_card.[ch] on format of card decks. 2025-12-07 13:42:36 -10:00
Teodor Muzychuk
3cbe0d696d I650: fix wrong capitalization in soap and is .ini scripts
- Scripts I650/sw/Build_is_from_decks.ini and I650/sw/Build_soap_from_source.ini
  are incorrectly named for I650/650_demo_all.ini to function correctly.
  File not found errors are thrown immediately after running the demo.
- Moreover, their capitalization does not match any of the other .ini scripts
  (all start with lowercase letters).
2025-12-04 09:03:16 -10:00
Mark Pizzolato
657b75883e SCP: Clarify language in "HELP <device> SET" output SET <dev> DEBUG commands 2025-12-03 19:38:09 -10:00
Mark Pizzolato
82f07c9ab7 VAX: Use random console telnet port number during build tests
This avoids some platform cases where SO_REUSEADDR isn't always effective.
2025-12-03 19:36:23 -10:00
Mark Pizzolato
01bac285ec PDP11, VAX: Minor corrections in TS and RQ device help language 2025-12-03 19:33:06 -10:00
Mark Pizzolato
e1738eba0e README: Update to latest status 2025-12-03 10:39:33 -10:00
Mark Pizzolato
9187a4dc18 DISK: Properly size disk containers with meta data
- The meta data is not part of the storage of the container.
2025-12-03 10:38:58 -10:00
Mark Pizzolato
ab832ce274 TAPE: Better expose the various tape debug options usable from device debug
- Cleanup tape debug options and internal usage
- Add MTSE_DBG_INT for internal API activities
- Make sure SCSI uses the correct debug value for tape debug
2025-12-02 08:19:09 -10:00
Mark Pizzolato
5c68a17c13 SCP: Provide better support for SHOW devices with only one unit
- Cleaner display of SHOW DEBUG for devices with UNIT level debugging
2025-12-02 08:14:22 -10:00
Mark Pizzolato
b5bb4fa6dd Visual Studio Projects: Add a 'clean' option for the command line build 2025-12-02 08:14:21 -10:00
Mark Pizzolato
4fd9ded9ae CONSOLE: Add better support for SET CONSOLE TELNET=CONNECT
- Some OS support had a bug in the command passed to run telnet in the
  new window.
- Report when there appears to be no telnet client available on the
  local system.
- Add support for Fedora KDE.
2025-12-02 08:14:21 -10:00
Mark Pizzolato
7c47a6be6d Visual Studio Projects: Leverage the Visual Studio independent windows_build
- Add zlib to support compressed screenshots for libpng
2025-11-25 07:31:13 -10:00