# Builds a bootable dectape image for TD8E with 12K memory.
# With pieces taken from os8v3d-patched.rk05,
# the os8v3d device driver distribution DECtape,
# the os8v3f-build rk05

mount rk0 ./os8v3d-patched.rk05 must-exist
mount rk1 ./os8-v3f-build.rk05 must-exist
mount dt0 ./system.tu56 no-overwrite
mount dt1 ../media/os8/al-4712c-ba-os8-v3d-2.1978.tu56 read-only must-exist

boot rk0

os8 COPY DSK:<RKB1:OS8.BN,CD.BN

begin build RKB1:BUILD
LOAD DTA1:RK8ESY.BN
LOAD DTA1:RK8ENS.BN
LOAD DTA1:PT8E.BN

# TC08 systems uncomment next 2 lines.
# LOAD DTA1:TC08SY.BN
# LOAD DTA1:TC08NS.BN

# TD8E systems with 12K uncomment next line.
# LOAD DTA1:TD8ESY.BN
# TD8E systems with ROM uncomment next line.
LOAD DTA1:ROMMSY.BN

# TD8E non-system handler.
LOAD DTA1:TD8EA.BN

# Additional TD8E non-system devices
# Units 2 and 3.
# LOAD DTA1:TD8EB.BN
# Units 4 and 5.
# LOAD DTA1:TD8EC.BN
# Units 6 and 7.
# LOAD DTA1:TD8ED.BN

# I think we want the RKB1 version of KL8E.BN
LOAD DTA1:KL8E.BN
LOAD DTA1:LPSV.BN
LOAD RKB1:RXSY2.BN
LOAD RKB1:RXNS.BN

INSERT PT8E,PTR
INSERT PT8E,PTP
INSERT KL8E,TTY
INSERT LPSV,LPT

# Un-comment next 4 lines for TC08 System
# SYSTEM TC08
# INSERT TC08,DTA0
# INSERT TC,DTA1
# DSK TC08:DTA0

# Un-comment next 4 lines for TD8E 12K System
# SYSTEM TD8E
# INSERT TD8E,DTA0
# INSERT TD8E,DTA1
# DSK TD8E:DTA0

# Un-comment next 4 lines for TD8E ROM System
SYSTEM ROM
INSERT ROM,DTA0
INSERT ROM,DTA1
DSK ROM:DTA0

# Non-system Handlers.  Un-comment additional ones.
INSERT TD8A,DTA0
INSERT TD8A,DTA1
# INSERT TD8B,DTA2
# INSERT TD8N,DTA3
# INSERT TD8C,DTA4
# INSERT TD8C,DTA5
# INSERT TD8D,DTA6
# INSERT TD8D,DTA7

INSERT RX02,RXA0

INSERT RK05,RKA0,RKB0
INSERT RK05,RKA1,RKB1
INSERT RK05,RKA2,RKB2

BUILD DSK:OS8.BN DSK:CD.BN
BOOT
end build

os8 SAVE DTA0 BUILD.SV

begin cdprog RKA0:FOTP.SV
DTA0:<RKA0:FOTP.SV
DTA0:<RKA0:DIRECT.SV
DTA0:<RKB1:CCL.SV
DTA0:<RKB1:RESORC.SV
end cdprog RKA0:FOTP.SV

boot dt0

os8 R CCL
