open-simh / simh

The Open SIMH simulators package
https://opensimh.org/
Other
476 stars 89 forks source link

Strange behavior of the DZ device #30

Open louis-chretien opened 2 years ago

louis-chretien commented 2 years ago

According to documentation, the DZ device should allow 4 units, for a maximum of 32 lines.

But if you run a config, you can do:

set DZ enable set DZ lines=128

with no problems!

looking into the code, i found this line close to the top of the file pdp11_dz.c:

define MAX_DZ_MUXES 32

I believe the maximum should be 4, or the documentation in the .doc file needs to be changed... ;)

I have trouble imagining someone attaching 32 DZ-11 boards on a PDP-11 for 256 lines...

markpizz commented 2 years ago

See the output of HELP DZ for the most up to date/correct info. HELP is precisely derived from information in the code and thus will be most accurate. The documents don't always get updated when the code changes.

I have trouble imagining someone attaching 32 DZ-11 boards on a PDP-11 for 256 lines...

Someone once asked for more lines. We charge the same amount for 32 or 128 lines. :-)

louis-chretien commented 2 years ago

I stand corrected!

I tried a "test config" of RSTS/E with 64 lines, and when the system booted into INIT, here was the display:

RSTS V10.1-L RSTS (DR0) INIT V10.1-0L

Today's date? 6-JUL-22

Current time? 15:56

Start timesharing? NO

Option: HA LI

Name Address Vector Comments TT0: 177560 060
RR0: 176700 254 BAE=+050, Units: 0(RM03) 1(RM03) 2(RM03) 3(RM03) RU0: 172150 P400 RQDX3 Units: 0(RD54) 1(RD54) 2(RD54) 3(RX50) TS0: 172520 224 Units: 0(TS11) LP0: 177514 200 DZ0: 160100 300 Sub-lines: 8 DZ1: 160110 310 Sub-lines: 8 DZ2: 160120 320 Sub-lines: 8 DZ3: 160130 330 Sub-lines: 8 DZ4: 160140 340 Sub-lines: 8 DZ5: 160150 350 Sub-lines: 8 DZ6: 160160 360 Sub-lines: 8 DZ7: 160170 370 Sub-lines: 8 XE0: 174510 120 DELUA Address: 08-00-2B-D2-E1-FB

KW11L 177546 100 SR 177570 DR 177570

Hertz = 60.

Other: FPU, SL, 22-Bit, Data space, Cache w/address, System ID = 4660

So it seems that RSTS/E would have been very happy with 8 boards and 64 lines.

louis-chretien commented 2 years ago

One further test:

I went overboard and configured 256 lines (the maximum for 32 muxes @ 8 lines each)

Seems RSTS/E has an upper limit on the number of DZ muxes:

sim> set dz lines=256 sim> boot rp0

RSTS V10.1-L RSTS (DR0) INIT V10.1-0L

Today's date? 6-JUL-22

Current time? 16:00

Start timesharing? NO

Option: HA LI

Name Address Vector Comments TT0: 177560 060
RR0: 176700 254 BAE=+050, Units: 0(RM03) 1(RM03) 2(RM03) 3(RM03) RU0: 172150 P500 RQDX3 Units: 0(RD54) 1(RD54) 2(RD54) 3(RX50) TS0: 172520 224 Units: 0(TS11) LP0: 177514 200 DZ0: 160100 300 Sub-lines: 8 DZ1: 160110 310 Sub-lines: 8 DZ2: 160120 320 Sub-lines: 8 DZ3: 160130 330 Sub-lines: 8 DZ4: 160140 340 Sub-lines: 8 DZ5: 160150 350 Sub-lines: 8 DZ6: 160160 360 Sub-lines: 8 DZ7: 160170 370 Sub-lines: 8 DZ8: 160200 400 Sub-lines: 8 DZ9: 160210 410 Sub-lines: 8 DZ10: 160220 420 Sub-lines: 8 DZ11: 160230 430 Sub-lines: 8 DZ12: 160240 440 Sub-lines: 8 DZ13: 160250 450 Sub-lines: 8 DZ14: 160260 460 Sub-lines: 8 DZ15: 160270 470 Sub-lines: 8 XE0: 174510 120 DELUA Address: 08-00-2B-D2-E1-FB

KW11L 177546 100 SR 177570 DR 177570

Hertz = 60.

Other: FPU, SL, 22-Bit, Data space, Cache w/address, System ID = 4660

so i guess a more reasonable limit would probably be 16 muxes. What about other OS?

pkoning2 commented 2 years ago

rsts-devices.txt For what it's worth, attached is an extract from the RSTS V10.1 sources showing the table of devices INIT recognizes. The interesting items for this discussion are the second column -- the max controller count -- and the next to last column (SUBL, which is the max number of lines or units per controller). Also interesting is the 4th column, which is 0 for float addresses or the first controller address for fixed ones. Note that not everything listed here is supported by RSTS, but if it's in here it will recognize if it seen on the bus.
So as you can see, RSTS recognizes up to 16 DH-11, DZ-11, or DHV/DHU-11 controllers. Even, in theory, all of those together. Then again, the OS code is limited to 127 terminal lines total, so while it would recognize 16 DHU interfaces that will not give you 256 lines.

louis-chretien commented 2 years ago

You're right. I booted my "monster" config of 256 lines to timesharing, and when i did a "show devices", it stopped at 127 KB devices, so that DZ15: only had about 4 lines used, because of the 4 DL-11 i had and 4 Pseudo keyboards

louis-chretien commented 2 years ago

one other thing:

why is it that when i configure 48 lines on a VH device, i see three units (VH0, VH1 and VH2) in a show config display, but if i do the same on the DZ, i only see a single device that says 48 lines?

markpizz commented 2 years ago

The author who wrote the original version of the VH device decided to provide different configurable options for each of the controllers (SET VHx {DHV|DHU|FASTDMA|NORMAL|MODEM|NOMODEM|HANGUP|NOHANGUP}).

The author of the original DZ device didn't decide to separate options for each controller implemented by the DZ device.

louis-chretien commented 2 years ago

I followed your suggestion, and started a SIMH PDP-11 without any config file.

Here's what i get:


admin@MBP-15-Louis simh % BIN/pdp11

PDP-11 simulator V4.0-0 Current git commit id: e1ce9f4f+uncommitted-changes sim> set cpu 11/70 Disabling XQ sim> show dz DZ address=17760100-17760117, vector=300-314, BR5, lines=16 not attached, 8b sim> help dz DZ11 Terminal Multiplexer (DZ)

The DZ11 is a 8 line terminal multiplexor. Up to 32 DZ11's (256 lines) are supported. The default number of lines is 32. The number of lines can be changed with the command


The show dz command says 16 lines, but the help dz indicates a default of 32.

Am i missing something?

markpizz commented 2 years ago

As you magically change the simulator from a Qbus machine (11/73) to an Unibus machine (11/70) the number of DZ devices changes (while the number of lines doesn't).

When the simulator starts (as a Qbus machine), there are 4 DZV11 muxes that make up the initial 16 lines. When you change the system from a Qbus machine to a Unibus machine the number of lines doesn't change but the number of muxes needed to provide that many lines does. What is emitted in the help as the default is the default number of muxes * the lines per mux.

If you were to use a simulator which didn't provide a means to dynamically change the bus type (the VAX or VAX780 for example) you would see less confusing results.

PLEASE Don't worry about this. The world will not be ending due to this discrepancy.

pkoning2 commented 2 years ago

So it's a small documentation bug. It seems to be more accurate to say that by default there are 4 controllers, meaning either 16 or 32 lines depending on the bus type.

markpizz commented 2 years ago

The number of controllers is determined by the bus type AND the number of lines. The lines is changeable by a user.

The PDP11 system starts out as a Qbus system and with 4 controllers active with 4 line controllers means the initial default lines is 16.

Once the number of lines are set (initially) they are only changed by a user explicitly saying SET DZ LINES=n. Changing the number of lines changes the number of controllers. Changing the bus type DOES NOT change the number of lines, but causes the number of controllers to be adjusted to reflect the capability of the number of lines per controller on that bus.

It seems to be more accurate to say that by default there are 4 controllers, meaning either 16 or 32 lines depending on the bus type.

Well that statement is precisely true for the systems without changeable bus types, but it implies that changing the bus type changes the number of lines which it doesn't!

In the https://github.com/simh/simh repo, the doc/pdp11_doc.doc file describes this more clearly along with the fact that the DZ simulates DZ11's or DZV11's depending on bus type. The doc/vax_doc.doc described DZV11 since that system doesn't change bus types. The doc/vax780_doc.c describes the DZ11 since that system doesn't change bus types.

louis-chretien commented 2 years ago

I've played with both the vax and vax780 simulators, and you statement is correct:

The vax simulator has a QBUS and 16 lines, and both the "SHOW DZ" and "HELP DZ" give the correct information. The vax780 simulator has a Unibus and 32 lines, and both the "SHOW DZ" and "HELP DZ" give the correct information.

The problem is the pdp11 simulator.

When switching from the 11/73 (QBus) to the 11/70 (Unibus), you correctly pointed out the number of lines doesn't change. But because the help systems makes the following calculation in the help text:

DZ_LINES*DZ_MUXES

it ends up showing 32 as the default in "HELP DZ" as opposed to 16 for a "SHOW DZ", when the CPU type is 11/70.

But i had an idea: when you do a SET CPU command, SIMH calls the cpu_set_bus function in pdp11_cpumod.c. It makes sure that QBUS devices are disabled (like the XQ controler) when switching to Unibus.

Why not take the opportunity to adjust the number of lines there, switching from QBus to Unibus (or vice-versa)? That way, both the "SHOW DZ" and "HELP DZ" commands would be in sync and coherent with the bus architecture of the machine.

Since the intended default is for 4 controllers, giving 16 lines on the 11/73, why not make it so that the Unibus systems get 32?

BTW, i looked at your pdp11_doc.doc, and paragraph 1 and 2 of the DZ11 section contradict themselves.


The DZ11 is an 8-line terminal multiplexer, the DZV11 is a 4 line terminal multiplexer. Up to 16 DZ11/DZV11's are supported. The number of lines can be changed with the command

SET DZ LINES=n          set line count to n

The line count must be a multiple of 4 on Qbus and 8 on Unibus, with a maximum of 32 controllers (128 lines on Qbus and 256 lines on Unibus).


I believe the first paragraph should say 32 controllers, not 16.

louis-chretien commented 2 years ago

Hmmm, i just realized that my "brilliant" idea of using the cpu_set_bus function has a problem:

If the user adjusted the number of lines on the DZ first, and the switched CPU model, the code i was thinking of would obliterate the change made previously...

It seems that the device would have to have a "dirty" bit:, if any changes have been made to options, the cpu_set_bus function should not modify the number of lines if the dirty bit is on.