diff --git a/build/ka10/include.tcl b/build/ka10/include.tcl index 029f81a1..0b9aac01 100644 --- a/build/ka10/include.tcl +++ b/build/ka10/include.tcl @@ -22,10 +22,9 @@ proc mark_pack {unit pack id} { } proc mark_packs {} { + # Bootstrap ITS uses just packs 2 and 3. mark_pack "0" "2" "2" mark_pack "1" "3" "3" - mark_pack "2" "0" "0" - mark_pack "3" "1" "1" } proc prepare_frontend {} { @@ -34,6 +33,42 @@ proc prepare_frontend {} { proc frontend_bootstrap {} { } +proc finish_mark {} { + global emulator_escape + global build + global out + + # Here's a dance to get around the fact that the bootstrapping ITS + # may have a different disk format from the target. First save + # all files to tape. Next, run the new SALV to mark the disks + # using the target format. Finally load back the files from tape. + + respond "*" $emulator_escape + create_tape "$out/reboot.tape" + type ":dump\r" + respond "_" "dump links full\r" + respond "TAPE NO=" "0\r" + expect -timeout 6000 "_" + type "quit\r" + + exec -ignorestderr $build/magdmp.sh $out + + respond "*" $emulator_escape + quit_emulator + start_salv build/pdp10-ka/init2 + + mark_pack "0" "2" "2" + mark_pack "1" "3" "3" + mark_pack "2" "0" "0" + mark_pack "3" "1" "1" + + respond "DDT" "tran\033g" + respond "#" "0" + respond "OK" "y" + expect -timeout 300 EOT + respond "DDT" $emulator_escape +} + proc its_switches {} { global mchn respond "MACHINE NAME =" "$mchn\r" @@ -82,9 +117,17 @@ proc make_dskdmp {} { global emulator_escape global out + # On-disk @ DSKDMP. respond "*" ":midas dsk0:.;@ dskdmp_system;dskdmp\r" dskdmp_switches "N" expect ":KILL" + + # Paper tape DSKDMP. This is used for booting ITS. + respond "*" $emulator_escape + punch_tape "$out/dskdmp.rim" + type ":midas ptp:_system;dskdmp\r" + dskdmp_switches "Y" + expect ":KILL" } proc dump_switches {} { @@ -110,21 +153,8 @@ proc dump_nits {} { respond "\n" "\033u" respond "DSKDMP" "d\033$salv\r" - # Since we bootstrap with a 2-pack ITS, we need to copy the MFD to - # the fresh packs. - respond "\n" "$salv\r" - respond "\n" "ucop\033g" - respond "UNIT #" "0" - respond "UNIT #" "2" - respond "OK?" "Y" - respond "DDT" "ucop\033g" - respond "UNIT #" "0" - respond "UNIT #" "3" - respond "OK?" "Y" - respond "DDT" "\033u" - # Now dump the new ITS. - respond "DSKDMP" "t\033its bin\r" + respond "\n" "t\033its bin\r" respond "\n" "\033u" respond "DSKDMP" "m\033$salv bin\r" respond "\n" "d\033nits\r" diff --git a/build/kl10/include.tcl b/build/kl10/include.tcl index 3ebf37c4..e65f03d2 100644 --- a/build/kl10/include.tcl +++ b/build/kl10/include.tcl @@ -42,6 +42,10 @@ proc prepare_frontend {} { proc frontend_bootstrap {} { } +proc finish_mark {} { + shutdown +} + proc its_switches {} { global mchn diff --git a/build/ks10/include.tcl b/build/ks10/include.tcl index 8b9f0a18..76a78d54 100644 --- a/build/ks10/include.tcl +++ b/build/ks10/include.tcl @@ -94,6 +94,10 @@ proc frontend_bootstrap {} { expect ":KILL" } +proc finish_mark {} { + shutdown +} + proc its_switches {} { global mchn diff --git a/build/magdmp.sh b/build/magdmp.sh new file mode 100755 index 00000000..efb14689 --- /dev/null +++ b/build/magdmp.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +out="$PWD/$1" + +mkdir .tmp +cp bin/ka10/boot/* .tmp +cd .tmp +../tools/itstar/itstar xf $out/reboot.tape +mv _/salv.bin . +../tools/dasm/magfrm magdmp.bin @.ddt salv.bin > $out/magdmp2.tap +cd .. +rm -rf .tmp +exit 0 diff --git a/build/mark.tcl b/build/mark.tcl index 0cb72276..0badd8e4 100644 --- a/build/mark.tcl +++ b/build/mark.tcl @@ -59,6 +59,6 @@ make_dskdmp frontend_bootstrap -shutdown +finish_mark start_dskdmp dump_nits diff --git a/build/pdp10-ka/boot2 b/build/pdp10-ka/boot2 index f0e78777..8ad59b68 100644 --- a/build/pdp10-ka/boot2 +++ b/build/pdp10-ka/boot2 @@ -14,7 +14,7 @@ set dtc dis set dk dis set pd ena set pd on -at ptr bin/ka10/boot/dskdmp.rim +at ptr out/pdp10-ka/dskdmp.rim at mta0 out/pdp10-ka/sources.tape set mta mpx=7 set mta type=b diff --git a/build/pdp10-ka/build.tcl b/build/pdp10-ka/build.tcl index d7e35208..4dcb333c 100644 --- a/build/pdp10-ka/build.tcl +++ b/build/pdp10-ka/build.tcl @@ -2,8 +2,15 @@ set build [pwd]/build set out "out/$env(EMULATOR)" set emulator_escape "\034" -proc start_salv {} { - uplevel #0 {spawn ./tools/sims/BIN/pdp10-ka build/pdp10-ka/init} +proc start_salv args { + set ini "" + if {[llength $args] == 1} { + set ini [lindex $args 0] + } { + set ini "build/pdp10-ka/init" + } + set foo "spawn ./tools/sims/BIN/pdp10-ka $ini" + uplevel #0 $foo setup_timeout respond "MAGDMP\r\n" "l\033ddt\r" respond "\n" "t\033salv bin\r" @@ -42,6 +49,11 @@ proc create_tape {file} { } } +proc punch_tape {file} { + respond "sim>" "at ptp $file\r" + respond "sim>" "c\r" +} + proc quit_emulator {} { respond "sim>" "q\r" expect eof diff --git a/build/pdp10-ka/init2 b/build/pdp10-ka/init2 new file mode 100644 index 00000000..6700bb1c --- /dev/null +++ b/build/pdp10-ka/init2 @@ -0,0 +1,21 @@ +set console wru=034 +set cpu its +set cpu 512k +set rpa dis +set rpb dis +set tua dis +set fha dis +set dpb dis +set lpt dis +set cr dis +set dc disable +set dtc dis +set dk dis +at mta0 out/pdp10-ka/magdmp2.tap +at mta5 out/pdp10-ka/reboot.tape +at dpa0 out/pdp10-ka/rp03.2 +at dpa1 out/pdp10-ka/rp03.3 +at dpa2 out/pdp10-ka/rp03.0 +at dpa3 out/pdp10-ka/rp03.1 +set dpa headers +b mta0 diff --git a/build/pdp10-ka/run b/build/pdp10-ka/run index e4a5a645..758d2139 100644 --- a/build/pdp10-ka/run +++ b/build/pdp10-ka/run @@ -40,7 +40,7 @@ set imp ip=192.168.2.101/24 set imp gw=172.31.1.100 set imp host=10.3.0.6 at imp tap:tap0 -at ptr bin/ka10/boot/dskdmp.rim +at ptr out/pdp10-ka/dskdmp.rim at dpa0 out/pdp10-ka/rp03.2 at dpa1 out/pdp10-ka/rp03.3 at dpa2 out/pdp10-ka/rp03.0