Multics Cold Boot on Docker

## 参考資料
[MR12.8_artifacts.zip](https://s3.amazonaws.com/eswenson-multics/public/releases/MR12.8/MR12.8_artifacts.zip)に含まれる「MULTICS INSTALLATION INSTRUCTIONS RELEASE 12.8」(MR12.8_SIB.txt)です。
また、[MULTICS SYSTEM MAINTENANCE PROCEDURES MANUAL](http://www.bitsavers.org/pdf/honeywell/large_systems/multics/AM81-04_maintPrcds_Nov86.pdf)がマニュアルです。
## configuration deck
QuickStart_MR12.8+site_setup.shで設定したconfiguration deckは以下となりました。
configuration deckとしてはtimezoneくらいしか変更はありません。
```
r 22:33 0.208 31

print_configuration_deck

clok  -9.  jst
iom  a  0  iom  on
iom  b  1  iom  on
cpu  a  7  on  dps8  70.  8.
mem  a  4096.  on
mem  b  4096.  on
mem  c  4096.  on
mem  d  4096.  on
ipc  fips  a  13  1
prph  dska  a  13  1  3381.  16
prph  fnpd  a  20  6670.  on
mpc  mtpa  501.  a  12  1
prph  tapa  a  12  1  500.  16.
prph  opca  a  36  6001.  256.  on
mpc  urpa  8004.  a  15  1
prph  rdra  a  15  301.
mpc  urpb  8004.  a  16  1
prph  puna  a  16  301.
mpc  urpc  8004.  a  17  1
prph  prta  a  17  1600.  600.  136.
part  hc  dska  00a
part  dump  dska  00a
root  dska  00a  dska  00b  dska  00c
sst  2000.  1000.  500.  250.
dbmj  64.  700.  400.  150.  60.  25.
tcd  500.  1000.
intk  warm  0.  star
parm  dirw

r 22:34 0.112 3
```
## my configuration
MR12.8 QuickStartのroot diskはMSU3381です。ちょっと大きいです。MSU3380に変更します。
ディスクの数は16から2に変更しました。 コールドブート用のiniファイルを作成します。
ファイル名は「MR12.8_kazu_coldboot.ini」です。
```
! date

; Steps 1, 2

set sys break

attach -r tape0 12.8MULTICS.tap
set disk0 type=3380
attach -n disk0 root3380.dsk

clrautoinput

; Step 3

; find_rpv_subsystem: Enter RPV data: M-> 
autoinput cold a11 ipc 3380 0a\n

; find_rpv_subsystem: Booting cold will destroy all data on the RPV.
;    Are you sure that you want to boot cold? M-> y
autoinput y\n
autoinput end\n

; bce (early) 0301.4: M->
autoinput ddl dska_00a\n

; Step 4

; bce (early) 0301.4: M->
autoinput config\n
; M->
autoinput 1,$d\n
autoinput a\n

; Edit this line to set you time zone; delta is the number of hours from
; GMT, zone is the name of the zone.

autoinput clok -delta -9. -zone jst \n
autoinput iom  -tag a -port 0 -model iom -state on \n
autoinput iom  -tag b -port 1 -model iom -state on \n
; DPS8/70M
autoinput cpu  -tag a -port 7 -state on -type dps8 -model 70. -cache 8. \n
autoinput mem  -port a -size 4096. -state on \n
autoinput mem  -port b -size 4096. -state on \n
autoinput mem  -port c -size 4096. -state on \n
autoinput mem  -port d -size 4096. -state on \n
autoinput ipc  -type fips   -iom a -chn 13 -nchan 1 \n
autoinput prph -subsys dska -iom a -chn 13 -nchan 1 -model 3380. -number 2 \n
autoinput prph -device fnpd -iom a -chn 20 -model 6670. -state on \n
autoinput mpc  -ctlr mtpa   -iom a -chn 12 -nchan 1 -model 501. \n
autoinput prph -subsys tapa -iom a -chn 12 -nchan 1 -model 500. -number 16. \n
autoinput prph -device opca -iom a -chn 36 -model 6001. -ll 256. -state on \n
autoinput mpc  -ctlr   urpa -iom a -chn 15 -model 8004. -nchan 1 \n
autoinput prph -device rdra -iom a -chn 15 -model 301. \n
autoinput mpc  -ctlr   urpb -iom a -chn 16 -model 8004. -nchan 1 \n
autoinput prph -device puna -iom a -chn 16 -model 301. \n
autoinput mpc  -ctlr   urpc -iom a -chn 17 -model 8004. -nchan 1 \n
autoinput prph -device prta -iom a -chn 17 -model 1600. -train 600. -ll 136. \n
autoinput part -part hc -subsys dska -drive 00a \n
autoinput part -part dump -subsys dska -drive 00a \n
autoinput root -subsys dska -drive 00a \n
autoinput sst  -4k 2000. -16k 1000. -64k 500. -256k 250. \n
autoinput dbmj 64. 700. 400. 150. 60. 25. \n
autoinput tcd -apt 500. -itt 1000. \n
autoinput intk warm 0. rpvs star \n
autoinput parm dirw\n

autoinput \wf\n
autoinput 1,$p\n
autoinput w\n
autoinput q\n
; bce (early) 0000.0: M->
autoinput bce\n
;Current system time is: Friday, July 22, 1994 20:01:28 pdt.
;Is this correct? M-> 
autoinput y\n

autoinput boot -cold\n
autoinput y\n

; Step 5

autoinput \xCommand:\x
; Command:
autoinput init_vol root2 dska_00b -rlv -special\n
autoinput list\n
autoinput end\n
autoinput shut\n

; Step 6
autoinput \ybce (boot) \y
; bce (boot)
autoinput config\n
autoinput /root/\n
autoinput s/$/ -subsys dska -drive 00b/p
autoinput w\n
autoinput q\n
; bce (boot)
autoinput reinit\n

; Step 7

; bce (boot)
autoinput boot\n

; Command:
autoinput \xCommand:\x
autoinput reload -nosetlvid\n
autoinput 12.8EXEC\n

; iload: Are there any more tapes to be reloaded?   M->
autoinput no\n

autoinput shut\n

; Step 7a

; bce (boot)
autoinput \ybce (boot)\y
autoinput boot standard\n

autoinput \xReady\x
autoinput admin\n
autoinput cvr -pv rpv -serial 0-1\n
autoinput ame\n

autoinput alv -all\n


; Steps 8, 9

autoinput admin\n
autoinput sis >lv rew *.SysAdmin rew *.SysDaemon\n
autoinput sa >lv s * sma *.SysAdmin sma *.SysMaint\n
autoinput create >lv>root.acs\n
autoinput cvr -lv root -acs >lv>root.acs\n
autoinput set_max_length >lv>*.acs 0\n
autoinput delete_acl >lv>*.acs\n
autoinput ame\n

autoinput shut\n

; Step 10

; bce
autoinput \ybce (boot)\y
autoinput boot\n

; Command:
autoinput \xCommand:\x
autoinput alv -all\n
autoinput reload -nosetlvid\n
; Input tape label:   M->
autoinput 12.8LDD_STANDARD\n

; iload: Are there any more tapes to be reloaded?   M->
autoinput yes\n
; Input tape label:   M-> 
autoinput 12.8UNBUNDLED\n

; iload: Are there any more tapes to be reloaded?   M->
autoinput yes\n
; Input tape label:   M-> 
autoinput 12.8AML\n

; iload: Are there any more tapes to be reloaded?   M->
autoinput yes\n
; Input tape label:   M-> 
autoinput 12.8MISC\n

; iload: Are there any more tapes to be reloaded?   M->
autoinput no\n

; Step 11

autoinput standard\n
autoinput admin\n
autoinput ec >system_library_tools>acct_start_up cold otw_\n

; Step 12

autoinput create_dir >user_dir_dir>SysAdmin>a>mcs.7.6c\n
autoinput cwd >user_dir_dir>SysAdmin>a>mcs.7.6c\n
autoinput ted\n
autoinput r >ldd>mcs>info>site_mcs.bind_fnp \n
autoinput w site_mcs.bind_fnp\n
autoinput q\n
autoinput ac x ([segs >ldd>mcs>o>*.archive -absp])\n
autoinput bind_fnp site_mcs -list\n

autoinput cwd >user_dir_dir>SysAdmin>a\n
autoinput ted\n
autoinput r CMF.cmf\n
;autoinput /image/\n
autoinput 1,$d\n
autoinput a\n
autoinput Service: login\s\n
autoinput Charge: none\s\n
autoinput Terminal_type: none\s\n
autoinput Line_type: none\s\n
autoinput Baud: 9600\s\n
autoinput FNP_required_up_time: 5\s\n
autoinput FNP:      D\s\n
autoinput \_\_\_type:            DN6670\s\n
autoinput \_\_\_memory:          64\s\n
autoinput \_\_\_lsla:            0\s\n
autoinput \_\_\_hsla:            1\s\n
autoinput \_\_\_image:           >user_dir_dir>SysAdmin>a>mcs.7.6c>site_mcs\s\n
autoinput \_\_\_service:         active\s\n
autoinput name: d.h000\s\n
autoinput attributes: hardwired\s\n
autoinput name: d.h001-d.h031\s\n
autoinput end\s\n
autoinput \wf\n
autoinput 1,$p\n
autoinput w\n
; ted: Do you want to w with the untrusted pathname >user_dir_dir>SysAdmin>a>CMF.cmf?
autoinput y\n
autoinput q\n
autoinput cv_cmf CMF.cmf\n
autoinput copy CMF.cdt >sc1>cdt -force\n
autoinput cwd >udd>sa>a\n
autoinput cv_pmf HFED\n
autoinput install HFED.pdt\n

autoinput hpsa >sl1>rcp_sys_ re *.HFED.*\n
autoinput hpsa >sl1>rcp_priv_ re *.HFED.*\n
autoinput hpsa >sl1>phcs_ re *.HFED.*\n
autoinput hpsa >sl1>tandd_ re *.HFED.*\n
autoinput hpsa >sc1>opr_query_data rw *.HFED.*\n
autoinput hpsa >sc1>admin_acs>tandd.acs rw *.HFED.*\n
autoinput hpsa >sc1>admin_acs>set_proc_required.acs rw *.HFED.*\n
autoinput hpsa >sc1>cdt r *.HFED.*\n

autoinput cwd >sc1\n
autoinput ed_installation_parms\n
autoinput change installation_id\n
autoinput Kazu Corp. Systems\n
autoinput change titles\n
autoinput Kazu Corp. Systems\n
autoinput Multics\n
autoinput K a z u  C o r p .  S y s t e m s \n
autoinput M u l t i c s\n
autoinput w\n
autoinput q\n

; Step 13

autoinput ame\n
autoinput stop_mpx d\n
autoinput multics\n
autoinput load_mpx d -check\n
autoinput admin\n
autoinput ec >tools>acct_start_up cold2\n
autoinput ame\n
autoinput word login\n
autoinput abs start\n
autoinput go\n

; Step 14

autoinput x repair salvquota > 2 -dcf -rebuild\n

autoinput admin\n

; Fix unbundled directory names and ACLs
autoinput sa >unb sma *.SysMaint.*\n
autoinput an >ldd>system_library_unbundled unbundled unb UNB\n
autoinput sa >ldd>unb sma *.SysAdmin sma *.SysDaemon sma *.SysMaint.* s *.*.*\n
autoinput da >ldd>unb Initializer.SysDaemon.z\n
autoinput an >ldd>system_library_unbundled>source s S\n
autoinput an >ldd>system_library_unbundled>object o O\n
autoinput sa >ldd>unb>(source object) sma *.SysAdmin sma *.SysDaemon sma *.SysMaint.* s *\n
autoinput da >ldd>unb>(source object) Initializer.SysDaemon.z\n
autoinput mq >dumps +5000\n
autoinput pause 120\n
autoinput ame\n

autoinput logout * *\n

autoinput admin\n
autoinput pause 60\n
autoinput ame\n

autoinput shut\n
autoinput \ybce (boot) \y
autoinput die\n
autoinput y\n
autoinput \z

boot iom0

echo Saving RPV as root.dsk.reloaded
! cp root3380.dsk root3380.dsk.reloaded

! date

quit
```
ブートディスクを変更したので当然boot.iniも変更します。
同じケーブルでディスクを変更する対応ですので、ディスクの種類を変更するだけです。
```
attach -r tape0 12.8MULTICS.tap
attach disk0 root3380.dsk
clrautoinput

;Uncomment and update these as appropriate for any CDT channels you wish to have as slave or autocall.
; Note: fnp3 refers to FNP D.  The 30 and 31, below, refer, therefore, to channels d.h030 and d.h031, respectively.
;set fnp3 service=30=slave=6131
;set fnp3 service=31=autocall

;find_rpv_subsystem: Enter RPV data: M->
autoinput rpv a11 ipc 3380 0a\n

;bce (early) 1913.7: M-> 
autoinput bce\n

;Current system time is: Wednesday, December 22, 1993 11:14:39 pst.
;Is this correct? M-> 
autoinput yes\n

;The current time is more than the supplied boot_delta hours beyond the
;unmounted time recorded in the RPV label.  Is this correct? M-> 
autoinput yes\n

;bce (boot) 1115.5: M->
autoinput boot star\n

autoinput \z

boot iom0
```
rootディスクのサイズは以下となりました。
```
/opt/multics # ls -l */*.dsk
-rw-r--r--    1 root     root     497124864 Jul 30 13:22 MR12.8_artifacts/root3380.dsk
-rw-r--r--    1 root     root     594010368 Jul 30 10:24 qs/root.dsk
/opt/multics #
```
プロジェクトとユーザを追加する「kazu_3380.ini」も以下の差分となりました。
```
*** kazu_3380.ini       2024-08-03 08:09:20.159326600 +0900
--- kazu.ini    2024-07-26 08:52:24.000000000 +0900
***************
*** 1,6 ****
  attach -r tape0 12.8MULTICS.tap
! set disk0 type=3380
! attach disk0 root3380.dsk

  set debug stdout
  set sys break
--- 1,5 ----
  attach -r tape0 12.8MULTICS.tap
! attach disk0 root.dsk

  set debug stdout
  set sys break
***************
*** 8,14 ****
  ; the following is required due to the empty autoinput responses provided in the script
  set opc0 config=noempty=on

! autoinput rpv a11 ipc 3380 0a\n

  ; bce (early) 0000.0: M->
  autoinput bce\n
--- 7,13 ----
  ; the following is required due to the empty autoinput responses provided in the script
  set opc0 config=noempty=on

! autoinput rpv a11 ipc 3381 0a\n

  ; bce (early) 0000.0: M->
  autoinput bce\n
```