.;
.;  COMMAND FILE TO GENERATE RSX COMMUNICATIONS DRIVER
;   COMMAND FILE TO GENERATE RSX COMMUNICATIONS DRIVER
;   VERSION 1.0   OCT1882
;
.;
.;  VERSION 1.0
.;     VICKY WHITE 
.;     COMPUTER GROUP
.;     FNAL, BATAVIA, IL 60510
.; 
.;  UPDATES:
.;  V1.0  VW - OCT1882  ORIGINAL VERSION
.;
.;
.ENABLE SUBSTITUTION
.ENABLE ESCAPE
.SETS DATE <DATE>
.SETS UIC <UIC>
ASN SY:=FL:
.ASKS DK ENTER DISC TO BE USED FOR CD DRIVER BUILDING (IN FORM DK0:)[DEFAULT SY:]
.IF DK NE "" ASN 'DK'=SY:
.ASK DB GENERATE DRIVER DATA BASE CONDITIONALS 
.IFF DB .GOTO 1
.; --------------------------------------------------------------------
.; CREATE THE CONDITIONALS FILE FOR THE DRIVER
.; -------------------------------------------
.;
.OPEN CDC.MAC
.ENABLE DATA
;
;  CONDITIONALS FILE FOR RSX COMMUNICATIONS DRIVER
;  GENERATED   'DATE'
;
.DISABLE DATA
.ASK LOAD LOADABLE DRIVER
;  THE DRIVER MAY BE GENERATED WITH A TRACE FEATURE INVOKED WHICH
;  WILL CAUSE EVERY INTERRUPT, I/O REQUEST, I/O COMPLETION AND
;  OTHER RELEVANT ACTIONS TO BE TRACED IN A TRACE COMMON AREA OF
;  MEMORY.  THIS FEATURE INCURS CONSIDERABLE OVERHEAD, BUT IS
;  EXTREMELY USEFUL IN DEBUGGING AND TRACKING DOWN HARDWARE PROBLEMS
;  
;  EVEN IF THE TRACE FEATURE IS ASSEMBLED IN THE DRIVER TRACING
;  MAY BE DISABLED BY LOADING THE DRIVER WITHOUT A PARTITION NAME
;  CDTRAC PRESENT IN THE SYSTEM. THIS ELIMINATES 95% OF THE OVERHEAD
;  OF HAVING THE TRACE FEATURE PRESENT.  TRACING MAY ALSO BE TEMPORARILY
;  DISABLED BY "FREEZING" THE TRACE WITH THE TRACE DUMP PROGRAM CDDUMP.
;  "FREEZING" THE TRACE CUTS THE OVERHEAD OF TRACING BY 50%.
;  TRACING MAY HAVE A TIME OVERHEAD AS HIGH AS 5 MS PER TRANSFER AND
;  THE DRIVER CODE IS INCREASED IN SIZE BY APPROXIMATELY 500 WORDS.
;
.ASK TRACE GENERATE DRIVER WITH TRACE FEATURE
.IFT TRACE .DATA TRCE=1           ;TRACE FEATURE
.SETN NXTVEC 300
.SETN NXTCSR 172414
.IFT LOAD .DATA LD$CD=0          ;LOADABLE DRIVER
.0:
; THIS DRIVER PRIMARILY SUPPORTS DR11W HARDWARE. IT ALSO SUPPORTS
; AN INTERNAL COMMUNICATIONS LINK  AND MAY OPTIONALLY BE ASSEMBLED
; WITHOUT ANY PHYSICAL DR11W DEVICE SUPPORT
;
.SETN PR 0
.ASKN [0:7:1] NDR11W ENTER NUMBER OF DR11W DEVICES
.DATA D$$11W='NDR11W'         ;NUMBER OF DR11W UNITS
.SETN CONTR 0
.SETN NUM 1
.IF NDR11W EQ 0 .GOTO 3
.2: .GOSUB VECCSR
.INC NUM
.INC CONTR
.IF NUM LE NDR11W .GOTO 2
.ASKN [0:7:5] PR ENTER DR11W DEVICE PRIORITY
.3:
.SETN PR PR*40
.DATA CDPR='PR'           ;DR11W DEVICE PRIORITY
.500:
.ASK IC INTERNAL COMMUNICATIONS LINK WANTED
.IFF IC .GOTO 510
.DATA ICDRV=0          ;INTERNAL COMMUNICATIONS LINK DEFINED
.DATA VEC$'CONTR'=0          ;VECTOR FOR INTERNAL COMMUNICATIONS UNIT 'CONTR'
.DATA CSR$'CONTR'=0          ;CSR FOR INTERNAL COMMUNICATIONS UNIT 'CONTR'
.510:
.SETN CDTOT NDR11W
.IFT IC .INC CDTOT
.IF CDTOT GT 0 .GOTO 520
; ERROR NO CD UNITS DEFINED
.GOTO 0
.520:
.DATA CD$NUM='CDTOT'         ;TOTAL NUMBER OF CD UNITS (INCLUDING
.DATA                  ;INTERNAL COMMUNICATIONS DEVICE UNIT)
.ENABLE DATA
;
;;;;OLD=0       ;DEFINED ONLY IF WANT TO RESURRECT OLD CODE WHICH
;               ALLOWED THE DR11W TO INTERRUPT THE TRANSMITTER ATE
;               THE END OF THE DMA. HARDWARE PROBLEMS WITH THE 
;               "DOUBLE" INTERRUPT CAUSED BY THIS END OF DMA FOLLOWED
;               BY THE RECEIVERS END OF MESSAGE INTERRUPT MEANT THIS
;               WAS ABANDONED IN FAVOUR OF TRANSMITTER SETTING WC TO
;               2 MORE THAN INTENDED AND WAITING FOR RECEIVERS EOM INT.
;
;;;;DBUG=0	;IF DEFINED TIMEOUT VALUES EXTENDED FOR DEBUG
;
.DISABLE DATA
.CLOSE CDC.MAC
.GOTO 1
.;  SUBROUTINE TO GET THE VECTOR AND CSR FOR EACH DR11W
.;
.VECCSR:
.ASKN [0:700:'NXTVEC'] VEC VECTOR FOR DR11W UNIT 'CONTR'
.ASKN [::'NXTCSR'] CSR CSR FOR DR11W UNIT 'CONTR'
.DATA VEC$'CONTR'='VEC'        ;VECTOR FOR UNIT 'CONTR'
.DATA CSR$'CONTR'='CSR'     ;CSR FOR UNIT 'CONTR'
.SETN NXTVEC  NXTVEC+4
.SETN NXTCSR  NXTCSR+4
.RETURN
.;
.;----------------------------------------------------------------------
.; ASSEMBLE AND BUILD CD DRIVER AND TABLES
.; ---------------------------------------
.;
.;
.1:
.ASK ASMD ASSEMBLE DRIVER
.IFF ASMD .GOTO 10
.SETS DLIST ""
.ASK LST LISTING
.IFF LST .GOTO 5
.SETS DLIST "CDDRV/-SP"
.ASK DCR CROSS REFERENCE
.IFT DCR .SETS DLIST DLIST+"/CR"
.5:
.OPEN ASMD.ASM
.ENABLE DATA
CDDRV,'DLIST'=LB:[1,1]EXEMC/ML,LB:[200,200]RSXMC,SY:'UIC'CDC,CDPREF,CDDRV
.DISABLE DATA
.CLOSE
.10:
.ASK ASMT ASSEMBLE DRIVER TABLES
.IFF ASMT .GOTO 20
.SETS TLIST ""
.ASK LST LISTING
.IFT LST .SETS TLIST "CDTAB/-SP"
.OPEN ASMT.ASM
.ENABLE DATA
CDTAB,'TLIST'=LB:[1,1]EXEMC/ML,[200,200]RSXMC,SY:'UIC'CDC,CDPREF,CDTAB
.DISABLE DATA
.CLOSE
.20:
.ASK BLD BUILD DRIVER
.IFF BLD .GOTO 50
.ASK PURGE PURGE OLD VERSIONS AFTER BUILD
.OPEN CDDRV.TKB
.ENABLE DATA
LB:[1,54]CDDRV/-HD/-MM,CDDRV/-SP/MA,[1,54]CDDRV=
;LB:[1,54]CDDRV/-HD/-MM,,[1,54]CDDRV=
SY:'UIC'CDDRV,CDTAB,LB:[1,54]RSX11M.STB/SS
LB:[1,1]EXELIB/LB
/
STACK=0
PAR=GEN:120000:20000
//
.DISABLE DATA
.CLOSE
.50:
.IFT ASMD MAC @ASMD.ASM
.IFT ASMD PIP ASMD.ASM;*/DE
.IFT ASMT MAC @ASMT.ASM
.IFT ASMT PIP ASMT.ASM;*/DE
.IFF BLD .GOTO 100
.SETS UIC <UIC>
SET /UIC=[1,54]
TKB @SY:'UIC'CDDRV.TKB
.IFT PURGE PIP LB:CDDRV.*/PU
SET /UIC = 'UIC'
PIP CDDRV.TKB;*/DE
PIP *.ASM;*/DE
PIP CDDRV.OBJ/PU
.;
.; ---------------------------------------------------------------------
.; ASSEMBLE AND BUILD DRIVERS TRACE DUMP PROGRAM (AND RELATED PROGRAMS)
.; ---------------------------------------------
.;
.100:
.ASK DUMP BUILD THE DUMP PROGRAM TO DECODE THE DRIVERS TRACE
.IFT DUMP @CDDUMP
.ASK TRIN BUILD A PROGRAM TO CREATE A TRACE BUFFER DYNAMIC REGION
.IFF TRIN .GOTO 110
@CDTRIN
;
;  IF DIGITAL PATHWAYS BULK MEMORY IS BEING USED ON THE SYSTEM
;  THEN THE TRACE BUFFER DYNAMIC REGION CAN BE MAPPED TO SOME
;  NON-STANDARD BLOCKS OF BULK MEMORY, THUS ALLOWING THEM TO 
;  BE PRESERVED THROUGH A BOOTSTRAP.  
;
.110:
.ASK BMM BUILD THE BULK MEMORY MAPPING TASK
.IFF BMM .GOTO 9
.ASKS BMMUIC UIC FOR BMM TASK
SET /UIC='BMMUIC'
@BMM
SET /UIC='UIC'
.;
.9:
.; --------------------------------------------------------------------
.; CREATE COMMAND FILE TO LOAD DRIVER AND INSTALL RELATED SOFTWARE
.; -------------------
.;
.ASK CMD GENERATE COMMAND FILE FOR INSTALLATION OF CD
.IFF CMD .GOTO 120
;
; FILE CDINS.CMD WILL BE GENERATED - CAN BE USED ALONE
; OR CALLED FROM THE STARTUP COMMAND FILE
;
.OPEN CDINS.CMD
.IFT BMM .DATA RUN 'UIC':BMM
.IFF BMM .DATA ;;;; RUN 'UIC':BMM
.IFT TRACE .DATA RUN 'UIC':CDTRIN
.IFF TRACE .DATA ;;; RUN 'UIC':BMM
.DATA LOA CD:
.IFT TRACE .DATA INS 'UIC':CDDUMP/TASK=...CDD
.IFF TRACE .DATA ;;; INS 'UIC':CDDUMP/TASK=...CDD
.CLOSE CDINS.CMD
.120:
ASN FL:=SY:
.EXIT
