PDP-10 / its

Incompatible Timesharing System
Other
850 stars 80 forks source link

340 display support #644

Closed larsbrinkhoff closed 5 years ago

larsbrinkhoff commented 6 years ago

Notes for helping @philbudne adding 340 display support to the KA10 simulator, for use with ITS.

ITS applications that are checked and working:

larsbrinkhoff commented 6 years ago

Get @rcornwell's KA10 simulator: http://github.com/rcornwell/sims. The tape support is in flux. At this moment the best bet is to edit the penultimate line in mt_srv to sim_activate(uptr, 800);. Then make ka10.

larsbrinkhoff commented 6 years ago

Get the ka10 branch from http://github.com/PDP-10/its. For now, the its repository and the sims repository need to sit side by side.

Also get the subrepositories. Either git clone --recursive, or git submodule update --init.

To build ITS from scratch, type make all. This will not work yet. Also, just loading all source files from tape takes around 15 minutes.

I have put prebuilt disk images online.

larsbrinkhoff commented 6 years ago

To assemble ITS with 340 support, edit SYSTEM; CONFIG >. Go to the section for ML and add DEFOPT 340P==1. Assemble ITS for ML. Do the dumping thing in DSKDMP or timesharing DDT.

larsbrinkhoff commented 6 years ago

At this point TECO, and by extension EMACS, doesn't work which makes it hard to do work inside ITS.

larsbrinkhoff commented 6 years ago

Dumping ITS in DSKDMP:

L$ddt
T$its bin
$U
M$salv bin
D$nits

Dumping ITS in timesharing DDT:

its$J
$1L .; @ ddt
$$1L .; salv bin
$$L .; its bin
$Y .; @ nits
:kill

File names may differ.

larsbrinkhoff commented 6 years ago

To boot ITS, start sims/BIN/ka10 and pass it a suitable configuration file such as its/build/ka/boot.

The simulator will boot into DSKDMP. Type its and Enter. (Or nits if you dumped to that file name.) Then $G to start.

rmaldersoniii commented 6 years ago

Lars wrote : At this point TECO, and by extension EMACS, doesn't work which makes it hard to do work inside ITS.

I don't understand the context for this remark. I have been using EMACS on the kn10-ks-its variant of ITS for several weeks (although currently I'm not working on ITS at all). What seems to be the issue, Lars?

larsbrinkhoff commented 6 years ago

Yes @rmaldersoniii, there's a lot of context missing.

I wrote these comments to help Phil get started adding 340 display support for use with ITS. But it's not the stock SIMH, but @rcornwell's KA10 version which is in development.

We have tried to build TECO on this KA10 simulator, but TECO craches when started.

larsbrinkhoff commented 6 years ago

Here are prebuilt KA ITS image files:
http://lars.nocrew.org/its/budd/

larsbrinkhoff commented 6 years ago

There is some problem when purifying jobs, and/or purified PDUMP files. So stay away from that.

I build TECO without purification, and it seems to work.

larsbrinkhoff commented 6 years ago

Sorry, I was wrong about EMACS. Jumped to conclusions.

EMACS does work in the KA ITS image.

larsbrinkhoff commented 6 years ago

I made some mistakes building the KA ITS disk images. Some files were for KS ITS.

I have now updated the images. I tested building ITS with 340P enabled, and at least it boots.

larsbrinkhoff commented 6 years ago

By the way, it might be more convenient to put the binaries in an ITS disk image, rather than paper tape. At least if there's a need to edit and build programs. Anything that goes into the . directory and has @ as first file name is easy to start from DSKDMP which can be booted off paper tape.

larsbrinkhoff commented 6 years ago

@philbudne I can't hold off my questions anymore...

I'm so curious to test this! Is there anything available?

Did you get NTS DDT to do anything useful with the display? Have you tested anything other than Spacewar?

philbudne commented 6 years ago

I didn't get anywhere with exec DDT built for display (kept outputting spaces and/or newlines on the TTY console), and I switched to stand-alone spcwar.rim when you built it for me, and haven't gone back to ITS yet.

I've just forked the sims repo and pushed the cleaned up to branch mit340 of https://github.com/philbudne/sims

Hopefully I've gotten the spacewar switches sorted out. I finally gave in and straightened it out doing using an idiom common in PDP-10 programming, translated to C. See spacewar_switches in display/display.h

rcornwell commented 6 years ago

Code looks pretty good. I can copy the display directory and update the SCP tree if you want.

larsbrinkhoff commented 6 years ago

Cool, thanks! To build it, I added TYPE340=y to the make command line.

philbudne commented 6 years ago

I can submit a PR if that makes it easier...

phil

rcornwell commented 6 years ago

I am trying to keep changes to SCP and my sim separate. When the simulator is ready to move to the main simH tree, I will run a git command to extract all the changes for the KA10 tree and apply them to a branch on SimH, then Mark will merge it up. Remember no tabs and dos format files.

When you are happy with the changes, you can move them to the master branch and submit a pull request.

rcornwell commented 6 years ago

I pushed out a new version of my sims tree with display added. Please redo your pull request with latest version. Also all commit messages MUST start with KA10:!

larsbrinkhoff commented 6 years ago

@philbudne Are you doing anything more with the 340? Or do you consider this done?

I will test some more applications, both standalone and timesharing.

philbudne commented 6 years ago

Are you doning anything more with the 340? Or do you consider this done? I will test some more applications, both standalone and timesharing.

I'm not actively working on the display code proper (but am plotting a way to do spacewar consoles in software).

Have you gotten any T/S program working with the display? If you have, then I think it's fair to close the ticket.

I don't remember seeing any code that depended on the DSDEV[N] devices returning any status or data. But I still wouldn't be surprised if ITS turns up some issue in my ka10_dpy.c interface code that non-T/S SPCWAR didn't uncover....

p

larsbrinkhoff commented 6 years ago

I have just now build ITS with 340P=1.

Spacewar doesn't work, but it's probably due to using some kind of real-time feature. It gets to here:

        .SUSET [.SMASK,,[%PIRLT]]       ;ENABLE RLT

And promptly hangs the system.

I'll try something else.

larsbrinkhoff commented 6 years ago

Built a new PEEK with 340P==1. Ran it and typed ^Y hoping to see some 340 graphics. Hung system.

larsbrinkhoff commented 6 years ago

Started PDSET. Typed S. Hung system.

larsbrinkhoff commented 6 years ago

@philbudne PDSET seems like a nice test case for this.

Start PDSET and type S. It will execute .DSTART. It seems to do its thing, and come back to URETJ1 to do a skip return to user space. But it doesn't get there. I interrupted the simulator, and PC was at LPTBR2-1, in the IFN 340P block. So it seems there are interrupts happening. Restarting and stopping randomly, the PC seems to hang out there a lot.

Can you check if the interrupt handling seems ok for this case?

philbudne commented 6 years ago

Can you check if the interrupt handling seems ok for this case?

OK, will check it out. Maybe tonight, maybe later.

Is there a way to break into Exec DDT from T/S?

larsbrinkhoff commented 6 years ago

It would be nice to get to EDDT from timesharing, but I haven't found a way. Except maybe doing :LOCK to go through a full shutdown sequence, but I tried that yesterday and it didn't work.

What I do is to try to set breakpoints before starting ITS. Sometimes I forget and have to start over. ITS is quite good about uncontrolled shutdowns, so I'll just exit from the emulator.

And before you ask, no, ^N or $^N doesn't work.

larsbrinkhoff commented 6 years ago

Built SYSTEM; DDT with 340 support. Had to comment out dpysw==:0 first.

Once started from DSKDMP, it prints 100/ and an endless number of space characters.

philbudne commented 6 years ago

and an endless number of space characters.

I saw the same thing, and it's why I switched to stand-alone SPCWAR.

It doesn't seem to be related to the T/S issue (expecting sign bit set in CONI DIS, results)

larsbrinkhoff commented 6 years ago

New app: Mike Speciner's MLIFE. (Correction: not by Bill Gosper originally.)

When I start it I get a Type 30 display, according to the window title. @philbudne, I thought there was only 340 emulation for the KA10?

larsbrinkhoff commented 6 years ago

Here's MLIFE, standalone and source.
http://lars.nocrew.org/its/mlife.tape

philbudne commented 6 years ago

New app: Bill Gosper's MLIFE.

Neat! I haven't looked: does it use the light pen? Does it work???

Are magtapes working now? How do I attach and extract a .tape file?

When I start it I get a Type 30 display, according to the window title. @philbudne, I though there was only 340 emulation for the KA10?

That's VERY odd, the only display_init call in type340.c is display_init(DIS_TYPE340, 1, u); / XXX check return? /

And the params for DIS_TYPE340 are: display.c: { DIS_TYPE340, "Type 340", &color_p17, NULL, 1024, 1024 }

larsbrinkhoff commented 6 years ago

Neat! I haven't looked: does it use the light pen?

Not as far as I can see.

Does it work???

I don't see anything in the window. I didn't try typing at the console.

Are magtapes working now? How do I attach and extract a .tape file?

Yes, they do. In the console, type ^E and then at mta0 mlife.tape. Then c to continue. In ITS, :dump, load. FILE= *; * *.

larsbrinkhoff commented 6 years ago

Apparently, the MIT-AI 340 display does something undocumented with CONI bit 0. The manual only documents CONI bits 18-35, which is also the usual range for devices to provide. Phil has confirmed that CONI is capable of getting a full 36-bit word from the bus, so possibly this was an MIT hardware modification.

The lack of bit 0 in the CONI status word causes the code below to fail.


        CONI DIS,A      ;Get display status
        TRNN A,77       ;Any PI channels?
        JRST LPTBR2     ;No, check other device interrupts.
        CONSZ DIS,7400  ;Edge, light pen, or stop condition?
        JUMPL A,SRECYC  ;Bit 0 set, handle special display interrupt channel
larsbrinkhoff commented 6 years ago

ITS 785 from 1973 also makes use of CONI bit 0, so this goes back to ITS prehistory.

larsbrinkhoff commented 6 years ago

@philbudne, check this other snippet from ITSDEV:

SRCYRB: CONI DIS,A      ;Get display status
        SKIPGE A        ;Skip if bit 0 is zero.
        CONO DIS,100    ;WOULD ASSIGN IF IDLE
        MOVE A,[JSR DIGNOR]
        JRST SRCYB1

I haven't read all the 340 code so I'm not sure when this is called. But remember that the MIT-AI 340 was attached to both the PDP-6 and the PDP-10. There is a special device for assigning peripherals to the 6 or the 10. Assignment is done automatically when a processor issues a CONO, and then you have to explicitly deassign a device when it's not in use any more.

Now see what this bit 0 does. If it's zero, SRECY will not be called. And SRCYRB will not do a CONO.

Maybe bit 0 indicates that the display is assigned to some processor, or that it's assigned to the PDP-10?

larsbrinkhoff commented 6 years ago

Got it. It's explained in HW memo 1.

Every peripheral on the shared I/O bus has a card called X100 which remembers if the peripheral is unassigned, assigned to the PDP-6, or assigned to the PDP-10.

There is also another feature built into the X100 card, which is a gate that is normally driven by the device CONI level and will read in a 1 or 0 on bit 0. This allows the processor to check for a successful assignment, because if the device is assigned to the other processor then the device CONI level will not be developed and a 1 will not be read in on bit 0.

larsbrinkhoff commented 6 years ago

I had to supress a scream of joy waking up my kid when I saw PEEK displaying on the 340!

larsbrinkhoff commented 6 years ago

MLIFE does... something. I got it to display "6214" to the upper right. But I don't know how to operate it.

larsbrinkhoff commented 6 years ago

PDSET works. "-1S" to activate. Maybe this will be my new wall clock.

larsbrinkhoff commented 6 years ago

Exec DDT still prints lots of spaces.

philbudne commented 6 years ago

PDSET works. "-1S" to activate. Maybe this will be my new wall clock.

Hasn't worked for me :-(

larsbrinkhoff commented 6 years ago

Strange. I didn't do anything to make it work. Or, not anything I'm aware of.

This is what I remember doing:

larsbrinkhoff commented 6 years ago

Probably have to set the ttytyp %TT340 bit on the ITS console to make DECUUO (and SUDS) use the 340.

larsbrinkhoff commented 6 years ago

Timesharing SPCWAR doesn't seem to work. Hangs ITS completely.

philbudne commented 6 years ago

Ah... Helps if I set the system time first!

Pleasant surprise that one simulated bit was all that was needed!

p

philbudne commented 6 years ago

Timesharing SPCWAR doesn't seem to work. Hangs ITS completely.

Was just about to ask that question, but figured you'd tell me if there was a problem! So much for "just one bit"!

larsbrinkhoff commented 6 years ago

I patched FED to make it use the 340. This patching will not be necessary once ITS knows the console TTY is "near" the 340 display.

I read in a font file, and FED displayed it. Then ITS crashed.


READING:  DSK:FONTS;20FG KST
UUO WITH PI IN PROGRESS  10/7/1975 11:33:23
PI LEVEL 6 BUGHALT.  FIND A WIZARD OR CONSIDER TAKING A CRASH DUMP.
THE SYSTEM HAS CRASHED AND CANNOT BE REVIVED WITHOUT EXPERT ATTENTION.
IF YOU CAN'T FIND HELP, RELOAD THE SYSTEM.6
YOU ARE NOW IN DDT. 1 ! 6/5/1975 21:32:05
BUGPC/   CAI UUOH0+2   $Q-2/   CONSZ PI,TTYST2+4   
larsbrinkhoff commented 6 years ago

Was just about to ask that question, but figured you'd tell me if there was a problem!

I'll report here and check off boxes in the top comment.