It's not RSX, which changes the line numbers but Pi!
When you have multiple USB UARTs plugged in (which then go out via
MAX232 to the actual serial lines and your terminals), Pi enumerates
them randomly (in random order!). So, for example I have two physical
terminals connected this way, and one bootup the first one is
/dev/ttyUSB0 and the second one is /dev/ttyUSB1 (and in RSX they are
TT3 and TT4, respectively), but once you reboot that can
switch and /dev/ttyUSB0 gets assigned to the second line, and
/dev/ttyUSB1 to the first, so the terminals in RSX also trade places
(since your attach command does not change from boot to boot). But
you can enforce Pi to use a stricter order, only not with the
/dev/ttyUSBx devices, but with creating links at bootup, and using
those in your attach command (instead of /dev/ttyUSBx).
1. Look through "dmesg" output on your Pi and locate lines which look
something like "usb 1-1.2.2" and "usb 1-1.3", these are your
device enumeration progress. In my case, I see the end UART devices like so:
usb 1-1.3: Product: CP2102 USB to UART Bridge Controller
usb 1-1.1.2: Product: CP2102 USB to UART Bridge Controller
Take a note of the 1-1.x.x prefixes (also note that they can have
different nesting depth, that's normal).
2. In /etc/udev/rules.d create a file named "10-usb-serial.rules" with
contents like so:
--CUT HERE--
KERNEL=="ttyUSB*", SUBSYSTEMS=="usb", KERNELS=="1-1.3", SYMLINK="ttyS1"
KERNEL=="ttyUSB*", SUBSYSTEMS=="usb", KERNELS=="1-1.1.2", SYMLINK="ttyS2"
--CUT HERE--
That will create the /dev/ttyS1 and /dev/ttyS2 links in the /dev
directory to _always_ follow the USB enumerator as found on the bus
(Pi is free to choose /dev/ttyUSBn randomly, meanwhile). Note that I
already have /dev/ttyS0 for the Pi native console, so I chose
to use 1 and 2 for these additional serial lines. You can use other
(e.g. higher) numbers -- that's not critical.
$ ls -l /dev/ttyS*
crw--w---- 1 root tty 4, 64 Jun 2 20:21 /dev/ttyS0
lrwxrwxrwx 1 root root 7 Jun 2 20:21 /dev/ttyS1 -> ttyUSB0
lrwxrwxrwx 1 root root 7 Jun 2 20:21 /dev/ttyS2 -> ttyUSB1
(note that targets for the symlinks can swap next time you reboot, but
the actual devices, S1 and S2, will always be in order and to
correspond to your 1st and 2nd terminal, respectively).
3. Edit your RSX11's (or whatever system you're using) boot.ini to
refer to the /dev/ttySx devices instead of /dev/ttyUSBx, like so:
attach -AV dz 10001,line=0,nomodem,connect=/dev/ttyS1,line=1,nomodem,connect=/dev/ttyS2
This makes RSX to always have TT3 for my first terminal and TT4 for
the second (like they are connected to the Pi).
Now, simh actually _knows_ which speed to use for your DZ lines (it's
9600 by default) but the version of simh packed for
PiDP11 has a bug that computes the rate delay twice (it's a delayed
delay, which is why it's closer to 1200 rather than 9600
when it starts)! When you reset the terminal speeds, it resets it
back to order.
I messed up the speed reset RSX(MCR) commands while typing my response
earlier (from the top of my head). They should have been:
> SET /SPEED=TT3:300:300
> SET /SPEED=TT3:9600:9600
(and the same for TT4, if necessary, and so on).
The above works for me and my old terminals and terminal servers
connected to Pi (in RSX).
Also, I might be behind the curve with the RaspiOS upgrades, and the
procedure for the current OS might be different (for "udev") -- that I
wouldn't know,
unfortunately. Way back in my university days, my CS professor used
to say, don't try to fix something if that ain't broken ;-) The words
of wisdom.
So, I keep using whatever I installed when I built my PiDP11 ;-)
Hope this helps.
> To view this discussion visit
https://groups.google.com/d/msgid/pidp-11/93f3fee7-b01e-48c1-96ac-95e59ef363e8%40softjar.se.