# 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: # # README # install # boot # config.tcl # pdset.tcl # echo x - README sed 's/^X//' >README << 'END-of-README' XTCL/Expect scripts to install ITS under SIMH 3.0 X(from instructions at http://www.cosmic.com/u/mirian/its) X XPhil Budne Xphil@ultimate.com XBUDD@AI X7/20/2003 X END-of-README echo x - install sed 's/^X//' >install << 'END-of-install' X#!/usr/local/bin/expect -f X X# $Id: install,v 1.2 2003/07/20 22:16:11 phil Exp $ X X# debug X#exp_internal 1 X Xsource config.tcl X X# XXX test for valid input files present? X# salv.$disk_type.tape X# dskdmp.$disk_type.tape X# minsys.tape X# $sim_path X X# delete not present in early versions of TCL? Xfile delete "$disk_file" X X# NOTE! MTBOOT commands must be sent in upper case in order to match!! Xproc slow_send s { X foreach c [split "$s" {}] { X send "$c" X if {"$c" == "\033"} { X set c {$} X } X# puts "<<<$c>>>" X expect -nocase "$c" X } X} X Xspawn "$sim_path" X Xexpect "sim>" Xsend "set cpu its\r" X Xexpect "sim>" Xsend "set tim y2k\r" X Xexpect "sim>" Xsend "enable dz\r" X Xexpect "sim>" Xsend "at tu0 minsys.tape\r" X Xexpect "sim>" Xsend "at tu1 salv.$disk_type.tape\r" X Xexpect "sim>" Xsend "at tu2 dskdmp.$disk_type.tape\r" X Xexpect "sim>" Xsend "set rp0 $disk_type\r" X Xexpect "sim>" Xsend "at rp0 $disk_file\r" X Xexpect "sim>" Xsend "show\r" X X################ formatting pack X Xexpect "sim>" Xsend "b tu1\r" X Xexpect "ITS MTBOOT" Xslow_send "mark\033g" X Xexpect -re "Format pack on unit #" Xsend "0" X Xexpect "Are you sure you want to format pack on drive" Xsend "y" X Xexpect -exact "Pack no ?" Xsend "0\r" X Xexpect -exact "Verify pack? (Y or N)" Xsend "n" X Xexpect -exact "Swapping Alloc?" Xsend "800\r" X Xexpect -exact "Pack #0. ID?" Xsend "foobar\r" X X################ loading MINSYS tape X Xslow_send "TRAN\033G" X Xexpect "onto unit #" Xsend "0" X Xexpect -exact "Copy from unit #5 onto unit #0, OK (Y or N)" Xsend "y" X Xexpect "EOT" Xexpect "DDT" X Xsend "\005" X X################################ X# booting DSKDMP to create bootable ITS X Xexpect "sim>" Xsend "b tu2\r" X Xexpect "ITS MTBOOT.176\r\n" Xslow_send "\033g" X Xexpect " DSKDMP" Xslow_send "l\033ddt\r" Xsleep 1 X Xslow_send "t\033its $disk_type\r" Xsleep 1 X Xslow_send "\033u" X Xexpect " DSKDMP" X Xslow_send "m\033salv $disk_type\r" Xsleep 1 X Xslow_send "d\033its\r" Xsleep 1 X Xslow_send "f\033" Xsleep 1 X Xslow_send "its\r" Xsleep 1 X X#slow_send "\033g" Xsend "\033G" X Xexpect "TOP LEVEL INTERRUPT" X X# CTRL/Z Xsend "\032" Xexpect "You're all alone, Fair share =" X X################ run pdset X Xsource pdset.tcl X X################ Making the disk bootable, stage 1: KSFEDR X Xsend "ksfedr\013" Xexpect "!" Xsend "create\r" X Xexpect "Directory address:" Xexpect -re {([0-7]*)\r} Xset directory_addr $expect_out(1,string) X Xexpect "!" Xsend "write\r" X Xexpect -exact "Are you sure you want to scribble in the FE filesystem?" Xsend "yes\r" X Xexpect -exact "Which file? " Xsend "bt\r" X Xexpect "BT BIN):" Xsend ".; bt $disk_type\r" X Xexpect "!" Xsend "quit\r" X Xexpect ":KILL" X X# LOCK *NEVER* works for me... Xsend "lock\013" Xexpect "_" Xsend "5kill" X Xexpect -exact "DO YOU REALLY WANT THE SYSTEM TO GO DOWN?" Xsend "y" X Xexpect " PLEASE ENTER A BRIEF MESSAGE TO USERS, ENDED BY ^C" Xsend "cul8ter" Xsend "\003" X Xexpect "YOU ARE NOW IN DDT" X Xsend "\005" X Xexpect "sim>" Xsend "b tu1\r" X Xexpect "ITS MTBOOT" Xslow_send "feset\033g" X Xexpect "Set FE filesystem directory pointer on the pack on unit #" Xsend "0" X Xexpect "Directory address:" Xsend "$directory_addr\r" X Xexpect "DDT" Xsend "\005" X Xexpect "sim>" Xsend "quit" X Xputs "" END-of-install echo x - boot sed 's/^X//' >boot << 'END-of-boot' X#!/usr/local/bin/expect -f X X# $Id: boot,v 1.1 2001/10/01 21:20:10 phil Exp phil $ X X# debug X#exp_internal 1 X Xsource config.tcl X Xspawn "$sim_path" X Xexpect "sim>" Xsend "set cpu its\r" X Xexpect "sim>" Xsend "set tim y2k\r" X Xexpect "sim>" Xsend "enable dz\r" X Xexpect "sim>" Xsend "at dz0 $dz_port\r" X Xexpect "sim>" Xsend "set rp0 $disk_type\r" X Xexpect "sim>" Xsend "at rp0 $disk_file\r" X Xexpect "sim>" Xsend "b rp0\r" X Xexpect " DSKDMP" Xsend "its\r" Xexpect "\n" Xsleep 1 Xsend "\033" Xexpect "$" Xsend "g" X Xexpect "TOP LEVEL INTERRUPT" X X# CTRL/Z Xsend "\032" Xexpect "You're all alone, Fair share =" X X################ run pdset Xsource pdset.tcl X Xinteract END-of-boot echo x - config.tcl sed 's/^X//' >config.tcl << 'END-of-config.tcl' X# $Id: config.tcl,v 1.2 2003/07/20 22:20:07 phil Exp $ X Xset sim_path {../pdp10} Xset disk_file {rp0.dsk} Xset disk_type {rm80} Xset dz_port 5000 END-of-config.tcl echo x - pdset.tcl sed 's/^X//' >pdset.tcl << 'END-of-pdset.tcl' X# $Id: pdset.tcl,v 1.3 2003/07/20 22:11:03 phil Exp phil $ X Xsend "pdset\013" X X# must be run on console!! Xexpect "IOTLSR" X X# get time once, to avoid races! Xset t [timestamp] Xset c [expr [timestamp -seconds $t -format "%Y"] / 100] Xsend "${c}C" X Xsend [timestamp -seconds $t -format "%y%m%dD"] X X# DANGER!! could return leap second!!! Xsend [timestamp -seconds $t -format "%H%M%ST"] Xsend "!." X X# console message; Xexpect "IT IS NOW" Xexpect "\n" X Xsend "q" Xexpect ":KILL" END-of-pdset.tcl exit