PDP-10 / klh10

Community maintained version of Kenneth L. Harrenstien's PDP-10 emulator.
Other
59 stars 7 forks source link

Problems running klh10 under MacOS "High Sierra" (dpni20 related) #25

Closed jguillaumes closed 6 years ago

jguillaumes commented 6 years ago

Hello,

I've found a couple of problems:

System restarting, wait...
Date and time is: Thursday, 16-November-2017 4:16AM
Why reload? cm
Run CHECKD? 
 (Y OR N) n
 DDMP: Started
[KNILDR: Loading microcode version 1(172) into Ethernet channel 0]

[dpni20: Warning - cannot lock memory]

[dpni20: Can't open VDE device "/tmp/vde" - No such file or directory]
[dpni20: ifc "/tmp/vde" => ether f2:b:a4:d:81:90]
[dpni20:   VHOST 0.0.0.0]

The boot sequence continues but the simulator hangs and it has to be killed.

/tmp/vde exists and it is under vde control:

MacJordi:~ jguillaumes$ ls -ld /tmp/vde
drwxrwxrwx  3 jguillaumes  wheel  96 Nov 16 13:16 /tmp/vde

The dpni20 program is set said:

MacJordi:~ jguillaumes$ ls -l /usr/local/bin/dpni20
-rwsr-sr-x  1 root  staff  47328 Nov 16 13:00 /usr/local/bin/dpni20

And this are the contents of my INI file:

; Define basic device config - one DTE, one disk, one tape
devdef dte0 200   dte   master
devdef rh0  540   rh20
devdef rh1  544   rh20
devdef dsk0 rh0.0 rp    type=rp07 format=dbd9 dppath=/usr/local/bin/dprpxx
devdef mta0 rh1.0 tm03  type=tu45

; Set Ethernet address
devdef ni0 564 ni20 dedic=true ifmeth=vde decnet=true ifc=/tmp/vde dppath=/usr/local/bin/dpni20

; Define the idle device on 700
devdef idler 700 host

; Set switch register
set sw=254200,,147

; Set console lights I/O base register
;Uncomment the following line if you have a Panda display.
;lights 378

; Load disk bootstrap directly
load boot.sav

; Ready to GO
larsbrinkhoff commented 6 years ago

I don't remember, does locking memory work better if you run as root?

jguillaumes commented 6 years ago

Just toke a look at that.

Memory locking is not implemented in MacOS, so that message is expected and normal.

Rhialto commented 6 years ago

Regarding the VDE issue: You can follow along in issue #2 how that came to klh10. Basically I only compile-tested it in a slow vm that was only setup for compiling and nothing more. The amount of code for it is rather trivial, though. Basically only lines 2286...2337 in src/osdnet.c are VDE-only. Anything that goes wrong there is either trivial (permissions or something) or unfixable-serious

jguillaumes commented 6 years ago

Hello, I've found the problem. When using VDE the "interface name" is actually a filesystem path, which can be longer than the 16 characters used as limit for the "regular" interfaces. In OSX the /tmp directory, used usually to put the vde sockets, is really a symlink to /private/tmp, so "/tmp/vde.ctl" is truncated to "/private/tmp/vd".

I've hacked a quick (and quite dirty) patch to fix the problem. Unfortunately it looks like the xCode editor has scrambled part of the format, so there is more stuff in the path that it should be.

To cut the story short, I've added an "alternate name" field to the dpni20_s struct, wich can be as long as MAX_PATH, and the logic to select the appropiate name when using IFMETH=vde. The logging messages still use the truncated version, but that is just an esthetic problem.

vdename_diff.txt

larsbrinkhoff commented 6 years ago

Good! So we can close this?

jguillaumes commented 6 years ago

Once https://github.com/PDP-10/klh10/pull/27 gets merged it will be ok to close.

jguillaumes commented 6 years ago

I'm closing the issue, since the problem was fixed in commit 9d13c2b5e55916c0ec69d3435fcb63f01fb70bab