PDP-10 / its

Incompatible Timesharing System
Other
850 stars 80 forks source link

COMSYS - DM mail demon #1960

Open larsbrinkhoff opened 3 years ago

larsbrinkhoff commented 3 years ago

Communication/mail system by @jh95468.

COMMUD; COMSYS SAVE - Muddle save file.
COMMUD; TS CUMSYS - Run Muddle with COMSYS save file.
LIBCOM - Data directory for COMSYS.

According to COMSYS \@FILES there seems to be 30-odd source files, many (all?) of which are on the ToTS 7005366 tape.

Uses IRS, the information retrieval system.

eswenson1 commented 1 year ago

Here is an example, that shows (the obvious) that when you AREAD from the a freshly opened (in READB mode) file, you get the first object written with APRINT. And if you use the ACCESS function to reset the file pointer, you can do AREAD again to re-read, but that each time you AREAD, the file pointer is advanced. This is obvious, but I wanted to make sure I understood the semantics properly.

ES>mud55↑K!
MUDDLE 55 IN OPERATION.
LISTENING-AT-LEVEL 1 PROCESS 1
<RESTORE "ejs4;comsys 55save">◊
"RESTORED"
<SET SPC <AFIND 1>>◊

        PGS        HIGH WORD             LAST WORD
#PBLOCK [1 #WORD *000000661777* #WORD *000000000000*]
CURRENT LOCATION = #WORD *000000661777*
LOWEST LOCATION  = #WORD *000000660000*
FVC LOCATION     = #WORD *000000000000*
FREE LIST LENGTH = 0

<SET STR <ASTRING .SPC "foobar">>◊
"foobar"

<SET FW <OPEN "PRINTB" "ejs4;madman file">>◊
#CHANNEL [4 "PRINTB" "MADMAN" "file" "DSK" "EJS4" "MADMAN" "FILE" "DSK" "EJS4" 227 23748404489 80 0 0 0 0 10 ""]

<APRINT .SPC .STR .FW>>◊
#CHANNEL [4 "PRINTB" "MADMAN" "file" "DSK" "EJS4" "MADMAN" "FILE" "DSK" "EJS4" 227 23748404489 80 0 0 0 0 10 ""]

<CLOSE .FW>◊
#CHANNEL [0 "PRINTB" "MADMAN" "file" "DSK" "EJS4" "MADMAN" "FILE" "DSK" "EJS4" 227 23085704747 80 0 0 0 0 10 ""]

<SET FR <OPEN "READB" "ejs4;madman file">>◊
#CHANNEL [4 "READB" "MADMAN" "file" "DSK" "EJS4" "MADMAN" "FILE" "DSK" "EJS4" 163 23748404430 <ERROR END-OF-FILE!-ERRORS> 0 0 0 0
10 ""]

<SET X <AREAD .SPC .FR>>◊
"foobar"
<SET Y <AREAD .SPC .FR>>◊
"······"
<SET Z <AREAD .SPC .FR>>◊
"······"
<ACCESS .FR 0>◊
#CHANNEL [4 "READB" "MADMAN" "file" "DSK" "EJS4" "MADMAN" "FILE" "DSK" "EJS4" 163 23748404430 <ERROR END-OF-FILE!-ERRORS> 0 0 0 0
10 ""]

<SET AA <AREAD .SPC .FR>>◊
"foobar"
<CLOSE .FR>◊

#CHANNEL [0 "READB" "MADMAN" "file" "DSK" "EJS4" "MADMAN" "FILE" "DSK" "EJS4" 163 23085704747 <ERROR END-OF-FILE!-ERRORS> 0 0 0 0
10 ""]

The <AFIND 1> at the beginning creates a MADMAN space. The <ASTRING spc obj> creates a string "in the specified space".

As you can see, three AREADs resulted in only one object's being read, because only one object (string) was written. After resetting the file pointer back to the beginning of the file, I could successfully re-read the first object written.

Examining the file with DDT shows:

ES>0/   1001,,4
1/   46,,6
2/   10700,,661772   '◊1'!' V/Z◊   "◊0"^B^\^Fc}◊
3/   0
4/   1,,661777   "◊1"^@^@^Nc^?◊
5/   4
6/   TSZE 7,@761302(15)   "◊0"fooba◊
7/   710000,,0   "◊0"r◊
10/   .IOT (3)

Note that at word offset 6 in the file begins the string "foobar" that I wrote. I assume before that is type/size information, etc.

eswenson1 commented 1 year ago

The above comment seems to indicate that MADMAN is working fine with regular files.

Of course, the issue I'm seeing with COMSYS is when MADMAN is used with ASYLUMs rather than regular files. ASYLUMs are also files, act like a mini file system, and they support locking. They are fixed length -- for example, COMSYS creates a 200-page / record ASYLUM file, and it is in this ASYLUM that the PENDING-QUEUE is written and read. And it is that reading and writing that isn't working. However, in the ASYLUM case, file number 1 is where the PENDING-QUEUE is stored. The value of COMSYS-PENDING-QUEUE is 1 -- the file number.

So my next set of experiences will use ASYLUM (which uses MADMAN) to store and read some data.

eswenson1 commented 1 year ago

The test case below seems to indicate a failure when an ASYLUM is used:

;;; create asylum

ES>mud55↑K--Clobber Existing Job--
MUDDLE 55 IN OPERATION.
LISTENING-AT-LEVEL 1 PROCESS 1
<RESTORE "ejs4;comsys 55save">◊
"RESTORED"
<MAKE-DATA-BASE "ejs4;nhack asylum" 2>◊
"ejs4;nhack asylum"
<QUIT>◊

;;; open asylum, write to a maniac within the asylum, read it back (fails)

ES>mud55↑K!
MUDDLE 55 IN OPERATION.
LISTENING-AT-LEVEL 1 PROCESS 1
<RESTORE "ejs4;comsys 55save">◊
"RESTORED"
<SET ASY <OPEN-DATA-FILE "ejs4;nhack asylum">>◊
#ASYLUM [#CHANNEL [4 "READ" "NHACK" "asylum" "DSK" "EJS4" "NHACK" "ASYLUM" "DSK" "EJS4" 163 23748404430 <ERROR END-OF-FILE!-ERRORS
> 0 0 0 0 10 ""] 196 197 ![#WORD *000000000000* #WORD *000000000000* #WORD *000000000000* #WORD *000000000000* #WORD
*000000000000* #WORD *000000000000* #WORD *000000000000* #WORD *000000000000*!] ![-1 199 0 0 -1 200 0 0!] 0 ![-1 201 0 0 -1 202 0
0 -1 203 0 0 -1 204 0 0!] [198 -1]]

<SET SPC <AFIND 1>>◊

        PGS        HIGH WORD             LAST WORD
#PBLOCK [1 #WORD *000000661777* #WORD *000000000000*]
CURRENT LOCATION = #WORD *000000661777*
LOWEST LOCATION  = #WORD *000000660000*
FVC LOCATION     = #WORD *000000000000*
FREE LIST LENGTH = 0
<SET S1 <ASTRING .SPC "foobar">>◊
"foobar"
<SET M1 <DATA-OPEN "PRINT" .ASY 1>>◊
#MANIAC 1
<DATA-IPRINT .ASY .M1 .SPC .S1>◊
#MANIAC 1
<DATA-CLOSE .ASY .M1>◊
#MANIAC 1
<SET M1 <DATA-OPEN "READ" .ASY 1>>◊
#MANIAC 1
<SET X <DATA-IREAD .ASY .M1 .SPC>>◊
"······"
<DATA-CLOSE .ASY .M1>◊
#MANIAC 1
<CLOSE-DATA-FILE .ASY>◊
#CHANNEL [0 "READ" "NHACK" "ASYLUM" "DSK" "EJS4" "NHACK" "ASYLUM" "DSK" "EJS4" 163 23085704747 <ERROR END-OF-FILE!-ERRORS> 0 0 0 0
10 ""]

Note that I wrote to file 1 within the ASYLUM the string "foobar", but when I closed the file, reopened it in "READ" mode, and read the file back, I didn't get the string "foobar" back. I'm not sure why, but this seems to match what is happening when COMSYS is trying to read/write a LIST.

eswenson1 commented 1 year ago

In the above example, when I searched, using DDT, for the string "foobar" in the entire (20 page) ASYLUM, I couldn't find it -- suggesting, perhaps, that it was never written. That would explain why the DATA-IREAD didn't return it.

eswenson1 commented 1 year ago

Also, in the above example, we use the lower-level primitives DATA-OPEN, DATA-IPRINT, DATA-CLOSE, and DATA-IREAD. Here, I'm using the higher-level DATA-APRINT and DATA-AREAD, which perform the DATA-OPEN and DATA-CLOSE automatically. It also has the same results as the above:

ES>mud55↑K!
MUDDLE 55 IN OPERATION.
LISTENING-AT-LEVEL 1 PROCESS 1
<RESTORE "ejs4;comsys 55save">◊
"RESTORED"
<SET ASY <OPEN-DATA-FILE "ejs4;nhack asylum">>◊
#ASYLUM [#CHANNEL [4 "READ" "NHACK" "asylum" "DSK" "EJS4" "NHACK" "ASYLUM" "DSK" "EJS4" 163 23748404430 <ERROR END-OF-FILE!-ERRORS
> 0 0 0 0 10 ""] 196 197 ![#WORD *000000000000* #WORD *000000000000* #WORD *000000000000* #WORD *000000000000* #WORD
*000000000000* #WORD *000000000000* #WORD *000000000000* #WORD *000000000000*!] ![-1 199 0 0 -1 200 0 0!] 0 ![-1 201 0 0 -1 202 0
0 -1 203 0 0 -1 204 0 0!] [198 -1]]
<SET SPC <AFIND 1>>◊

        PGS        HIGH WORD             LAST WORD
#PBLOCK [1 #WORD *000000661777* #WORD *000000000000*]
CURRENT LOCATION = #WORD *000000661777*
LOWEST LOCATION  = #WORD *000000660000*
FVC LOCATION     = #WORD *000000000000*
FREE LIST LENGTH = 0
<SET S1 <ASTRING .SPC "plugh">>◊
"plugh"
<DATA-APRINT .ASY 1 .SPC .S1>◊
#MANIAC 1
<SET X <DATA-AREAD .ASY 1 .SPC>>◊
"·····"
<TYPE .X>◊
STRING
<CLOSE-DATA-FILE .ASY>◊
#CHANNEL [0 "READ" "NHACK" "asylum" "DSK" "EJS4" "NHACK" "ASYLUM" "DSK" "EJS4" 163 23085704747 <ERROR END-OF-FILE!-ERRORS> 0 0 0 0
10 ""]

And searching for the string "plugh" -- at least word aligned, didn't turn up anything:

foo◊j!
ES>◊0l (Load Core Image) ◊
DSK: EJS; FOO BIN    ejs4;nhack asylum
ES>◊m/   -1
◊0"plugh◊◊w
ES>
eswenson1 commented 1 year ago

I made a copy of ES and brought it up, updated SYSTEM;CONFIG > to define:

DEFOPT SWBLK==0     ;1 => SWAP BLOCKING, 0 => PRIVILEGED USER
DEFOPT PAGPRE==0    ;NO PAGE-IN PREEMPTION

so that these match the DM definitions. I reran my DATA-APRINT/DATA-AREAD test case, above, and it, too, failed to recover the string I wrote to the ASYLUM file. The interesting thing is that while on the real ES, the string returned was displayed as ".....", on ES` (with ITS with updated config), it displayed as:

"^@^@^@^@^@"

It may be just random garbage, and the way the garbage was printed. In the first case, the 5 characters in the string were non-printing characters, and in the second case, 0s (NULs).

In any case, it would appear that the DM configuration (at least the part that seemed important differences) isn't the culprit. I wonder if the ASYLUM implementation is (somehow) memory-size dependent. I suspect DM didn't have as much memory as ES does.

Unfortunately, the code implementing DATA-APRINT and DATA-AREAD is hopelessly (for me) complicated. I'm not sure what to do now.

eswenson1 commented 1 year ago

The amount of memory that DM had is the same as the amount of memory ES has -- so that's not it.

Next, I have to rule out the difference between KA and KS processors -- which means I have to move my setup to a pdp10-ka ITS. That will require a bit more work. It is conceivable that the memory management stuff in ASYLUM and MADMAN only worked on a KA, or perhaps a non-KS. I find that hard to believe because I believe all of this MDL code, including COMSYS was working on TENEX and TOPS-20 as well. I suspect at least TOPS-20 was running on a KS. @larsbrinkhoff?

eswenson1 commented 1 year ago

@larsbrinkhoff I don't think my ES copy with SWBLK==0 and PAGPRE==0 is stable. First, it doesn't shut down properly. I get the message from SYSJOB saying that "ES ITS 1651 NOT IN OPERATION AT ..." and see the PFTHMG messages writing and rename CHANNA;LOGOUT TIMES, but I never get back to the KLH10 prompt. Also, when I rebooted the system after forcibly killing KLH10, I noticed that one of the files I had updated (SYSTEM;CONFIG >) was corrupted (full of garbage).

eswenson1 commented 1 year ago

Ok, I booted a KA system and ran my tests -- virtually the same results (different, but not working):

<SET ASY <OPEN-DATA-FILE "ejs;test asylum">>$
#ASYLUM [#CHANNEL [4 "READ" "TEST" "asylum" "DSK" "EJS" "TEST" "ASYLUM" "DSK"
"EJS" 163 23748404430 <ERROR END-OF-FILE!-ERRORS> 0 0 0 0 10 ""] 201 202 ![#
WORD *000000000000* #WORD *000000000000* #WORD *000000000000* #WORD
*000000000000* #WORD *000000000000* #WORD *000000000000* #WORD *000000000000* #
WORD *000000000000*!] ![-1 204 0 0 -1 205 0 0!] 0 ![-1 206 0 0 -1 207 0 0 -1
208 0 0 -1 209 0 0!] [203 -1]]
<SET SPC <AFIND 1>>$

        PGS        HIGH WORD             LAST WORD
#PBLOCK [1 #WORD *000000617777* #WORD *000000000000*]
CURRENT LOCATION = #WORD *000000617777*
LOWEST LOCATION  = #WORD *000000616000*
FVC LOCATION     = #WORD *000000000000*
FREE LIST LENGTH = 0
<SET S1 <ASTRING .SPC "plugh">>$
"plugh"
<DATA-APRINT .ASY 1 .SPC .S1>$
#MANIAC 1
<SET X <DATA-AREAD .ASY 1 .SPC>>$
#LOSE *000000000000*

Note that I wrote the string "plugh" (in a MADMAN space (MANIAC)) using DATA-APRINT, and then attempted to read it back using DATA-AREAD. This time, I got a #LOSE object back. So it doesn't work on KA either.

Note: I'm using the versions of the NBINs/IBINs from tape 9006255, which should contain the latest versions of ASYLUM and MADMAN.

eswenson1 commented 1 year ago

I've spent many, many days on this, and for now, I'm giving up. COMSYS SAVE images from ToTS that presumably worked in the past, don't work on ES. Running ASYLUM and MADMAN from source, or compiling the latest sources, and using the compiled NBINs also doesn't work. I haven't been able to get ASYLUM working despite lots of debugging and hacking.

I'm not certain where there is some error in logic (doubtful since I've tried unchanged code from ToTS), or some error in the simulator (only tried it on KLH10), or some change in ITS, or some dependency on DM's configuration, but the calculations that ASYLUM and MADMAN are making for locations of objects in memory appear to be incorrect. This may be due to pages not being mapped into memory in the same way as before.

In addition, I'm noticing that some Muddle functions don't work -- purifying and SUBRFYing. Both of these get PURPG faults. I'm not sure why this is happening. I think a PURPG fault is when you attempt to write to a pure page. However, why these Muddle libraries are getting these faults is a mystery. I've used unmodified ToTS scripts for purifying or subrfying -- which presumably worked on DM -- and they don't work on ES.

I'm wondering if there is some issue with the simulator or ITS that has broken some of these paging-related functions...

In any case, I'm going to give up trying to get COMSYS working until someone else can help me figure out what is happening here.

eswenson1 commented 1 year ago

I know I said I was giving up, and I am (for now) giving up on COMSYS. But I do have a follow-on to the above message.

I was curious to see whether ASYLUM and MADMAN worked on a KA system (under pdp10-ka). It failed in the same way as for the KS system under KLH10. However, I tried the PURIFY and SUBRFY functionality on my KA system and it worked just fine. The files necessary to do this are not present in a DB/KA/KL build, but I transferred them over from ES to my KA instance, and was able to do the following successfully:

<USE "SUBRFY">
<GROUP-LOAD "hello;hello nbin">
<SUBRFY HELLO "hello;hello prelod" <SET C <OPEN "PRINT" ".temp.;hello subrfy">>>
<CLOSE .C>

The contents of HELLO;HELLO PRELOD looked right and the contents of .TEMP.;HELLO SUBRFY also looked good and is shown below:

Beginning SUBRification of HELLO
SUBRifying RSUBR: SAVE-IT
SUBRifying RSUBR: HELLO
Beginning PURIFICATION
Beginning Pass-2

I did NOT get the PURPG errors I was getting on ES (KLH10). This means one of two things:

1) My ES system is messed up 2) KLH10 (KS) doesn't support this functionality.

So now, I'm going to move everything to a KLH10 system (pristine) and see whether it works there. If it does, then I can rule out 2). I'll have to figure out how I broke it in ES if that is the case. If it doesn't work, then KLH10, or the ITS configuration I use for ES under KLH10, doesn't support Muddle purification.

@larsbrinkhoff Any thoughts on this?

eswenson1 commented 1 year ago

Well, I tried purifying on KLH10 (DB, pristine), and it failed with a PURPG error. So it looks like there is an issue with KLH10, or the ITS configuration we use with KLH10 (DB). Anyone competent to work on KLH10? (@bictorv @larsbrinkhoff).

Next thing for me to try is with pdp10-ks (so as to see if this is a KS issue or a KLH10 issue).

rmaldersoniii commented 1 year ago

Well, I tried purifying on KLH10 (DB, pristine), and it failed with a PURPG error. So it looks like there is an issue with KLH10, or the ITS configuration we use with KLH10 (DB). Anyone competent to work on KLH10? (@bictorv @larsbrinkhoff).

Next thing for me to try is with pdp10-ks (so as to see if this is a KS issue or a KLH10 issue).

Don't we think it likely that the KS microcode written for ITS might have left behind some features of the KAs? And KLH only implemented what was possible on the KS systems?

(BTW, what setting do I need to change so that I see my messages on e-mail?)

eswenson1 commented 1 year ago

Hi @rmaldersoniii I think you have to update your GitHub Settings/Notifications. Yes, that's a good point.

However, the code in question, probably did run on TOPS-10 and TOPS-20 systems (as well as ITS), and I'd be surprised if those systems were only KAs. I would have thought that the TOPS-20 MIT systems, at least, were KLs or KSes.

jh95468 commented 1 year ago

Perhaps KLH remembers details about the KLH10 and paging? -- Ken Harrenstien iceklh@gmail.com (I don't know if he's on github)

eswenson1 commented 1 year ago

I was going to wait until I had tested on another KS emulator (pdp10-ks) to see if this is an issue with KS versus KA first. If purifying works on pdp10-ks, then the bug is with KLH10 and I’ll write to Ken about it. Thanks, Jack.

larsbrinkhoff commented 1 year ago

There are some differences between the KA/KL/KS instruction sets. KL and KS are pretty closed if you stay in section zero.

There was a problem with the C library using a FIX instruction, which the KA doesn't have. So there could be something like that going on with Muddle.

larsbrinkhoff commented 1 year ago

By the way, @eswenson1, did you get Trivia to work? Maybe the game also needs to run on KA. It works on my pdp10-ka based TT ITS.

larsbrinkhoff commented 1 year ago

Also note we have three different KS10 emulators: KLH10 (also KL10 of course), SIMH "pdp10" (Supnik), and SIMH "pdp10-ks" (Cornwell). As far as I know, they all work fine. But I bet there are minute details that differ.

larsbrinkhoff commented 1 year ago

Don't we think it likely that the KS microcode written for ITS might have left behind some features of the KAs? And KLH only implemented what was possible on the KS systems?

ITS KS10 microcode has most of the DEC standard features, plus some ITS instructions, like CIRC, and ITS paging. In user mode, it's more like a stock DEC KS10 than a KA10. So if the Muddle code were to use some KA10 feature that is in conflict with the KS10 instruction set that might be a problem.

How about that POP P,P thing @atsampson found? See https://github.com/rcornwell/sims/issues/217

BTW, what setting do I need to change so that I see my messages on e-mail

Probably something here: https://github.com/settings/notifications

larsbrinkhoff commented 1 year ago

However, the code in question, probably did run on TOPS-10 and TOPS-20 systems (as well as ITS)

I don't think Muddle ran on TOPS-10. However, there was a TOPS-20 emulator to run Zork on TOPS-10: https://github.com/PDP-10/20xsim

larsbrinkhoff commented 1 year ago

Someone pointed out that MDL works on TOPS-20. That presumably includes SUBRY and PURIFY, although I suppose that remains to be confirmed. Of course, TOPS-20 runs on both KL10 and KS10. The first TOPS-20 machines at MIT were KL10s; in particular the XX computer used by the Dynamic Modeling people.

The KL10 and KS10 instruction sets are very similar in user mode, so I don't see any reason MDL would work on KL10 and break on KS10.

As far as paging goes, I think KS10 emulates the KA10 pager quite well. I believe (but haven't checked) KA10 pure pages should work. @rcornwell, please provide details if you think otherwise.

ams commented 1 year ago

Well, there we go:

https://tumbleweed.nu/system-100-0-release/

Instructions are on the brief side for now.

eswenson1 commented 1 year ago

No. I never managed to get it loaded and runnable in MDL 55. I May go back to that sometime.

eswenson1 commented 1 year ago

Regarding TRIVIA, I suspect the MDL 54 version would work — although I never managed to get it to load and run. I’m not really interested in MDL 54, so I spent most of the time trying to get it working in MDL 55. But I ran into ASYLUM issues.

eswenson1 commented 1 year ago

However, the code in question, probably did run on TOPS-10 and TOPS-20 systems (as well as ITS)

I don't think Muddle ran on TOPS-10. However, there was a TOPS-20 emulator to run Zork on TOPS-10: https://github.com/PDP-10/20xsim

You’re right. I meant TENEX and TOPS-20 (TWENEX).

eswenson1 commented 1 year ago

Well, there we go: https://tumbleweed.nu/system-100-0-release/ Instructions are on the brief side for now.

Did you intend to post this in this ticket @ams ?

eswenson1 commented 1 year ago

I built an ITS on pdp10-ks and tried out my purify test. It fails there too -- in the same way as it fails on KLH10.

*mud55^K!
MUDDLE 55 IN OPERATION.
LISTENING-AT-LEVEL 1 PROCESS 1
<FLOAD "muddle;purity nbin">$
"DONE"
<USE "PURITY">$
USE
<GROUP-LOAD "hello;hello nbin">$
HELLO
<GROUP-PURIFY HELLO <SET C <OPEN "PRINT" ".temp.;hello purify">>>$
:$ FATAL ERROR MPV IN GARBAGE COLLECTOR $

On ES, if I use <USE "PURITY"> without first FLOADing the NBIN -- this ends up using the FBIN and the pure library rather than the NBIN), I get a different failure:

ES>mud55↑K--Clobber Existing Job--
MUDDLE 55 IN OPERATION.
LISTENING-AT-LEVEL 1 PROCESS 1
<USE "PURITY">◊
/PURITY USE
<GROUP-LOAD "hello;hello nbin">◊
HELLO
<GROUP-PURIFY HELLO <SET C <OPEN "PRINT" ".temp.;hello purity">>>◊
PURPG; 703752>>BLT 1,1777(2)   1/   61405,,24000   E.A. _ 24372

If I FLOAD the NBIN and then do <USE "PURITY"> (on ES), I get the same error (MPV in garbage collector) as I do in pdp10-ks. This works fine on pdp10-ka. @rcornwell Any thoughts? (works on pdp10-ka, doesn't work on pdp10-ks). Next up is pdp10-kl, which I'm building now.