PDP-10 / its

Incompatible Timesharing System
Other
868 stars 84 forks source link

simh_imlac crashes during :imprint #2187

Open bilegeek opened 1 year ago

bilegeek commented 1 year ago

On branch 78ae976:

(Note: I'm running with "./tools/sim-h/BIN/./imlac ./build/pdp10-ka/imlac.simh" in base directory on my Linux system; otherwise I have to reboot EVERYTHING when it crashes, plus no access to simh console.)

:cwd -pics-

:imprint 10 pic --- works, as does "girl pic", "foobar pic", "sload pic" and some others :imprint 3d pic --- prints "HALT instruction, PC: 00013 (HLT )" on the simh_imlac console; :imprint a plot --- same error as 3d pic :imprint trek pic --- same HALT, crashes drawing right nacelle of the Enterprise

Also: not sure if I should report issue here or at https://github.com/simh/simh.

larsbrinkhoff commented 1 year ago

Thanks! This this is a problem with the Imlac emulator, so should be reported to https://github.com/open-simh/simh

bilegeek commented 1 year ago

I finally got around to filing this bug under https://github.com/open-simh/simh/issues/216, so I'm closing it here.

larsbrinkhoff commented 1 year ago

On closer examination, it's not an emulator bug, but a bug in SSV22.

larsbrinkhoff commented 1 year ago

The bitter truth here is that, no matter what bugs are fixed, the Imlac display buffer is just not big enough to hold the larger of those -PICS- files. CBUF is 5661 initially. Those files that are larger than that will fail.

However, some of the files you listed as causing a crash is smaller than that number, so that's worth looking into.

bilegeek commented 1 year ago

More observations:

Out of curiosity, I decided to test a bunch on the tek4010 emulator (via "./tek4010 -noexit -ARDS cat ../../bin/-pics-/whatever") and all of the crashy ones work including the largest ones, so maybe the larger files were meant for a Tektronix or even a PDS-4 (if that model had more RAM, not much info out there aside from it being faster).

Not all of them work properly in tek4010 though; for instance "wumpus pic" and "a plot" have alignment issues. So maybe either those were made specifically for Imlacs, or ITS is sending the information differently? (I can't figure out how to display a picture on the Tektronix from ITS, so I can't test; any command you know?)

The foobar pic in -pics- seems to be missing five carriage returns, since the foobar.pic in "its/tools/tek4010/ardsfiles/" aligns properly, while the one in -pics- doesn't and seems to be identical aside from missing five bytes; hence my suspicion, since there's five lines of text. The -pics- version without said carriage returns does display properly via :imprint on the Imlac, so maybe SSV22 is more lenient about carriage returns?

The fft files don't display properly on the Tektronix, but do on the Imlac; but "pco config" doesn't display properly on the Imlac but apparently does on the Tektronix! (or at least only has some alignment issues and missing boxes around "dskc" and "FNP A")

larsbrinkhoff commented 1 year ago

You should use the same :IMPRINT command to display pictures. It works the same whether the destination is an Imlac, Tektronix, or ARDS display. Note that Tektronix uses different commands; the -ARDS switch is used to emulate an ARDS terminal.

There's a gotcha when it comes to the ITS files. When stored on a modern computer, they are encoded in a way that translates "CR LR" line endings to plain Unix "LF" line endings. A single "CR" becomes 215 (octal). There are also other transformations. This works well for ordinary text files, but has complications for binary data such as these pictures.

This has come up before, and as I recall, I believe the problems are fixed if you first translate from the ITS encoding to a plain 1:1 mapping to 7-bit ASCII. This can be done with the cat10 -Wits -Xascii command from the tools/dasm directory (e.g. pdp10-its-disassembler).

bilegeek commented 1 year ago

Thanks for the info on CR LR. Using :imprint, it seems like (almost) everything is now working on the Tek when using -ARDS. Only exceptions AFAIK are "phant pic", which is blank, and "foobar pic", which fails to draw most of the... "foo bar" itself.

So there's no way to draw the pics on a non -ARDS tek4010?

On a related tangent, I only just now stumbled across https://github.com/PDP-10/its/pull/1020, and :supard works PERFECTLY on the Knight TV, zero issues. Even "[pic] 42" is drawing correctly it seems, no separation of drawing the cube and "slinky".

larsbrinkhoff commented 1 year ago

That's strange. Since FOOBAR PIC displays fine when viewing the file directly, it should be ok when viewing from ITS too. I don't know why. I tested connecting with netcat in case telnet does something to the data, but it was the same.

larsbrinkhoff commented 1 year ago

I was hopeful this code snipped found in SSV38 would fix the problem, but I tried and it didn't.

        DAC 11                  ; set put pointer
        SUB CURPNT
        DAC MLOOP
SMULCH: LAC @10                 ; moves register 10 through the character list
        ISZ MLOOP               ; ran out of characters?
        JMP SMUL1               ; no
; here there are less than 10 lines before gap
        LAC LNCNT
        SUB [10.]
        ASP
        JMP SMULCK
SMDOWN: JMS DNAR                ; move down some so there will be ten at least
        LAC LNPOS
        SAM LNCNT
        JMP .+2
        JMP SMULCK
        ISZ LOOP
        JMP SMDOWN
        JMP XEROX

SMULCK: JMS CLRS
        JMP @BUFCK