====== Some notes on setting up an ITS system ======
2021: The stuff below is old (but most of it probably still applies). You should use the [[https://github.com/PDP-10/its|Github repository]] as a primary source of code and information.
These are some brief notes on setting up an ITS system based on [[http://klh10.trailing-edge.com/|klh10]] and the [[https://archive.org/details/KLH10-PI-ITS|PI]] (Public ITS) distribution.
These pages were initially written by [[http://victor.se/bjorn|Björn Victor]] (so that's who most references to "I" or "me" indicate).
I work on it **very occasionally**, but it may help some people along the way.
No, I'm not an ITS wizard, just an old TOPS-20 hacker. Any comments, corrections, or suggestions for improvements are **very welcome!**
Keep a copy of .INFO.;DDTORD > within arms reach at any point (or read it [[http://victor.se/bjorn/its/ddtord.html|here]]). Read {{ksits.txt|.../doc/ksits.txt}} (but see below) and {{distrib.its.txt|.../run/ksits/pubits/doc/distrib.its}} carefully. The [[http://dspace.mit.edu/handle/1721.1/6165|ITS Reference Manual]] is also worth reading, at some point.
See also my [[luser|Luser's Guide to ITS]], and the {{its-primer.txt|ITS Primer}} by V. Ellen Golden, and {{AI_WP_235.pdf|Getting Started Computing at the AI Lab}} (especially chapter 6), and the [[http://victor.se/bjorn/its/ddt.html|DDT Primer and Reference Manual]]. In the not-so-related-but-still-fun department, [[http://home.pipeline.com/~hbaker1/hakmem/hakmem.html|HAKMEM]], especially the "Programming Hacks" section. On the historical side, see also {{AI_WP_227.pdf|A Guide to ITS Operations - Useful Spells And Incantations}} by Christopher C. Stacy.
===== Making klh10 =====
- Use the latest klh10. The [[http://klh10.trailing-edge.com/|original]] at trailing-edge lacks a lot of things. The [[http://panda.trailing-edge.com/|Panda version]] has almost all you need - and includes a full TOPS-20 distribution. You can find the PI "starter ITS filesystem" [[https://archive.org/details/KLH10-PI-ITS|here]], and the "AI and MC archives" hidden in [[https://archive.org/details/pdp10nocrew|here]].
- If you run gcc version 4 (or later?) you will **NEED** to apply a patch to the file src/kn10def.h - download it {{kn10def-patch.txt|here}} (patch found by Roch Kusiak, see [[http://groups.google.com/group/alt.sys.pdp10/browse_thread/thread/61d7104ca751daaf#|here]]).
- Follow the instructions which came with your klh10.
===== To get it running decently =====
- **Run MD instead of PI.** Instead of using PI, as suggested in .../doc/ksits.txt, use **MD**. I.e., use klh10-md.ini instead of klh10-pi.ini. \\ Using PI gives a system that runs, but many many programs don't know the PI machine, so you'll typically get ''.VALUE 0'' breakpoints when running INQUIR, LISP etc. MD is more "well-known" (except to COMPLR), so you'll get a system which is easier to use. After getting everything running, you may want to consider [[rename|renaming your system]] to something more unique.
- **Get networking up.** Since the console gets random typeouts from the system (it is intended as a paper console logging what's happening to the system), it's a good idea to use the system over Telnet or Supdup.
* If you run Linux, you may be interested in a patch to support the tun/tap device in Linux (e.g the [[https://gist.github.com/MMcM/c2f99cc7656af6c15aac#file-tuntap-patch|patch by MMcM]]); at least this gives you local access, which is all you dare before you get PWORD/PANDA running. **Note** that this is not included in klh10-2.0h (the Panda version, see above).
* You can try [[http://victor.se/bjorn/its/raspi-ksits-iptables.txt|my iptables script]] to set up restricted external access (and forwarding of the Supdup port from the host to ITS). No guarantees it'll work in your setup. (See also my [[raspi|notes for Raspberry pi setup]].)
* You may also be interested in my [[http://victor.se/bjorn/its/supdup.tar.gz|patched Supdup client for Linux]].
===== Minor caveats =====
* **Check** that ''DEVICE;JOBDEV DIRMD'' exists and is a link to ''DEVICE;ATSIGN DIRDEV'', otherwise Dired in Emacs won't work (unless you do ''0m.vDIRED use DIR device$'' in your emacs init file). To create the link, use the '':LINK'' command.
* Putting ''223fs Help Char$'' in your Emacs init file may help, since the default help char is Top-H, and you probably don't have a Top key on your keyboard... (223 is ^_ (which you have to type twice, by the way, see Info node (ITSTTY)A/5.))
* **Set up mail aliases.** It's probably a good idea to edit ''.MAIL.;NAMES >'', basically replacing KLH with your own uname, and replacing @NX with @MD and *NX with *MD
* **Greetings.**
- The file ''SYS;NET MAIL'' is printed when people connect from the network. Unfortunately this output is erased when Supdup clears the screen immediately after.
- Maybe ''SYS;SYSTEM MAIL'' is a better place for greetings, since it's printed after the version/fair share message. (The file ''SYS;LOCAL MAIL'' is shown to non-network/dialup connections.)
- The standard contents of ''SYS;NET MAIL'' points at ''HACK;PI NEWS'', which you'll like to update.
* **INQUIR will still not work if you started from a PI image.** If you get the following error MD*:inquir
INQUIR.181
;162798. CAN'T CREATE A HUNK OF THIS SIZE
A bug in INQUIR has been encountered.
This should never happen.
Please send a message explaining the circumstances leading to this
to Bug-INQUIR@MIT-MC. Thank you.
:KILL
then your problem is **probably** a broken ''LISP;'' directory in the PI distribution disk. To fix:
- Fetch the LISP directory from the AI archive [[http://victor.se/bjorn/its/lisp.tgz|here]].
- Unpack it with ''tar zxf lisp.tgz''.
- Make an ITS tape from the new lisp directory using [[http://www.dbit.com/pub/pdp10/its/itstar/|ITStar]] (local copy [[http://victor.se/bjorn/its/itstar.tar.gz|here]], doc [[http://victor.se/bjorn/its/itstar.doc.txt|here]], text format): itstar -cf lisp.tap lisp
- Mount it as a tape:
- Press ^\ (to get a klh10 prompt)
- ''devmount mta0 lisp.tap'' (where lisp.tap is the file created by itstar)
- ''cont'' (to continue klh10)
- '':DUMP'' (if you get a warning message, press ^Z, type '':sl ⟨ENTER⟩'', then ''wrong/0 ⟨ENTER⟩'' and ''$P'')
- ''reload crdir links sorry'' (answer ''y'' if asked)
- ''quit'' (when done)
- You now have a fresh ''LISP'' directory, and ''INQUIR'' will work again.
===== Setting up COMSAT =====
In addition to setting up mailing lists, you'll need to set up COMSAT (the mailer demon) properly.
- As mentioned in {{distrib.its.txt|distrib.its}}, you need to set BUGHST, DOMGAT and TCPGAT. BUGHST is most likely the local IP address (192.168.0.203 for MD), the others are most likely your klh10 gwaddr (192.168.0.200 for MD).
- Put your IP addresses in the appropriate locations of .MAIL.;COMSAT BIN, set DEBUG/ 0 and XVERS/ 0, and start at PURIFY.
- To type in an address like 192.168.12.203, say
<<192.$_24.>+<168.$_16.>+<12.$_8.>+203.>
to DDT. Note the "." (to make decimal numbers) and that $ is Escape.
I have some notes on [[mail-setup|my external email setup]] - YMMV (certainly).
You may also want to get the [[dqdev|DNS resolver]] going (DOMAIN: device + resolver library). I will document this "soon".
===== Maintenance =====
==== Backup: ====
- Mount a tape: give klh10 the command ''devmount mta0 tapefile rw'' (where ''tapefile'' is a new file), and continue.
- To see which tape number to use (if you are disciplined about tape use), issue the ''TAPES'' command, specifying ''TTY:'' as the LIST DEV(ice).
-
- **Full backup:** give DUMP the command ''DUMP FULL LINKS'', followed by ''REWIND'', and ''ICHECK'' to check tape contents and set dumped bit on checked files.
- **Incremental backup:** ''DUMP INCREM LINKS'' (checks and sets bits)
- Backup done: ''QUIT''
- Done: give klh10 the command ''devunmount mta0''
==== Restore: ====
- Mount the tape: ''devmount mta0 tapefile'', and ''continue''
- Restore: give DUMP the command ''RELOAD LINKS CRDIR SORRY''
- Dismount tape: ''devunmount mta0''
===== Setting up PANDA/PWORD =====
PWORD is a replacement for HACTRN which doesn't let you log in as anyone without a password (except on the console and local terminals). PANDA is the administrative tool to set passwords, accept account applications, etc.
- Set the master password for PANDA.
panda$j
$l sysbin;panda bin
ttyhak+7/ CAME T,SPWORD .$b
run$g
Now type in a password. When you hit the breakpoint, its encrypted form is in T. Copy it (573037415503 in the example below), and then set it in the real copy:
t[ 573037415503
$l sysbin;panda bin (re-load a pure copy)
spword/ 573037415503
purify$g
:pdump sysbin;panda bin
To make it easy to run, make a link to it in SYS;TS PANDA (so you can run it by :panda).
- Create ACOUNT; which is needed for account applications etc.
- Add mail aliases for ACCOUNTS-NOTIFICATION, USER-ACCOUNTS, ACCOUNTS-HELD-REFUSED, USER-ACCOUNTS-ARCHIVE, PASSWORD-SYSTEM, and BUGGY-PWORD (see above). If you expect account applications, read the mail coming to these addresses...
- Make PWORD the replacement for HACTRN. \\ You may want to start by setting a password for your uname:
:panda
set uname -pw (where uname is your uname)
Is this OK? (Y or N) Y
Enter new password.
Password: f00
quit
Now just make a link to SYS;ATSIGN PWORD in SYS;ATSIGN HACTRN (not the other way!) and you're done. To change your password later, use '':login uname -pw''. \\ **Note** that logging in on the console never requires a password.
===== Contributions =====
* Patch for klh10 to support the Linux tun device (see [[https://gist.github.com/MMcM/c2f99cc7656af6c15aac#file-tuntap-patch|MMcM's version]]).
* An iptables script to set up restricted external access. No guarantees it'll work in your setup. (See my [[raspi|notes for Raspberry pi setup]] for the most recent version.)
* [[http://victor.se/bjorn/its/supdup.tar.gz|Supdup client for Linux]]
* A [[supdup|Supdup client in Java]]
* Notes on [[rename|renaming your ITS]] (but don't try this the first thing you do!)
* A working [[ch11|CH11 device]] for tunneling CHAOS over UDP
* Patches to enable [[chaos-dns|Chaos class support in BIND]] (the standard DNS server). For DNS support in ITS, see below.
* A [[http://up.update.uu.se/httpd|web server in Maclisp]] (yes, I like MIDAS, but it's easier in Lisp, really ;-).
* I wrote my first TECO hack in something like 15 years, to apply patches in the form of SRCCOM output to the original source. The library is called [[http://victor.se/bjorn/its/spatch.tps|SPATCH]] (for Srccom PATCH, of course). See [[spatch|some usage notes]].
* Some more [[http://victor.se/bjorn/its/y2kbv.tps|Y2K patches]]. You can also get them [[http://victor.se/bjorn/its/y2k.tps|together with the ones from Paul Svensson]].
* My patches to old ITS programs, both Y2K patches and others, can be found in [[http://up.update.uu.se/patch%3b|the PATCH; directory]] on my ITS machine, when it's up...
* Notes on [[mail-setup|my external email setup]] - YMMV (certainly).
* Notes on [[raspi|running klh10 on a Raspberry Pi]]
* Notes on [[dqdev|setting up DNS support]]
===== To do =====
Finish moving stuff from the old web pages to this Wiki.
If you know how to do these things, please let me know:
- DONE through the [[https://github.com/PDP-10/its|Github repo]]: Get all the sources missing from the PI distribution (and from Alan's archive). It seems some EMACS sources are missing too (e.g. PURIFY). (The sources of :DATE aren't among PI, AI or MC sources, but Paul Svensson has them.)
- The "Fair share" is very wrong. The "host" device (idling the kn10 process in the null job) seems to be the root of this. There is very little idle/lost time on an ITS system under klh10 with the host device+patch. If this is disabled, the fair share and idle time works better. See also [[http://up.update.uu.se/idleup|notes here]].
===== Trivia =====
In the movie [[http://www.imdb.com/title/tt0244244/|Swordfish]] (Jackman, Travolta, Berry), the hacker played by Jackman connects to an ITS system in the basement of Caltech to retrieve his worm (scene starting [[https://youtu.be/0a21sS5yuTA?feature=shared&t=3112|at 51:52 in the movie]]). In [[http://www.imsdb.com/scripts/Swordfish.html|the script]] (scene 72ff), the ITS machine is at MIT, which is surprisingly well written by the author, Skip Woods. Would anyone know how he would know about ITS? Would anyone have a guess why the machine was moved to Caltech in the movie?