From owner-freebsd-ports Wed Jun 26 20:16:27 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A492A37B439 for ; Wed, 26 Jun 2002 20:15:29 -0700 (PDT) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g5R3D8JU022492 for ; Wed, 26 Jun 2002 20:13:08 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5R3D8aS022491; Wed, 26 Jun 2002 20:13:08 -0700 (PDT) Received: from mail.speakeasy.net (mail16.speakeasy.net [216.254.0.216]) by hub.freebsd.org (Postfix) with ESMTP id 57C1E37B40E for ; Wed, 26 Jun 2002 20:03:51 -0700 (PDT) Received: (qmail 2617 invoked from network); 27 Jun 2002 03:03:48 -0000 Received: from unknown (HELO hermes.trickster.gods) ([66.92.164.43]) (envelope-sender ) by mail16.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 27 Jun 2002 03:03:48 -0000 Received: from hermes.trickster.gods (localhost.trickster.gods [127.0.0.1]) by hermes.trickster.gods (8.12.3/8.12.3) with ESMTP id g5R33l6B003914 for ; Wed, 26 Jun 2002 23:03:47 -0400 (EDT) (envelope-from kstailey@hermes.trickster.gods) Received: (from kstailey@localhost) by hermes.trickster.gods (8.12.3/8.12.3/Submit) id g5R33lOh003913; Wed, 26 Jun 2002 23:03:47 -0400 (EDT) Message-Id: <200206270303.g5R33lOh003913@hermes.trickster.gods> Date: Wed, 26 Jun 2002 23:03:47 -0400 (EDT) From: Ken Stailey Reply-To: Ken Stailey To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/39912: new port of ITS RP06 filesystem image for KLH10 PDP-10 emulator Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 39912 >Category: ports >Synopsis: new port of ITS RP06 filesystem image for KLH10 PDP-10 emulator >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 26 20:11:24 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ken Stailey >Release: FreeBSD 4.6-STABLE i386 >Organization: self >Environment: System: FreeBSD hermes.trickster.gods 4.6-STABLE FreeBSD 4.6-STABLE #26: Wed Jun 26 07:35:47 EDT 2002 kstailey@hermes.trickster.gods:/usr/src/sys/compile/HERMES i386 >Description: New port containing an ITS RP06 filesystem image for KLH10 PDP-10 emulator. Now's your chance to see firsthand what was happening at MIT in the 60s through the early 90s. Run the original versions of Emacs on TECO and Maclisp, etc. ISBN 0-14-100051-1 makes a nice companion to this port. >How-To-Repeat: N/A >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # its # its/pkg-comment # its/Makefile # its/distinfo # its/pkg-plist # its/pkg-descr # its/files # its/files/its.sh # its/files/MIT-ITS-papers # its/files/README.FIRST # its/files/klh10-kn-freebsd.ini.in # its/files/its-user-install.sh # echo c - its mkdir -p its > /dev/null 2>&1 echo x - its/pkg-comment sed 's/^X//' >its/pkg-comment << 'END-of-its/pkg-comment' XBootable ITS filesystem for KLH-10 PDP-10 emulator END-of-its/pkg-comment echo x - its/Makefile sed 's/^X//' >its/Makefile << 'END-of-its/Makefile' X# New ports collection makefile for: its X# Date created: 11 January 2002 X# Whom: kstailey X# X# $FreeBSD$ X# X XPORTNAME= its XPORTVERSION= 1.0 XCATEGORIES= emulators XMASTER_SITES= ftp://ftp.usefulprojects.com/pub/FreeBSD/ports/distfiles/ XDISTNAME= PI-ITS-RP06.0-dbd9 XEXTRACT_SUFX= .bz2 X XMAINTAINER= kstailey@yahoo.com X XBUILD_DEPENDS= kn10-ks:${PORTSDIR}/emulators/klh10 XRUN_DEPENDS= kn10-ks:${PORTSDIR}/emulators/klh10 X XONLY_FOR_ARCHS= i386 # really KLH10 has this problem. X XNO_WRKSUBDIR= yes XNO_BUILD= yes XNO_PACKAGE= PI ITS RP06 disk image is too big. XNO_CDROM= PI ITS RP06 disk image is too big. X X# KSITS_KLH10_HOME and KSITS_DRIVER_DIR must be set to the same locations X# that the klh10 port uses XKSITS_KLH10_DIR= klh10-ks-its XKLH10_HOME= ${PREFIX}/share/${KSITS_KLH10_DIR} XKSITS_DRIVER_DIR= ${PREFIX}/libexec/${KSITS_KLH10_DIR} XIMAGE_HOME?= ${KLH10_HOME} XIMAGE_NAME= PI-ITS-RP06.0-dbd9 XIMAGE_BZ2= ${IMAGE_NAME}.bz2 XDOCDIR= ${PREFIX}/share/doc/${KSITS_KLH10_DIR} XPLIST_SUB+= IMAGE_HOME=${IMAGE_HOME} X Xdo-install: X @ ${ECHO} Installing compressed PI ITS RP06 disk image in ${IMAGE_HOME} X.if (${IMAGE_HOME} == ${KLH10_HOME}) X @ ${ECHO} Use IMAGE_HOME=/my/directory to relocate. X.endif X @ ${MKDIR} ${IMAGE_HOME} X @ ${INSTALL_DATA} ${DISTDIR}/${IMAGE_BZ2} ${IMAGE_HOME}/${IMAGE_BZ2} X @ ${INSTALL_DATA} ${FILESDIR}/klh10-kn-freebsd.ini.in ${KLH10_HOME} X @ ${INSTALL_SCRIPT} ${FILESDIR}/its.sh ${PREFIX}/bin/its X @ ${SED} -e "s;@PI-IMG@;${IMAGE_NAME};g" \ X -e "s;@KLH-SHARE@;${KLH10_HOME};g" \ X -e "s;@KLH-LIBEX@;${KSITS_DRIVER_DIR};g" \ X ${FILESDIR}/its-user-install.sh > ${WRKSRC}/its-user-install X @ ${INSTALL_SCRIPT} ${WRKSRC}/its-user-install ${PREFIX}/bin X @ ${INSTALL_MAN} ${FILESDIR}/MIT-ITS-papers ${DOCDIR} X @ ${SED} -e "s;@PREFIX@;${PREFIX};g" \ X ${FILESDIR}/README.FIRST >${WRKSRC}/README.FIRST X @ ${INSTALL_MAN} ${WRKSRC}/README.FIRST ${DOCDIR} X @ ${ECHO} "*** Please read ${DOCDIR}/README.FIRST" X.include END-of-its/Makefile echo x - its/distinfo sed 's/^X//' >its/distinfo << 'END-of-its/distinfo' XMD5 (PI-ITS-RP06.0-dbd9.bz2) = c575c2b02326b26fd36c732378174cbc END-of-its/distinfo echo x - its/pkg-plist sed 's/^X//' >its/pkg-plist << 'END-of-its/pkg-plist' Xbin/its Xbin/its-user-install X%%PORTDOCS%%share/doc/klh10-ks-its/MIT-ITS-papers X%%PORTDOCS%%share/doc/klh10-ks-its/README.FIRST Xshare/klh10-ks-its/klh10-kn-freebsd.ini.in X@unexec rm -f %%IMAGE_HOME%%/PI-ITS-RP06.0-dbd9.gz END-of-its/pkg-plist echo x - its/pkg-descr sed 's/^X//' >its/pkg-descr << 'END-of-its/pkg-descr' XThis is an image of a PI (Public ITS) filesystem that can be booted on Xthe KLH10 PDP-10 emulator. X XThe emulator image is about 45MB compressed and 170MB uncompressed. XThe installation needs to have a minimum of 45MB in ports/disfiles Xplus 45MB in the installation directory which defaults to X/usr/local/share/klh10-ks-its. That's about 90MB total but "make Xdistclean" will delete 45MB leaving you with only 45MB. After "make Xinstall" you must run the "its-user-install" script as a regular user Xto install an uncompressed 170MB RP06 filesystem image and setup Xemulator support files. Additional 170MB RP06 filesystem images Xmay also be installed. X XFor more information about ITS see WWW: http://www.its.os.org/ END-of-its/pkg-descr echo c - its/files mkdir -p its/files > /dev/null 2>&1 echo x - its/files/its.sh sed 's/^X//' >its/files/its.sh << 'END-of-its/files/its.sh' X#!/bin/sh X# X# $FreeBSD$ X# X# Run KLH10 with KS-ITS hardware configuration and ITS OS configuration X# to bring up MIT Incompatible Timesharing System emulation. X Xin_network=false Xfor i in `groups`; do X if [ $i = network ]; then X in_network=true X break X fi Xdone X Xif [ `whoami` = root ]; then X in_network=true Xfi X Xif [ $in_network = false ]; then X echo WARNING: You must be in group network in order to run a networked ITS. X echo WARNING: You may still run a non-networked ITS. Xfi X Xif [ ! -r ~/.itsrc ]; then X echo its: My config file '(~/.itsrc)' is missing! X echo its: Did you remember to run its-user-install\? X echo its: Terminating. X exit 1 Xfi X Xset -e # croak on corrupt config file. X. ~/.itsrc Xset +e X Xif [ "$KLH10_HOME" = "" ]; then X echo its: KLH10_HOME is missing from my config file. X echo its: terminating. X exit 1 Xelif [ ! -d "$KLH10_HOME" ]; then X echo its: $KLH10_HOME is not a directory. X echo its: terminating. X exit 1 Xfi X Xif [ "$PI_IMAGE" = "" ]; then X echo its: PI_IMAGE is missing from my config file. X echo its: Terminating. X exit 1 Xelif [ ! -w "$PI_IMAGE" ]; then X echo its: $PI_IMAGE is not a writable file. X echo its: Terminating. X exit 1 Xfi X Xcd $KLH10_HOME Xexec lockf -t 0 -k $PI_IMAGE kn10-ks klh10-kn-freebsd.ini END-of-its/files/its.sh echo x - its/files/MIT-ITS-papers sed 's/^X//' >its/files/MIT-ITS-papers << 'END-of-its/files/MIT-ITS-papers' XITS Status report (includes architecture info) from 1972 Xftp://publications.ai.mit.edu/ai-publications/0-499/AIM-238.ps X XITS reference manual from 1969: Xftp://publications.ai.mit.edu/ai-publications/0-499/AIM-161A.ps X XMidas macro assembler documentation from 1965: Xftp://publications.ai.mit.edu/ai-publications/0-499/AIM-090.ps X XDDT debugger ("system apex procedure" i.e. "shell") from 1968 Xftp://publications.ai.mit.edu/ai-publications/0-499/AIM-147.ps X XEmacs text editor (original ITS version) Xftp://publications.ai.mit.edu/ai-publications/500-999/AIM-519A.ps X XThese files may be converted to PDF or gzipped to save space: X$ ps2pdf13 AIM-238.ps AIM-238.pdf END-of-its/files/MIT-ITS-papers echo x - its/files/README.FIRST sed 's/^X//' >its/files/README.FIRST << 'END-of-its/files/README.FIRST' XConsider adding firewall protection for the KLH-10 emulator before Xever running it. See @PREFIX@/share/doc/its/pubits/adm directory for Xsamples. X XTo setup the emulator you must run the its-user-install(1) command. XIt takes no arguments. It is best to run it as a regular (non-root) Xuser. Once that has been done to start ITS run the its(1) command. XIt also takes no arguments. X XThe first time the ITS boots it will not know the time of day. ITS Xwill display this message: X XThe time could not be set because: XNo host responded. XIt will be necessary for someone to set the time Xmanually by logging in and running :PDSET. X XTell ITS to activate the apex procedure, DDT, by typing a Ctrl-Z. XWhen you type that you will see: X XKN ITS.1647. DDT.1545. XTTY 0 XYou're all alone, Fair share = 0% X X(ITS does not know the date, so messages cannot be reviewed right now.) X XThen run PDSET by typing (colon and all) X X:pdset X XITS will suggest that you log in but you don't have to. X X(Please Log In) X___002 PDSET IOTLSR X XNow enter the time and save it. First the century: X X20C X XNext the YYMMDD: X X020219D X XThen the HHMMSS (try to time it so you have some lead time because it Xwill become active when you save it.) X X235115T X XNow save the time: X X!. X XNow exit PDSET X XX X XYou will have no feedback from the exit operation except that new Xcommands will be echoed in lower case. Now bring down ITS so you can Xstart it without being root: X X:lock X(Please Log In) X LOCK.154 X_ X Xthe _ is a prompt, do not type it. Type X X5down X XLOCK is very picky about typos so be careful. It does not need the XEnter key so don't use it. X XDO YOU REALLY WANT THE SYSTEM TO GO DOWN? X XType "y" X Xy X___004 X PLEASE ENTER A BRIEF MESSAGE TO USERS, ENDED BY ^C XLOCK SYS DOWN MAIL WRITE 21:13:17 X XJust type Ctrl-C for the message unless you have a burning desire to Xtalk to yourself via ITS. X XKN ITS going down in 5:00 XCULPRIT = ___004 LOCK 21:13:38 X X X_ XKN ITS 1647 NOT IN OPERATION 21:13:38 XPFTHMG DRAGON CHANNA _DRGN_ TIMES WRITE 21:13:38 XPFTHMG DRAGON CHANNA LOGOUT TIMES DELRNM 21:13:38 X XAfter the "NOT IN OPERATION" message only very special programs like Xthe accounting dragon, PFTHMG DRAGON, may run. Be patient and it will Xfinish with: X XSHUTDOWN COMPLETE XPI LEVEL 7 BUGDDT. TYPE P TO CONTINUE. XYOU ARE NOW IN DDT. XBUGPC/ CAIA COFFI4+1 $Q-2/ JRST COFFI7 X XIf ITS gets stuck shutting down for more than five minutes just Xcontinue from here: X XAt this point type Ctrl-\ to abort KLH10 back to the monitor. X X[HALTED: FE interrupt] XKLH10> X Xand quit KLH10 X XKLH10> quit XAre you sure you want to quit? [Confirm]y XShutting down...Bye! X$ X XITS uses DEL for erasing characters. ITS defaults to dumb hardcopy Xterminal settings. This is a pain so you want to configure ITS to Xuse something nicer. ITS knows about VT52. If you are using xterm Xfrom XFree86 you can get into VT52 mode by running a script like this: X X#! /bin/sh X Xawk 'END {printf "%c[?2l", 27}' u which is [Esc][Esc]u and Xrepresented in the documentation as $$u X XThe ITS equivalent of $PATH is implemented by scanning all Xdirectories for files for files with TS as the first name and Xthe second name set to the command you issued. By convention Xmost commands are in the SYS; SYS1; ... SYSN; directories. XITS supports symlinks via the LINK command and TS name is often Xa symlink. X XITS equivalent of job control works by typing ^Z to interrupt the Xcurrent program. To get back to the DDT prompt "*" use $^K X XDon't like DDT as the shell? Try MONMOD to use monitor mode where the Xcolon is printed for you. DDTMOD gets you back. Or try SHELL to Xbring up a UNIX-like shell. X XZork was developed in MDL (muddle) on an ITS system but apparently it Xsuffered from being too popular. Try the ZORK command to see what Xhappened. A scrap of MDL source code is left (:find @muddle) but I Xdon't know how to MIDAS it. END-of-its/files/README.FIRST echo x - its/files/klh10-kn-freebsd.ini.in sed 's/^X//' >its/files/klh10-kn-freebsd.ini.in << 'END-of-its/files/klh10-kn-freebsd.ini.in' X; KLH10 emulator configuration for KN ITS system from FreeBSD ports collection.. X X; Define basic KS10 device config - two RH11s each on its own Unibus X Xdevdef rh0 ub1 rh11 addr=776700 br=6 vec=254 Xdevdef rh1 ub3 rh11 addr=772440 br=6 vec=224 X X; Provide one disk, one tape in config ITS expects X Xdevdef dsk0 rh0.0 rp type=rp06 format=dbd9 path=@KLH-HOME@/PI-ITS-RP06.0-dbd9 iodly=0 Xdevdef mta0 rh1.0 tm02 fmtr=tm03 type=tu45 X X; ITS wants a 60Hz clock, allow it. Need this until defaults OK. Xset clk_ithzfix=60 X X; Define IMP for KN Xdevdef imp ub3 lhdh addr=767600 br=6 vec=250 ipaddr=@IPADDR@ gwaddr=@GWADDR@ X X; Dummy definitions. Only one DZ is still (apparently) needed. Xdevdef dz0 ub3 dz11 addr=760010 br=5 vec=340 X;devdef dz1 ub3 dz11 addr=760020 br=5 vec=350 X;devdef chaos ub3 ch11 addr=764140 br=5 vec=270 X X; Define new HOST device hackery Xdevdef idler ub3 host addr=777000 X X; Preload ITS for convenience Xload @.its-647kn-u X X; Use "GO 774000" to start DDT, else just "GO" to start ITS X END-of-its/files/klh10-kn-freebsd.ini.in echo x - its/files/its-user-install.sh sed 's/^X//' >its/files/its-user-install.sh << 'END-of-its/files/its-user-install.sh' X#! /bin/sh X X# $FreeBSD$ X X# 1) zcat the PI fs image into a user's directory (the compressed X# image location is also configurable via "make install") X# X# 2) copy or lndir the /usr/local/share/klh10-ks-its/* (this location X# is immutable) bits into a user's directory X# X# 3) generate the klh-kn-its-freebsd .ini file for the user X# X# 4) generate ~/.itsrc file for its(1) command so that multple users X# can use its(1) with different filesystem images. X Xumask 022 X X# remove symlinks in cleanup()? X Xcleanup() { X rm -f $KLH10_HOME/@PI-IMG@ X echo its-install-user: Terminating. X exit 1 X} X Xtrap cleanup 1 2 3 15 X Xvalidate_ip() { X echo $1 | grep -q -s '[^0-9\.]' X if [ $? != 1 ]; then X echo its-install-user: IP address must be digits and periods only. X return 1 X fi X echo $1 | grep -q -s '\..*\..*\.' X if [ $? != 0 ]; then X echo its-install-user: IP address must have at least three periods. X return 1 X fi X echo $1 | grep -q -s '\..*\..*\..*\.' X if [ $? = 0 ]; then X echo its-install-user: IP address must not exceed three periods. X return 1 X fi X echo $1 | grep -q -s '\.\.' X if [ $? = 0 ]; then X echo its-install-user: IP address must not have consecutive periods. X return 1 X fi X OLDIFS="$IFS" X IFS=. X set $1 X for i in $* ; do X if [ $i -gt 255 ]; then X echo its-install-user: Octets of IP address must not exceed 255. X IFS="$OLDIFS" X return 1 X fi X done X IFS="$OLDIFS" X return 0 X} X Xin_network=false Xfor i in `groups`; do X if [ $i = network ]; then X in_network=true X break X fi Xdone X Xif [ `whoami` = root ]; then X in_network=true Xfi X Xif [ $in_network = false ]; then X echo WARNING: You must be in group network in order to run a networked ITS. X echo WARNING: You may still run a non-networked ITS. Xfi X Xif [ ! -d @KLH-SHARE@ ]; then X echo its-install-user: Can\'t find the emulator directory. X cleanup Xfi X Xcd @KLH-SHARE@ X Xif [ ! -r @PI-IMG@.bz2 ]; then X echo its-install-user: The compressed PI disk image is missing. X cleanup Xfi X Xvalid_input=false Xwhile [ $valid_input = false ]; do X KLH10_HOME=~/klh10-its-home X echo Where do you want to install the 170MB filesystem image\? X echo -n "[default: $KLH10_HOME]: " X read ans X if [ "$ans" != "" ]; then X KLH10_HOME=$ans X fi X X if [ -e $KLH10_HOME -a ! -d $KLH10_HOME ]; then X echo There already is a non-directory $KLH10_HOME in the filesystem. X continue X fi X if [ ! -d $KLH10_HOME ]; then X echo -n "$KLH10_HOME is not an existing directory. Create it? (y/n) " X read yorn X case "$yorn" in X y|Y) X if ! mkdir -p $KLH10_HOME ; then X echo its-install-user: Can\'t make the target directory. X cleanup X else X valid_input=true X fi X ;; X n|N) X echo Type the interupt key to quit or try again. X ;; X *) X echo "I do not recognize your answer. ($yorn)" X ;; X esac X elif [ ! -w $KLH10_HOME ]; then X if ! chmod u+w $KLH10_HOME || chmod g+w $KLH10_HOME; then X echo its-install-user: Can\'t write in $KLH10_HOME X elif [ ! -w $KLH10_HOME ]; then X echo its-install-user: Can\'t write in $KLH10_HOME X else X valid_input=true X fi X else X valid_input=true X fi Xdone X Xecho Extracting @PI-IMG@.bz2 into $KLH10_HOME Xbzcat @PI-IMG@.bz2 > $KLH10_HOME/@PI-IMG@ X Xif [ $? != 0 ]; then X echo its-install-user: What a mess--the extract failed. X cleanup Xfi X Xecho Linking up the emulator support files. Xfor i in *; do X case $i in X @PI-IMG@.bz2) # exclusions X ;; X *) X rm -f $KLH10_HOME/$i && ln -s @KLH-SHARE@/$i $KLH10_HOME X if [ $? != 0 ]; then X echo its-install-user: Failed to make symlinks. X cleanup X fi X ;; X esac Xdone Xcd @KLH-LIBEX@ Xfor i in *; do X rm -f $KLH10_HOME/$i && ln -s @KLH-LIBEX@/$i $KLH10_HOME X if [ $? != 0 ]; then X echo its-install-user: Failed to make symlinks. X cleanup X fi Xdone Xcd $KLH10_HOME X XEM_IP=10.134.198.236 Xvalid_input=false Xwhile [ $valid_input = false ]; do X echo -n "What is the IP address for the emulated PDP-10? [$EM_IP]: " X read ans X if [ "$ans" != "" ]; then X if validate_ip $ans ; then X valid_input=true X EM_IP=$ans X fi X else X valid_input=true X fi Xdone X XGW_IP=10.0.0.1 Xvalid_input=false Xwhile [ $valid_input = false ]; do X echo -n "What is the IP address for the gateway' [$GW_IP]: " X read ans X if [ "$ans" != "" ]; then X if validate_ip $ans ; then X valid_input=true X GW_IP=$ans X fi X else X valid_input=true X fi Xdone X Xsed -e "s;@IPADDR@;$EM_IP;g" \ X -e "s;@GWADDR@;$GW_IP;g" \ X -e "s;@KLH-HOME@;$KLH10_HOME;g" \ X < klh10-kn-freebsd.ini.in > klh10-kn-freebsd.ini Xif [ $? != 0 ]; then X echo its-install-user: Failed to generate ini file. X cleanup Xfi Xrm -f klh10-kn-freebsd.ini.in X Xrm -f ~/itsrc Xecho KLH10_HOME=$KLH10_HOME > ~/.itsrc Xecho PI_IMAGE=$KLH10_HOME/@PI-IMG@ >> ~/.itsrc Xif [ $? != 0 ]; then X echo its-install-user: Failed to generate rc file. X cleanup Xfi END-of-its/files/its-user-install.sh exit >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message