Commit graph

700 commits

Author SHA1 Message Date
Tony Lawrence
c831460ecb PDP11: Fix to fix disassembly #331
As discussed in PR#331, the fix needed more fix with the proper
masks array.  This patch completes the fix.
2024-07-23 14:25:19 -04:00
Tony Lawrence
100f351575 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.
2024-06-13 21:42:44 -04: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
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
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
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
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
Tony Lawrence
eeebbed273 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.
2023-10-24 12:45:59 -04:00
Tony Lawrence
f75592c5b8 PDP11: 11/70 read-only registers must not return NXM on write
17 777 740 - 17 777 742, read-only error address registers,
and 17 777 764, a read-only System ID register,

and are not handled in the CPU70_wr() routine, which means for these
addresses the routine returns NXM, which then translates to "bus timeout"
(no response to address), and then, as a result, trap to vector 4.

That is incorrect, IMO.

These locations are read-only yet the address gets decoded, and even
though writing does not have any effect, the write routine for these
addresses should return SCPE_OK.
2023-10-10 19:52:41 -04:00
Tony Lawrence
090ed215de 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.
2023-10-10 14:10:50 -04:00
Tony Lawrence
5fba1e75e7 PDP11: TS11: Fix help output for BOOT command 2023-10-10 13:02:02 -04:00
Tony Lawrence
dc69862bc8 PDP11: RF11: Fix DAE computation in service routine 2023-10-09 20:16:01 -04:00
Tony Lawrence
5407544728 PDP11: RP11-C (RP02/03) disk implementation 2023-09-23 23:42:26 -04:00
Tony Lawrence
a8c5f7c88b PDP11: RP11-C (RP02/03) disk implementation 2023-09-22 19:41:33 -04:00
Olaf Seibert
cf47a20fd4 DISK: add RQDX1 model and make it default for MV1.
Now MV1 can boot Standalone Backup 4.0 from RX50.
See issue #215, #271, #277.
2023-07-18 20:13:11 -04:00
Olaf Seibert
86ffe4bec2 sim_disk.c: only free filebuf if it was allocated here too.
PDP11/pdp11_rq.c re-uses ->filebuf as a sector buffer (under the #defined
name rqxb) and allocates it as such. If an RQ disk is detached and
another attached, this buffer would be lost and the pointer reset to
NULL. sim_disk.c would only allocate the buffer if UNIT_BUFABLE is set,
which means to buffer the whole disk. Since this rightly isn't set on RQ
disks, the pointer would remain NULL and segfaults would ensue.  See
open-simh issue 274.
add comment about safe re-use of filebuf
2023-07-16 16:38:19 -04:00
Tony Lawrence
5b22fcf4c9 PDP11: RK11: Complete fix for WC as implemented in V3 + other fixes 2023-06-24 13:34:38 -04:00
B. Scott Michel
8b14bb69be
CMake build infrastructure II (#53)
* CMake build infrastructure

The squashed commit that builds and packages releases for the SIMH
simulator suite with CMake, version 3.14 or newer.

See README-CMake.md for documentation.
2023-05-17 20:18:42 -04:00
Lars Brinkhoff
af9c7b5ebc VAX: M7452 Unibus window module for VAXstation 100. 2023-05-04 13:28:11 +02:00
Paul Koning
b0f69eea95 PDP11: Support byte write access to DHCSR.
This fixes issue #201, using a fix proposed bu Bjoren Davis.
2023-03-30 09:33:41 -04:00
Mark Pizzolato
decbe5b76b Various simulators: Set line endings to CRLF for consistency, remove stray tabs
Project standard source code has tabs converted to spaces and CRLF line
endings.

Other text files have CRLF line endings.
2023-03-19 16:51:27 -04:00
Bob Supnik
2374c3b6b3 Floating loads are src,dst (nickd4) 2023-02-03 09:27:28 -05:00
Bob Supnik
86a995b863 PDP11: numerous 11/70 compatibility fixes 2023-01-31 13:06:04 -05:00
Bob Supnik
16de685c4b PDP11, VAX: Re-enabled VH11 after fixes (Mark Pizzolato) 2023-01-31 12:54:39 -05:00
Tony Lawrence
e062e2d7c1 PDP11: Remove dead code in RL11 2022-11-27 14:39:58 -05:00
Tony Lawrence
47908cc371 PDP11: More correction in RK help text (per Paul Koning) 2022-11-18 10:39:49 -05:00
Tony Lawrence
45f6fbaaa4 PDP11: Correct wording for RK MTAB entries and help text 2022-11-18 10:39:49 -05:00
Lars Brinkhoff
009d748ad6 PDP11: Enforce limit on number of displays in TV device. 2022-11-02 14:14:14 -04:00
Lars Brinkhoff
234be4883b PDP11: Remove fprintf debug statement. 2022-10-31 16:47:28 -04:00
Lars Brinkhoff
50419c18df PDP11: Fix TVSEL register.
It's sometimes used as a 16-bit register.
2022-10-31 16:47:28 -04:00
Lars Brinkhoff
34c4ab3cd5 PDP11: Improve idling. 2022-10-29 14:15:41 -04:00
Lars Brinkhoff
eb359b962f PDP11: Add MB11. 2022-10-29 14:15:41 -04:00
Lars Brinkhoff
6a384854cf PDP11: Add Logo TV raster display. 2022-10-29 14:15:41 -04:00
Lars Brinkhoff
2a4e4dc10d
Bug fixes for various video code. (#80)
* VIDEO: Fix bug: vid_ready can be used uninitialized.

* VIDEO: Not all events come with a valid windowID.

* PDP11: Fix NG SET TYPE.

The sense of MATCH_CMD is reversed.

* display: Fix bug in NG display controller.

There should be a separate state for each of the eight displays.

* display: Symbolic constant for number of displays.
2022-10-23 11:42:00 -04:00
Lars Brinkhoff
65410851d5 PDP11: DH11 device. 2022-10-18 07:28:28 +02:00
Lars Brinkhoff
4daf07bfe2 PDP11: Add option for 216K memory.
The Small ITS timesharing system prefers this amount.
2022-10-14 10:53:42 +02:00
Paul Koning
253b8ec358 PDP11: Fix PC breakpoint check
Don't modify the CPU state when checking for physical address match on
PC address breakpoints.  Reported and verified by Lars.
2022-10-10 13:38:09 -04:00
Mark Pizzolato
21e3c56fa4 PDP11, Qbus & Unibus VAX: Use proper REG macros for arrays and structures
Registers in the DMC, RQ and TQ devices were improperly described
2022-09-21 08:46:23 -07:00
Trevor Warwick
24260f0613 QBus VAX and PDP11: Add support for HDLC framing to DUP11/DPV11
Fix minor formatting glitches and remove unused variable.
2022-08-04 16:46:56 +01:00
Trevor Warwick
1ab955be30 QBus VAX and PDP11: Add support for HDLC framing to DUP11/DPV11
This commit extends the existing DUP11/DPV11 support to add support for HDLC framing. There
is no requirement to support bit/byte stuffing, so the aim is simply to encapsulate/decapsulate
the datalink frame provided by the host driver.

DDCMP has been regression tested on VMS, RSX and TOPS20, and the HDLC mode was developed
and tested with VAX/VMS DECnet Phase V, only using the HDLC datalink implementation.

In theory this support is sufficient to allow Phase IV/V P.S.I and even VMS/SNA to be used,
but these remain to be demonstrated.
2022-08-03 10:38:17 +01:00
Louis Chrétien
58809e35b4 PDP11: Cleanup help language in TC and DAZ devices 2022-07-26 07:30:55 -10:00
John Dundas
9890acc11c PDP11, VAXen: Fix to VH device to properly reference the line number
- Correct RBUF_GETLINE & RBUF_PUTLINE: these are both sensitive to
  modeling DHU vs. DHV; the correct bit mask was not generated for DHU.
- Make certain the device presents 16 lines when modeling a DHU.
2022-07-24 18:03:49 -07:00
Bob Supnik
28fd79ef06 All LP and CD devices: Removed use of ftell for pipe compatibility
Merge changes from v3.12-2
2022-06-16 16:13:46 -07:00
Bob Supnik
8d49d8c297 All Tape DEVICES: Added extra case points for new MTSE definitions
Merge changes from v3.12-2
2022-06-16 16:13:46 -07:00
Trevor Warwick
2a38dd802b QBus VAX and PDP11: Add support for DPV11 in DDCMP mode
This commit extends the existing DUP11 support to add simulation for a DPV11 in DDCMP mode.

It has been tested with DECnet-VAX Phase V, which has the only host driver I know of. Note
that you may see a few CRC errors logged with high traffic levels, these are due to a couple of
bugs in the VMS driver, for which I'm looking at developing a patch.

Regression testing has been done on the DUP11 on VMS, RSX and TOPS20, which all seemed to work
as well as previously.
2022-06-14 18:32:12 +01:00
Trevor Warwick
6e0e5a714d PDP11 & Unibus VAX, PDP10: Fix DUP device support for use by internal KMC for TOPS-20
This fixes a regression caused by commit b41acb3
2022-06-07 17:16:21 +01:00
Trevor Warwick
775e2f1f79 PDP11, Qbus & Unibus VAX: Fix DUP device loopback on device reset
- When the DUP TXCSR DEVICE_RESET bit is set, which clears the MAISEL bits, any
existing tmxr loopback must also be removed.
2022-05-18 16:38:10 +01:00