PDP-10 / its

Incompatible Timesharing System
Other
841 stars 80 forks source link

Patch the value of IMPUS3 when IP is read from the IMP #2193

Closed bictorv closed 1 year ago

bictorv commented 1 year ago

Fix for issue #2192.

bictorv commented 1 year ago

Someone may decide this is worth bumping a version number for? Please do.

eswenson1 commented 1 year ago

Yes, please do increment the version number!

Not doing so makes it difficult to know, by looking at file versions, whether a system is up-to-date.

larsbrinkhoff commented 1 year ago

I'm curious why you need to look up the IMPUS3 symbol value? Without any detailed knowledge, I would have thought you could just do something like

    MOVE A,NIFIPA
        MOVEM A,IMPUS3

but I guess you tried that and it didn't work. Please educate us!

bictorv commented 1 year ago

Good question - let me explain by citing SYSTEM;INET >:

NIFIPA: ; IP Address for network interface
    IFN IMPP, IMPUS3    ; IP address on IMP interface
    IFN CHAOSP, IMPUS4  ; IP address on CHAOS interface
IFN .-NIFIPA-NNIFS, .ERR Wrong size table - NIFIPA

Here you can see that NIFIPA is a location in ITS, while IMPUS3 is just a symbol, defined in SYSTEM;CONFIG >, e.g. through

DEFOPT IMPUS3==<IPADDR 192,168,1,100>   ; IP address

In this case, IMPUS3=30052000544 (the IP address). This symbol is read, e.g. in RESOLV"OWNHST, using the .EVAL UUO which examines the ITS symbol table. To modify the symbol value, you need to look up the symbol in the symbol table (which "inside ITS" can be done by the SYMLK routine (see SYSTEM;ITS >) rather than the .EVAL UUO), and then store the new value in the address returned in C (the address of the symbol in the symbol table).

If you were to implement approach One in #2192, RESOLV would have to first use .EVAL to read the value of the NIFIPA symbol, and then read that location in ITS - every time a program calls RESOLV"OWNHST. Another advantage of approach Two is that the symbol table modification is done only once (when reading the IP address from the IMP), and the lookup (in RESOLV"OWNHST) can be slightly quicker.

Please ask if anything is unclear!

bictorv commented 1 year ago

Wow! I didn't know IMPUS3 was no longer used. I've been careful to set it properly for quite some time for each system I've set up!

Well, it turns out it was still used, but now it's only used "indirectly". Except in SYSTEM;NCP >, but that isn't used anymore - or perhaps Lars would say "not yet". ;-)

bictorv commented 1 year ago

Yes, please do increment the version number!

Please do!

larsbrinkhoff commented 1 year ago

@bictorv, thanks for the explanation (quite obvious in hindsight). I have updated the file version. FYI, here's how to do it:

$ git checkout bv-impus3
$ git mv src/system/imp.368 src/system/imp.369
$ git push -f
bictorv commented 1 year ago

Wow! I didn't know IMPUS3 was no longer used. I've been careful to set it properly for quite some time for each system I've set up!

Well, it turns out it was still used, but now it's only used "indirectly". Except in SYSTEM;NCP >, but that isn't used anymore - or perhaps Lars would say "not yet". ;-)

But @eswenson1, please note: in old KLH10 versions, or other emulators, the IP address isn't read from the IMP and the setting of IMPUS3 is still important!

eswenson1 commented 1 year ago

Thanks, Björn. I think I'm running a reasonably current version of KLH10 for ES and EX, but I'll make sure.