PDP-10 / klh10

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

TOPS-10 boot failure on Raspberry Pi 2 #31

Closed JohnForecast closed 2 years ago

JohnForecast commented 6 years ago

I've built kn10-kl on the latest Stretch version of Raspbian (2018-3-13) for a Raspberry Pi 2. It works perfectly running TOPS-20 but when I try to boot TOPS-10 I get the following error loading the boot loader:

KLH10 2.0k-Rhialto (MyKL) built Mar 22 2018 20:45:27 Copyright ? 2002 Kenneth L. Harrenstien -- All Rights Reserved. This program comes "AS IS" with ABSOLUTELY NO WARRANTY.

Compiled for unknown-linux-gnueabihf on armv7l with word model USEINT Emulated config: CPU: KL10-extend SYS: T20 Pager: KL APRID: 3600 Memory: 8192 pages of 512 words (SHARED) Time interval: INTRP Base: OSGET Interval default: 60Hz Internal clock: OSINT Other: MCA25 CIRC JPC DEBUG PCCACHE CTYINT EVHINT Devices: DTE RH20 RPXX(DP) TM03(DP) NI20(DP) [MEM: Allocating 8192 pages shared memory, clearing...done]

KLH10# ; KLH10 configuration for TOPS-10 test system KLH10# KLH10# ; DTE requires ackdly to avoid T10 race condition KLH10# devdef dte0 200 dte master ackdly=5 KLH10# devdef rh0 540 rh20 KLH10# devdef rh1 544 rh20 KLH10# devdef dsk0 rh0.0 rp dppath=/usr/local/bin/dprpxx type=rp06 sn=4747 format=dbd9 path=T10-RP06.0-dbd9 KLH10# devdef dsk1 rh0.1 rp dppath=/usr/local/bin/dprpxx type=rp06 sn=1026 format=dbd9 path=T10-RP06.1-dbd9 KLH10# devdef mta0 rh1.0 tm03 dppath=/usr/local/bin/dptm03 type=TU77 KLH10# KLH10# ; NI: param "c3dly" to avoid T10 race. KLH10# ; NI: param "rdtmo" to avoid system hangups with OSF/1 V3.0 KLH10# ; KLH10# ; Decnet node TWONKY, 9.429 KLH10# devdef ni0 564 ni20 dppath=/usr/local/bin/dpni20 dedic=true ifmeth=tap+bridge ifc=tap1 decnet=1 doarp=0 enaddr=aa:00:04:00:1c:fc dpdelay=12 c3dly=2 rdtmo=3 KLH10# KLH10# load klboot.exe Using word format "c36"... Loading aborted, read failed for file page 1, proc page 0 Loading aborted, read failed for file page 2, proc page 448 Loading aborted, read failed for file page 4, proc page 451 Loaded "klboot.exe": Format: DEC-PEXE Data: 0, Symwds: 0, Low: 01000000, High: 0, Startaddress: 0 Entvec: 0 wds at 0 KLH10# [EOF on klt10.ini]

larsbrinkhoff commented 6 years ago

It looks like KLH10 didn't quite like the format of your klboot.exe file. "Loading aborted" doesn't look good, and for sure Data, Low, High, Startaddress, etc is wrong.

Some guesses:

larsbrinkhoff commented 6 years ago

I'm not a TOPS-10 user myself, so I can't offer much more. If you find someone else using KLH10 to run TOPS-10, they might be able to help.

There's also SIMH that can run the KS10 version of TOPS-10.

JohnForecast commented 6 years ago

I just compared klboot.exe with an older version of the klh10 distribution (2.0h, I think) and there's no difference. Maybe I'll build a debug version and see what's happening.

I've been using SIMH for running TOPS-10 but I had an issue get the DZ-11 configured correctly (now solved) and was hoping to move to KLH10 so I could use LAT terminals.

Rhialto commented 6 years ago

Did you try it on another cpu architecture? Maybe that makes the difference. I have not knowingly modified anything in loading files, just mainly networking stuff.

JohnForecast commented 6 years ago

I built it on MacOS Sierra and there we no problems loading klboot.exe. It does seem to be architecture dependent - I'm building a debug version to see if I can get more information.

jguillaumes commented 6 years ago

El 6 abr 2018, a les 19:44, JohnForecast notifications@github.com va escriure:

I built it on MacOS Sierra and there we no problems loading klboot.exe. It does seem to be architecture dependent - I'm building a debug version to see if I can get more information.

This sounds familiar to me...

Try building the simulator without compiler optimizations (you’ll need to hack the makefile a little bit).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

JohnForecast commented 6 years ago

I tried building with optimizations, it got rid of the error messages but nothing was loaded into memory. I even tried building with clang but the same problem. It almost seems as if there's some memory corruption happening. If I just try to load "klboot.exe", I get the error messages as before. If I enable tracing of the load process, I get the following output:

KLH10# set ld_debug=1 ld_debug: Off => On KLH10# load klboot.exe Using word format "c36"... DIR section = 012 wds No entvec block, word: 01777,,01 Page 01: file page 0 (n=1.) Page 02: file page 0700 (n=2.) Page 0702: clear Page 04: file page 0703 (n=43.) Page 0756: clear Loaded "klboot.exe": Format: DEC-PEXE Data: 0, Symwds: 0, Low: 01000000, High: 0, Startaddress: 0 Entvec: 0 wds at 0

Nothing was loaded but where did the error messages go?

JohnForecast commented 6 years ago

I have an old 2.0h version of KLH10 that I modified to run on the original Raspberry Pi back in 2014. I just built it on the same system where I was having the boot problems - it is able to load "klboot.exe" successfully. If it's of any use, I can make a tar file available along with notes I made at the time about the changes that were required.

JohnForecast commented 6 years ago

I've tracked down the problem. There was a difference between sizeof(wfoff_t) in wfio.c (8) and feload.c (4) which results in wf_seek() failing silently. The TOPS-20 boot loading code never calls wf_seek() so this problem never showed up.

The core problem is that the system include files typedef off_t as "long" unless _FILE_OFFSET_BITS == 64 in which case it will be defined as "long long". The simplest fix is to make sure that cenv.h is included first in all source files - it works OK in my Raspberry Pi environment but I haven't tested any other environment.

larsbrinkhoff commented 6 years ago

That's great! Would you like to submit a pull request?

Rhialto commented 6 years ago

Good catch! In my view, everything in cenv.h is a candidate for the configure script. I just hadn't gotten around to it any further...

robmayes69 commented 2 years ago

Does anyone know if this issue is resolved in recent builds as I'm getting HALT messages when using a Raspberry Pi compile of SimH4.

larsbrinkhoff commented 2 years ago

@robmayes69, I don't think this was fixed.

JohnForecast commented 2 years ago

The change referenced above was to the KLH10 emulator which has nothing to do with SimH4. I just checked and this change is still present in the KLH10 repository.

Rhialto commented 2 years ago

I was about to create a merge request based on https://github.com/PDP-10/klh10/issues/31#issuecomment-379594901 but both files (wfio.c and feload.c) already #include "cenv.h". It's also included from "klh10.h" which is included from lots of other files. The only files that don't include either of those are, if I filtered correctly,

osdnet.c
prmstr.c
tapedd.c
udlconv.c
uexbconv.c
wfconv.c
wxtest.c
Rhialto commented 2 years ago

So I went through all files and made sure that each of them include either cenv.h or klh10.h as the very first include. See MR #62.

In fact I would like to get rid of the whole cenv.h file altogether. The one or two items that may still be relevant (and as far as I can see that is only Long File Support and termios vs. BSD tty) should be put into the configure script. Everything then only needs to #include "config.h" as first.

There is also still #59 which cleans up stuff from the old build system that likely doesn't work any more. If nobody can convince me to keep it, it will go soon.