1
0
mirror of https://github.com/simh/simh.git synced 2026-01-13 15:27:14 +00:00

4995 Commits

Author SHA1 Message Date
Lars Brinkhoff
a3777d6235 Imlac: Add support for loading paper tapes.
"load -p" loads a paper tape image.
2025-06-06 03:00:51 -10:00
Lars Brinkhoff
7e6e3ba50c Imlac: Add support for load -s.
This loads a "special tty" image file, just like a plain "load" will.
2025-06-06 03:00:51 -10:00
Thalia Archibald
4f157b9318 PDP11: Document CIS register-form instructions
Only the string instructions document the registers used by the
register-form instructions. Also document the BCD register-form
instructions. Although, the operands have already been loaded into the
special-purpose instructions before the op switch, I think this
documentation is useful.
2025-06-06 02:56:55 -10:00
Thalia Archibald
f27e40130a PDP11: Fix L2DR and L3DR comments
These instructions are referred to as L2Dr and L3Dr in the PDP-11/24
System Technical Manual (https://www.vt100.net/manx/details/1,23) and
their opcode strings call them L2DR and L3DR. These comments seem to be
a simple typo.
2025-06-06 02:56:55 -10:00
Mark Pizzolato
b30465f779 IBM1130: Remove stray tab characters left in prior commit 2025-06-05 05:46:19 -10:00
Mark Pizzolato
f3c61c315a Visual Studio Projects: Force build to update to the latest windows-build
- windows-build now supports the latest Visual Studio 2022 17.14.3

Fix: #1216

#1216 reports problem with 17.14.2, but MS had already released 17.14.3
as of 5/28/2025, so that version is what is now supported.

This whole array VS2022 problems comes from the fact that Release
builds of certain static libraries are rejected at link time as
incompatible with those libraries produced by any prior Visual Studio
version.  This problem has existed for a very long time (going back to
at least VS2017).  The earlier strategy implemented with simh builds
was to not support the latest Visual Studio tool set until it stopped
changing.  That was sort of OK when Visual Studio versions changed
every 2 years, but since VS2022 was dragging on with frequent changes
support for intermediate versions was added some 3 years back.
2025-06-01 03:09:23 -10:00
Mark Pizzolato
8746040310 Visual Studio Projects: Force build to update to the latest windows-build
- windows-build now supports the latest Visual Studio 2017
- Temporarily Disable Appveyor logic saving build results until that's ready
2025-05-31 18:29:18 -07:00
Mark Pizzolato
0da98bcd50 makefile: Build cleanly when local language isn't English
gcc version determination only works reliably when language is set
to english.

Fix #1215
2025-05-31 06:44:55 -10:00
Mark Pizzolato
bb6a21042e makefile: Add build support on Chimera Linux 2025-05-30 16:18:58 -10:00
Mark Pizzolato
8bc2bfce93 makefile: Add baseline HomeBrew support for Apple ARM platforms 2025-05-12 16:13:26 -10:00
Mark Pizzolato
af2a0f7caa VIDEO: Build cleanly if PNG support isn't available 2025-05-11 18:15:47 -10:00
John D. Bruner
729502aa9d SCP: treat SIGTERM and SIGHUP as equivalent 2025-05-09 19:55:09 -07:00
Mark Pizzolato
8b597d32aa Visual Studio Projects: Force build to update to the latest windows-build
windows-build now supports Visual Studio 2022 17.13.6
2025-04-26 18:33:07 -10:00
Peter Kooiman
ef8f4f53a2 simulators with global variables PC, SP and BC: Avoid name space collisions.
Avoid potential name space collision for the global variables PC, SP and BC
when readline is dynamically loaded.  For some unknown reason, ncurses
exports these internal variables which may be needed in the context of
how ncurses is used by readline implementations.  In any case, these
variable names are common in simulators, so there is an undesired
interaction between simulator internal variables and the simplest
solution is to rename these simulator global variables where they exist.
Another alternative is to merely declare these variables static when
they happen to only be referenced in a single simulator source module.
2025-04-09 13:56:27 -10:00
Mark Pizzolato
dab8053cf8 Non Unibus and Non Qbus VAXen: Fix error message in boot ROM device support 2025-04-06 23:45:06 -10:00
Mark Pizzolato
dd82ea0851 Non Unibus and Non Qbus VAXen: Properly handle the boot ROM device support
- Previously the Option ROM device (OR) logic improperly used the UNIT
  UNIT_ATT flag to indicate a devices with Option ROM support.  This
  bit has specific meaning to many SCP capabilities while there are
  numerous device specific fields in the UNIT structure which DEVICEs
  can use as needed.
- Enhance SCP SHOW output for Option ROM units to indicate the DEVICE
   which each enabled ROM is related to.

Fixes #1210
2025-04-06 14:17:54 -10:00
Mark Pizzolato
7222199448 Visual Studio Projects: Force build to update to the latest windows-build
windows-build now supports Visual Studio 2022 17.12
2025-03-28 09:11:21 -10:00
Mark Pizzolato
6ae1467470 SCP: Assure that sim_async_lock is always a recursive lock
This is needed for both the Intrinsic and basic pthreads cases.
2025-03-22 08:12:01 -10:00
Mark Pizzolato
33166dfcdf SCP: Fix potential multi threaded simulator activities when flushing log data
Avoid the potential by properly leveraging the range that the
recursive mutex which already properly serializes separate activities
to the debug log file.
2025-03-21 09:36:36 -10:00
Mark Pizzolato
fed5342f44 SCP: CONSOLE Cleanup and DBGSIGNAL help
- Add HELP language for SET CONSOLE DBGSIGNAL|NODBGSIGNAL.
- Remove obsolete sim_os_poll_kbd_ready platform specific routines
  which were only used with the never functional asynchronous TMXR
  code which has been otherwise removed everywhere else.
- Cleanup DBGSIGNAL related code comments

-
2025-03-20 17:12:50 -10:00
B. Scott Michel
474f84244d CONSOLE: Separate debug character from signal
Add the "DBGSIGNAL", "DBGSIG" options to enable sending the interrupt to
the user's debugger, which is presumably gdb.  Separates setting the
debugging interrupt character from the action so that it is possible to
turn debugger interrupts on and off:

     set console dbgint=1f dbgsignal
     set console nodbgsignal

Previously, this feature was only available if the compiler did not
define __OPTIMIZE__, which precludes optimized debugging code, i.e.,
compiling with "-O2 -g".
2025-03-20 16:29:35 -10:00
B. Scott Michel
0185df8fee CONSOLE: Remove Win32 console output overhead
Don't repeatedly call GetConsoleMode() on Win32 each time
sim_console_write() is called.

Use an output function pointer to invoke WriteConsoleA (console output)
or WriteFile (output is not a console). The console output destination
doesn't change during the lifetime of the simulator, so avoid
extraneous overhead for each character output (sometimes strings, but
mostly characters.)
2025-03-20 09:25:50 -10:00
Richard Cornwell
9b0d7a77d8 CONSOLE: On Windows fixed writing to Console when stdout is a file 2025-03-20 09:16:59 -10:00
Mark Pizzolato
bf83567e61 SCP: Add debugging support for shutdown activities 2025-03-18 17:14:02 -10:00
Mark Pizzolato
c4d3aadc68 TMXR: Make sure to add single line mux with a destination to open list 2025-03-17 14:51:11 -10:00
Patrick Linstruth
5cfa8662e9 AltairZ80: VDM1 correct boot code, IO addressing 2025-02-13 01:24:03 -10:00
Lars Brinkhoff
68034af94a H316: Convert IMP long leaders to short, and vice versa. 2025-01-30 11:45:05 -10:00
ken rector
389a8ade1f sigma: implement attention interrupt to sigma)mt.c 2025-01-30 12:24:29 -08:00
B. Scott Michel
fc03fd432e IMLAC: Type consistency warnings.
- Fix Type consistency warnings.
- CUR_AC -> AC (revert)
2024-12-09 09:54:25 -10:00
B. Scott Michel
b9553f672a TT2500: Debugging and reduce type slice warnings.
- Debug: Output the character received, if printable.
- Eliminate type slicing warnings (uint32 -> uint16)
2024-12-09 09:34:58 -10:00
Peter Schorn
9f595c066c AltairZ80: Support for disk images of Amstrad CPC 6128 with ULIfAC board 2024-11-26 07:43:03 -10:00
Mark Pizzolato
a6aaa0a84f ETHER: Add missing declaration when Ethernet support is unavailable 2024-11-11 20:10:50 -10:00
Mark Pizzolato
8b1f15f233 Visual Studio Projects: Force build to update to the latest windows-build 2024-10-25 20:15:27 -07:00
ken rector
0799544312 sigma: return corrrect CC on line disconnect 2024-10-25 17:24:02 -07:00
Mark Pizzolato
8469b30d85 Visual Studio Projects: Force build to update to the latest windows-build 2024-10-11 18:05:53 -10:00
Mark Pizzolato
ca8f3f096e SCP: Add SIM_HOST_CORE_COUNT and SIM_HOST_MAX_THREADS environment variables
Scripts (or internal test code) can use this information as needed.
2024-09-06 15:17:50 -10:00
Patrick Linstruth
b3a1bc2466 AltairZ80: Updates prev PR to support Extended Mem
The previous PR that added the "ROM" option to "load -h" did
not support extended memory. @psco provided an update that
corrects that problem.
2024-09-03 20:52:28 -04:00
Mark Pizzolato
0a22668b29 SCP: Properly output remote console command results when using Microsoft Telnet
Microsoft Telnet client doesn't properly implement the binary mode telnet
negotiation and therefore always follows input \r characters with \n.
2024-09-02 18:20:35 -10:00
Mark Pizzolato
661be5d1eb Qbus MicroVAXen: Fix Qbus Address reference passed in by some OS boot code
Problem reported in https://github.com/open-simh/simh/issues/409

There are key differences between the MicroVAX I and MicroVAX II.
Specifically, the MicroVAX I is a machine with direct Qbus memory and
no QBA (Qbus Adapter) which is part of all later MicroVAXen and
corresponds to the UBA (Unibus Adapter) on systems with Unibuxes.
Among possibly other things, these Adapters primarily provide the
translation between the CPU's system memory and addresses on the
respective bus (Qbus or Unibus).  These Adapters provide a set of
mapping registers which map the respective bus addresses to desired
locations in CPU memory which allows for "Scatter/Gather" memory
transfers.  The MicroVAX I, having its memory directly on the Qbus,
has no CPU specific way to implement "Scatter/Gather" for I/O device
for memory transfers very much needed in systems with virtual memory.
On this system, the Scatter/Gather functionality is provided directly
within the MSCP controller which is simulated by the pdp11_rq.c
module.

On Qbus MicroVAXen with Qbus Adapters, the boot rom initializes all
the Qbus mapping registers such that Qbus addresses map directly to
CPU RAM addresses.  This simplifies boot code which don't turn on
Virtual Memory (and thus the need for Scatter/Gather) until later stages
of the operating system boot.  The Ultrix boot we're dealing with plays
games with the mapping registers somewhat early in the boot, and
requests a transfer of 0x2000 bytes (words maybe) to an address of
0x010000c8.  Note that this would be the address from the point of
view of the controller on the Qbus.  This value is actually beyond the
end of the 22bit Qbus address space (0x003fffff).  The controller
therefore previously returned a non-existent memory error.

It would seem that instructions performing this I/O request are ones
which were loaded by an earlier read and thus the bug really should
be there, but since this code actually worked on real hardware,
accomodating that behavior belongs in the simulator.  Meanwhile,
when this transfer has happened, the QBA Mapping registers have
been changed from their initial values that mapped 1-1 Qbus addresses
to RAM.  The proper approach is therefore merely to ignore any bits
in the transfer address beyond the 22bits of the Qbus address space.

Interesting that all other operating systems (or boot code) never
presented a buffer address beyond the maximum 22bit Qbus address.
2024-09-02 18:20:35 -10:00
Patrick Linstruth
2adbe8c4fa AltairZ80: Adds "ROM" option to "load -h"
Adds the ability to mark pages as ROM when loading Intel HEX
files.
2024-09-02 21:17:52 -04:00
Ken Rector
5421c9c22e sigma: Update latest from Bob Supnik's v3.12-5
- Add new CP and CR devices
- COC: Zero delay from SIO to INIT state Detect and UEN on 0xFF order
- COC: Moved SIO int pending test to devices
- DK: Zero delay from SIO to INIT state
- DP: Added case points for RDEES, dp_aio_status
- DP: Zero delay from SIO to INIT state
 - defs:  Added chaining modifier flag
 - defs:  Fixed DVT_NODEV definition
 - defs:  Added chan_chk_dvi definition
 - io: Added chaining modifier flag
- LP: Zero delay from SIO to INIT state
- LP: Added INIT test for illegal command
- LP: Moved SIO interrupt test to devices
- MT: Zero delay from SIO to INIT state
- PT: Zero delay from SIO to INIT state
- PT: Moved SIO interrupt test to devices
- RAD: Zero delay from SIO to INIT state
- RAD: Fixed nx unit test
- RAD: Fixed write protect test
- TT: Zero delay from SIO to INIT state
- TT: Moved SIO int pending test to devices
2024-07-29 10:10:17 -10:00
Mark Pizzolato
d2cd594cde PDP11: Integrate RR (RP11) device with full sim_disk capabilities 2024-07-20 15:08:19 -10:00
Tony Lawrence
434a1f807b PDP11: Add RP11 device (RR)
PDP11: RP11: Interrupt on IE+RESET+GO

Recent analysis of the 2.9BSD kernel revealed that RP11 was
expected to interrupt on control RESET function if IE bit was
also set.  Documentation was not very clear of the fact, saying
in one place that RESET+GO does not interrupt (which is not
contradictory with the above because it does not mention IE).

In other place, however, it says that IE always causes interrupt
when DONE is asserted.  Thus, since RESET does assert DONE, an
interrupt should be posted if IE is set.  The autoconfig binary
from 2.9BSD uses this feature of RP11 to check the presence
of the controller.

Formerly RESET was always clearing RPCS with DONE unconditionally,
and that reset IE as well.  This patch makes sure that the IE bit
is preserved, and if set, it posts an interrupt when RESET asserts
DONE.

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.

PDP11: RP11: Remove duplicate checks (now only done in svc routine)

PDP11: RP11: Implement delayed CS_DONE for "initiation" commands (SEEK/HOME)

Running earlier XXDP tests revealed that a technique of concurrent command
initiation and continued housekeeping for the command completion was used in
the old code.

For example, code could initiate a SEEK command for a drive, and knowing that
CS_DONE (and thus, an interrupt) is coming in about 16us, it would then go
ahead and clear a flag, which registers that the interrupt has occurred
(expected to be set to 1 by the ISR).  If CS_DONE is set by the implementation
at the function initiation immediately, that would mean that the interrupt
could be triggered before the next instruction, and the flag would be set by
the ISR right away.  The main code, however, would proceed with the the flag
clear as the following instruction, thus, never detecting the interrupt down
the road.

Since this technique was in existence, it is better to introduce a delay for
setting CS_DONE in the "fast" initiation commands like SEEK and HOME, to
accommodate the software that was relying on it.

So far, however, no issues were encountered in testing (except one), where
this delay mattered, but it's hard to tell if it would not be needed at all.

All I/O commands always delay CS_DONE already because they were never supposed
to be immediate.

Since the time for CS_DONE in initiation commands was documented at 16us, the
introduced delay is set to 10 instructions, which usually took more than that
to execute.  But the interrupt flag clear case would be covered, as well as
the counted waits, which used some 25+-iteration tight loops for "drive ready",
before flagging a time-out (so the delay cannot be longer, either).

It also looks like more modern code never used any such tricks, so for it, it
should not matter if CS_DONE was slightly delayed or not.

PDP11: RP11: Major update after XXDP

Having run the device code thru XXDP and some other OS's and scenarios
rigorously, a bunch of discrepancies were found, which need to be addressed
by this rather extensive patch.

1. Each unit must implement its own "drive status" register, to be able to
   track per-drive errors / conditions correctly;
2. Fixed INT_SET() / INT_CLR() in RPCS write function (wrong order of the "if"
   conditions);
3. Some behavior was implemented not exactly how it was expected from the real
   hardware, such as:
   a. Post-I/O register values in RPDA and RPCA (including the corner case of
      pack overflow);
   b. I/O stacking, which wasn't mentioned in any available documentation, but
      only XXDP listings;
   c. RESET/IDLE function must be accepted for a "busy" controller;
   d. HOME function must always execute, even when "device ready" is not set
      (e.g. when SEEK error detected);
   e. SEEK incomplete should not respond with "device ready" (however, the
      condition can be cleared by HOME, d.);
   f. WLOA-induced write-lock violation wasn't reflected in "device status".
4. Some timing was off so that the device worked "too fast" -- this was fixed
   (except for the pathological cases when the races are in the actual test
   code, and cannot be logically fixed);
5. WLOA setup command bug was fixed;
6. Added more code comments found per the above peculiarities.
2024-07-20 15:02:45 -10:00
Mark Pizzolato
e9a438e3aa VAX - SCSI: Remove obsolete routine declarations 2024-07-20 14:58:52 -10:00
Mark Pizzolato
bcb68eb6c2 DISK: Properly update disk footer when needed and avoided when not 2024-07-20 14:58:52 -10:00
Mark Pizzolato
a03fb9fa2f DISK: Generalize additional drive parameters 2024-07-20 14:58:52 -10:00
Bob Supnik
51a611ca6b H316: MT device reset should use tim_tape_bot 2024-07-17 10:47:17 -10:00
Bob Supnik
3840fcfe7a PDP11: Fixed disassembly of ASH,ASHC,MUL,DIV
Fix original change from Paul Koning
2024-07-17 10:45:27 -10:00
Tony Lawrence
6dc5ddd509 PDP11: Fixed writes to 11/70 RO registers 2024-07-17 10:23:29 -10:00
Peter Schorn
9b1e541c8f AltairZ80: Fix 8080 and Z80 CPU
This fixes the H flag handling for the 8080 CPU and corrects the parity
flag computation for the Z80 CPU for INI, OUTI, IND, OUTD, INIR, OTIR,
INDR and OTDR instructions. It is based on Thomas Eberhardt's work.
2024-07-16 12:13:48 -10:00