From 32f7161eabf87ac0b2eca0eb3b9e09f706526023 Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Fri, 18 Nov 2016 12:42:02 +0100 Subject: [PATCH] Make it possible to run with emulators other than SIMH. --- Makefile | 6 ++++-- build/build.tcl | 40 ++++++++++++++++++++-------------------- build/simh/build.tcl | 38 ++++++++++++++++++++++++++++++++++++++ build/simh/stamp | 1 + 4 files changed, 63 insertions(+), 22 deletions(-) create mode 100644 build/simh/build.tcl create mode 100644 build/simh/stamp diff --git a/Makefile b/Makefile index d56c9ff2..53bf814c 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +EMULATOR ?= simh + SRC = system syseng sysen1 sysen2 sysnet kshack midas _teco_ rms klh MINSYS = _ sys sys3 device RAM = bin/boot/ram.262 @@ -9,8 +11,8 @@ WRITETAPE=${PWD}/tools/tapeutils/tapewrite all: out/rp0.dsk -out/rp0.dsk: build/simh/init out/minsys.tape out/salv.tape out/dskdmp.tape build/build.tcl out/sources.tape - expect -f build/build.tcl +out/rp0.dsk: build/simh/init out/minsys.tape out/salv.tape out/dskdmp.tape build/build.tcl out/sources.tape build/$(EMULATOR)/stamp + expect -f build/$(EMULATOR)/build.tcl out/minsys.tape: $(ITSTAR) mkdir -p out diff --git a/build/build.tcl b/build/build.tcl index 7129fb87..1cd8e368 100644 --- a/build/build.tcl +++ b/build/build.tcl @@ -33,22 +33,21 @@ proc pdset {} { } proc shutdown {} { + global emulator_escape respond "*" ":lock\r" expect "_" send "5kill" respond "GO DOWN?\r\n" "y" respond "BRIEF MESSAGE" "\003" - respond "NOW IN DDT" "\005" + respond "NOW IN DDT" $emulator_escape } set timeout 100 expect_before timeout abort -spawn pdp10 build/simh/init +start_nsalv -respond "sim>" "show ver\r" -respond "sim>" "b tu1\r" -respond "MTBOOT" "mark\033g" +respond "\n" "mark\033g" respond "Format pack on unit #" "0" respond "Are you sure you want to format pack on drive" "y" respond "Pack no?" "0\r" @@ -59,10 +58,10 @@ respond "DDT" "tran\033g" respond "onto unit" "0" respond "OK" "y" expect "EOT" -respond "DDT" "\005" +respond "DDT" $emulator_escape + +start_dskdmp -respond "sim>" "b tu2\r" -respond "MTBOOT" "\033g" respond "DSKDMP" "l\033ddt\r" expect "\n"; type "t\033its rp06\r" expect "\n"; type "\033u" @@ -83,21 +82,23 @@ respond "!" "quit\r" expect ":KILL" shutdown -respond "sim>" "b tu1\r" -respond "MTBOOT" "feset\033g" +restart_nsalv + +expect "\n" +sleep 1 +type "feset\033g" respond "on unit #" "0" respond "address: " "$dir\r" -respond "DDT" \005 -respond "sim>" "quit" +respond "DDT" $emulator_escape +quit_emulator -spawn pdp10 build/simh/boot +start_its respond "DSKDMP" "its\r" type "\033g" pdset -respond "*" "\005" -respond "sim>" "at tu0 out/sources.tape\r" -respond "sim>" "c\r" +respond "*" $emulator_escape +mount_tape "out/sources.tape" type ":dump\r" respond "_" "reload " respond "ARE YOU SURE" "y" @@ -204,9 +205,8 @@ respond "*" ":midas channa;atsign taraka_syseng; dragon\r" expect ":KILL" respond "*" ":link sys; atsign dragon,channa; atsign taraka\r" -respond "*" "\005" -respond "sim>" "at tu0 out/output.tape\r" -respond "sim>" "c\r" +respond "*" $emulator_escape +create_tape "out/output.tape" type ":dump\r" respond "_" "dump links full\r" respond "TAPE NO=" "0\r" @@ -214,4 +214,4 @@ expect "REEL" respond "_" "quit\r" shutdown -respond "sim>" "quit" +quit_emulator diff --git a/build/simh/build.tcl b/build/simh/build.tcl new file mode 100644 index 00000000..fb206484 --- /dev/null +++ b/build/simh/build.tcl @@ -0,0 +1,38 @@ +set emulator_escape "\005" + +proc start_nsalv {} { + uplevel #0 {spawn pdp10 build/simh/init} + respond "sim>" "show ver\r" + respond "sim>" "b tu1\r" + expect "MTBOOT" +} + +proc restart_nsalv {} { + respond "sim>" "b tu1\r" + expect "MTBOOT" +} + +proc start_dskdmp {} { + respond "sim>" "b tu2\r" + respond "MTBOOT" "\033g" +} + +proc start_its {} { + uplevel #0 {spawn pdp10 build/simh/boot} +} + +proc mount_tape {file} { + respond "sim>" "at tu0 $file\r" + respond "sim>" "c\r" +} + +proc create_tape {file} { + respond "sim>" "at tu0 $file\r" + respond "sim>" "c\r" +} + +proc quit_emulator {} { + respond "sim>" "q\r" +} + +source build/build.tcl diff --git a/build/simh/stamp b/build/simh/stamp new file mode 100644 index 00000000..ada9fc07 --- /dev/null +++ b/build/simh/stamp @@ -0,0 +1 @@ +For now, install SIMH separately.