cdc:nos2.source:nam5871:ns_nsi
Table of Contents
NS$NSI
Table Of Contents
- [00015] PROC NS$NSI
- [00016] NS$NSI - NS INITIALIZATION.
- [00020] NS INITIALIZATION.
- [00056] PROC CLOCK
- [00057] PROC DATE
- [00058] PROC EXINCSZ
- [00059] PROC FSTATUS
- [00060] PROC MOVEI
- [00061] PROC MOVEOK
- [00062] PROC NDLOVLD
- [00063] PROC NETREL
- [00064] PROC NETDBG
- [00066] PROC NETSTC
- [00068] PROC NS$MSG
- [00069] FUNC NS$XZFN C(10)
- [00070] PROC READ
- [00071] PROC READW
- [00072] PROC RECALL
- [00073] PROC REQTSB
- [00074] PROC RETTSB
- [00075] PROC RTIME
- [00076] PROC SKIPB
- [00077] PROC SKIPEI
- [00078] PROC SQUEEZE
- [00079] PROC TSBINFO
- [00080] PROC TSBINIT
- [00081] FUNC XCDD C(10)
Source Code
- NS$NSI.txt
- *DECK NS$NSI
- USETEXT COM$NS
- USETEXT CYB$NS
- USETEXT DEF$NS
- USETEXT DIR$NS
- USETEXT FERR$NS
- USETEXT FET$NS
- USETEXT HIS$NS
- USETEXT IOD$NS
- USETEXT LIN$NS
- USETEXT LTSB$NS
- USETEXT NCT$NS
- USETEXT NPT$NS
- USETEXT PRF$NS
- PROC NS$NSI;
- # TITLE NS$NSI - NS INITIALIZATION. #
- BEGIN # NS$NSI #
- #
- ** NS$NSI - NS INITIALIZATION.
- *
- * J.C. LEE 1981
- *
- * THIS ROUTINE PROCESS NS INITIALIZATION.
- *
- * PROC NS$NSI
- *
- * ENTRY:
- * NONE.
- *
- * EXIT:
- * NONE.
- *
- * METHOD:
- * - CLEAR NS NETTED-ON FLAG.
- * - CLEAR NS INITIALIZATION-DONE FLAG.
- * - SET DEFAULT CONTROL CARD PARAMETERS.
- * - CRACK CONTROL CARD PARAMETERS.
- * - INITIATE NPU DUMP FILE INDEX.
- * - INITIALIZE COM$COM COMMON AREA.
- * - MAKE SURE NEEDED FILES ARE LOCAL.
- * - PERFORM NETON PROCESSING.
- * - SEND NS VERSION, NCF BUILD DATE/TIME AND TITLE,
- * NLF BUILD DATE/TIME TO DAYFILE.
- * - BUILD THE NCT AND NPT.
- * - PRESET BASED ARRAY POINTERS FOR ALL NON-MOVABLE
- * BUFFERS.
- * - SET UP HISTORY BUFFER.
- * - SET NS INITIALIZATION-DONE FLAG.
- * IN ALL CASES, IF ERROR IS DETECTED, ISSUE MESSAGE
- * AND ABORT.
- *
- #
- XREF
- BEGIN
- PROC CLOCK; # GET TIME OF DAY #
- PROC DATE; # GET DATE #
- PROC EXINCSZ; # INCREASE TSB SIZE #
- PROC FSTATUS; # SEE IF FILE IS A LOCAL FILE #
- PROC MOVEI; # MOVE BLOCK OF WORDS #
- PROC MOVEOK; # ALLOW TSB TO MOVE #
- PROC NDLOVLD; # OVERLAY LOADER #
- PROC NETREL; # SET UP ZZZZZDN FILE #
- PROC NETDBG; # TURN ON/OFF AIP TRACE #
- *IF DEF,STAT
- PROC NETSTC; # GATHER STATISTICS #
- *ENDIF
- PROC NS$MSG; # DISPATCH MESSAGE #
- FUNC NS$XZFN C(10); # CONVERT BLANKS TO ZEROS #
- PROC READ; # READ A RECORD #
- PROC READW; # READ WORDS TO WORKING BUFFER #
- PROC RECALL; # WAIT UNTIL OPERATION IS COMPLETE #
- PROC REQTSB; # REQUEST A TSB #
- PROC RETTSB; # RETURN A TSB #
- PROC RTIME; # GET ELAPSED TIME SINCE DEADSTART #
- PROC SKIPB; # SKIP BACKWARDS #
- PROC SKIPEI; # SKIP TO END OF INFORMATION #
- PROC SQUEEZE; # CONSOLIDATE FREE SPACE #
- PROC TSBINFO; # GET TSB ADDRESS #
- PROC TSBINIT; # INITIALIZE TSB MANAGER #
- FUNC XCDD C(10); # INTEGER TO DECIMAL DISPLAY CODE #
- END
- DEF IBUFL # O"301" #; # INITIAL OPLD BUFFER LENGTH #
- DEF I$NCF # 0 #; # INDEX OF NCF IN FOR LOOP #
- DEF I$NLF # 1 #; # INDEX OF NLF IN FOR LOOP #
- DEF I$NRF1 # 2 #; # INDEX OF NRF1 IN FOR LOOP #
- DEF I$NRF2 # 3 #; # INDEX OF NRF2 IN FOR LOOP #
- DEF PRF$7700L # 15 #; # PREFIX TABLE LENGTH #
- # NAM LEVEL #
- *CALL NAMLEV
- ITEM BUFL U; # CALCULATED BUFFER LENGTH #
- ITEM CIOTSBADDR; # CIO BUFFER TSB ADDRESS #
- ITEM CIOTSBN U; # CIO BUFFER TSB NUMBER #
- ITEM ERRCODE U; # ERROR CODE RETURNED BY TABLE BUILDERS #
- ITEM FETTSBN U; # FET TSB NUMBER #
- ITEM FN C(10); # FILE NAME #
- ITEM I U; # LOOP INDEX #
- ITEM RETFWA U; # FREE TSB FWA RETURNED BY SQUEEZE #
- ITEM STATIS; # STATUS RETURNED BY NETSTC #
- ITEM TSBADDR U; # TSB ADDRESS #
- ITEM TSBN; # TSB NUMBER #
- ITEM TSBSIZE U; # TSB SIZE #
- ITEM UP; # LOOP LIMIT #
- ARRAY FILES [I$NCF:I$NRF2] S(1);
- BEGIN
- ITEM FILENAME C(00,00,04) = # FILE NAMES #
- [LFN$NCF,
- LFN$NLF,
- LFN$NRF1,
- LFN$NRF2];
- ITEM PROCNAME C(00,24,04) = # PROC NAMES #
- ["NDLP",
- "LFG "];
- ITEM INDXTSBN U(00,48,12); # DIRECTORY TSB NO. #
- END
- ARRAY HISL2 [I$NCF:I$NLF] S(3);
- BEGIN # LINE 2 OF HISTORY DISPLAY #
- ITEM HISL21 C(00,00,30) =
- ["NCF XX/XX/XX. XX.XX.XX., ",
- "NLF XX/XX/XX. XX.XX.XX. "];
- ITEM HISL2$DATE C(00,24,08);
- ITEM HISL2$TIME C(01,24,08);
- ITEM HISL2$Z U(02,18,42);
- END
- DEF FNAL # 3 #;
- DEF DM$FNA # DM$ABORT+DM$LOCAL #; # DIRECTIVES FOR MSG$FNA #
- ARRAY MSG$FNA [0:0] S(FNAL);
- BEGIN # FILE NOT AVAILABLE MESSAGE #
- ITEM FNA1 C(00,00,19) =
- ["XXXX NOT AVAILABLE."];
- ITEM FNA$FN C(00,00,04);
- ITEM FNA$Z U(01,54,06) = [ 0 ];
- ITEM FNA$Z1 U(02,00,60) = [0];
- END
- DEF DM$NLL # DM$NAMLOG + DM$LOCAL #;
- DEF NSLEVL$ # 2 #; # LENGTH OF NS LEVEL BUFF #
- DEF FVERSIONL$ # 3 #; # LENGTH OF FILE VERSION BUFF #
- DEF NCFTITL$ # 6 #; # LENGTH OF NCF TITLE BUFF #
- #
- * NSLEV - NS VERSION AND LEVEL BUFFER.
- #
- ARRAY NSLEV[00:00] S(NSLEVL$);
- BEGIN
- ITEM NLV$MSG C(00,00,14) = ["VER VER - LVL."];
- ITEM NLV$VER C(00,24,03);
- ITEM NLV$LVL C(01,00,03);
- ITEM NLV$ZRO U(01,24,36) = [0];
- END
- #
- * FVERSION - NCF/NLF BUILD DATE/TIME BUFFER.
- #
- ARRAY FVERSION[00:00] S(FVERSIONL$);
- BEGIN
- ITEM FVR$MSG C(00,00,23) =
- ["XXX YY/MM/DD, HH.MM.SS."];
- ITEM FVR$FN C(00,00,03);
- ITEM FVR$DATE C(00,24,08);
- ITEM FVR$TIME C(01,24,08);
- ITEM FVR$ZRO C(02,18,42) = [0];
- END
- #
- * NCFTIT - NCF TITLE BUFFER.
- #
- ARRAY NCFTIT[00:00] S(NCFTITL$);
- BEGIN
- ITEM NTL$TITLE C(00,00,50);
- ITEM NTL$ZRO U(05,00,60) = [0];
- END
- DEF FERRL # 3 #; # LENGTH OF MSG$FERR #
- DEF DM$FERR # DM$ABORT+DM$SYSLOC+DM$NAMLOG #;
- ARRAY MSG$FERR [0:0] S(FERRL);
- BEGIN # FILE ERROR CODE MESSAGE #
- ITEM FERR1 C(00,00,28) =
- ["NS/BAD XXX DIRECTORY RECORD."];
- ITEM FERR$LFN C(00,42,04); # NCF OR NLF #
- ITEM FERR$END U(02,48,12) = [0]; # END OF TEXT #
- END
- DEF NSVERL # HIS$LN1TL #;
- DEF DM$NSVER # DM$NAMLOG+DM$LOCAL #; # DIRECTIVES FOR MSG$NSVER #
- ARRAY MSG$NSVER [0:0] S(NSVERL);
- BEGIN
- ITEM NSVER1 C(00,00,28) =
- ["NS VERSION N.N, LEVEL XXXXX."];
- ITEM NSVER$VER C(01,06,03);
- ITEM NSVER$LEV C(02,12,05);
- ITEM NSVER$Z U(02,48,12) = [ 0 ];
- END
- ARRAY RTSEC [0:0] S(1);
- BEGIN
- ITEM RTIMESEC U(00,00,24);
- END
- BASED ARRAY BNAMLEV [0:0] S(2);
- BEGIN
- ITEM BNL$VER C(00,54,03);
- ITEM BNL$LEV C(01,18,05);
- ITEM BNL$LVL C(01,30,03);
- END
- BASED ARRAY JOTWORD [0:0] S(1);
- BEGIN
- ITEM JOT U(00,24,12);
- END
- ARRAY CRA$OVLY [0:0] S(1);
- BEGIN # CONTROL CARD CRACKER OVLY NAME AND LEVEL#
- ITEM CO$NAM C(00,00,07) = ["CRAOVLY"];
- ITEM CO$LV1 U(00,42,09) = [1];
- ITEM CO$LV2 U(00,51,09) = [1];
- END
- ARRAY NON$OVLY [0:0] S(1);
- BEGIN # NETON OVLERLAY NAME AND LEVEL #
- ITEM NON$NAM C(00,00,07) = ["NONOVLY"];
- ITEM NON$LV1 U(00,42,09) = [1];
- ITEM NON$LV2 U(00,51,09) = [2];
- END
- ARRAY BNCT$OVLY [0:0] S(1);
- BEGIN # BUILD NCT OVERLAY NAME AND LEVEL #
- ITEM BCO$NAM C(00,00,07) = ["BNCTOVL"];
- ITEM BCO$LV1 U(00,42,09) = [1];
- ITEM BCO$LV2 U(00,51,09) = [3];
- END
- ARRAY BNPT$OVLY [0:0] S(1);
- BEGIN # BUILD NPT OVERLAY NAME AND LEVEL #
- ITEM BPO$NAM C(00,00,07) = ["BNPTOVL"];
- ITEM BPO$LV1 U(00,42,09) = [1];
- ITEM BPO$LV2 U(00,51,09) = [4];
- END
- ARRAY IDN$OVLY [0:0] S(1);
- BEGIN # INITIATE DUMP FILE INDEX #
- ITEM IO$NAM C(00,00,07) = ["IDNOVLY"];
- ITEM IO$LV1 U(00,42,09) = [1];
- ITEM IO$LV2 U(00,51,09) = [5];
- END
- CONTROL EJECT;
- NSNETON = FALSE; # INITIALIZE TO NS NOT NETTED ON #
- NSINITDONE = FALSE; # INITIALIZATION NOT COMPLETE #
- P<JOTWORD> = JOTLOC;
- #
- SET DEFAULT CONTROL CARD PARAMETERS
- #
- NIN = 0;
- DN = 0;
- NDF$CT = 0; # INITIALIZE NPU DUMP FILE TO PRIVATE #
- NSM = ASC$NN; # INHIBIT NPU DUMP FOR STARTUP MODE #
- MC = 0; # NO PERIODIC RELEASE OF DEBUG LOG FILE #
- RT = ASC$NN; # NO RELEASE OF TRACE FILES #
- NDLOVLD(CRA$OVLY); # CRACK CONTROL CARD PARAMETERS #
- NDLOVLD(IDN$OVLY); # INITIATE NPU DUMP FILE INDEX #
- #
- INITIALIZE COM$COM COMMON AREA
- #
- GRADSHUT = FALSE; # IDLE SHUTDOWN NOT ON #
- FORCESHUT = FALSE; # FORCE SHUTDOWN NOT ON #
- DCW$WORD[0] = 0; # CLEAR DISPLAY CONTROL WORD #
- NSU$WORD[0] = 0; # CLEAR NSUP WORD #
- LTW$WORD[0] = 0; # CLEAR LOAD TSB WORD #
- ZDMBID$PID[0] = NSDMBID; # SET NS ZZZZDMB FILE ID #
- ZDMBID$DN[0] = 0; # CLEAR ZZZZDMB DUMP RECORD NUMBER #
- HISTSBN = 0;
- NRF1$LFN = NS$XZFN(LFN$NRF1); # ZERO-FILLED LFN NRF1 #
- NRF2$LFN = NS$XZFN(LFN$NRF2); # ZERO-FILLED LFN NRF2 #
- TSBINIT; # INITIALIZE TSB MANAGER #
- # MAKE SURE NEEDED FILES ARE LOCAL #
- REQTSB(L$LFET,TSBADDR,FETTSBN);
- P<SIOFET> = TSBADDR; # FORMAT FET #
- FETCMPT[0] = TRUE;
- FETLEN[0] = L$LFET - 5;
- UP = I$NLF; # SET LOOP LIMIT #
- $BEGIN
- UP = I$NRF2; # SET LOOP LIMIT #
- $END
- FOR I = I$NCF STEP 1 UNTIL UP
- DO
- BEGIN # MAKE SURE NEEDED FILES ARE LOCAL #
- FETLFN[0] = NS$XZFN(FILENAME[I]);
- FSTATUS(SIOFET); # DETERMINE IF FILE IS LOCAL #
- IF FETSTATUS[0] EQ 0
- THEN # FILE NOT FOUND #
- BEGIN
- FNA$FN[0] = FILENAME[I];
- NS$MSG(MSG$FNA,FNAL,DM$FNA);
- END
- END
- $BEGIN
- IF MC NQ 0
- THEN
- NETREL(NRF1$LFN,MAX$TMSGSZ,0);
- ELSE # SET MESSAGE SIZE FOR ZZZZZDN ONLY #
- NETREL(0,MAX$TMSGSZ,0);
- $END
- # PERFORM NETON PROCESSING #
- NDLOVLD(NON$OVLY);
- NETDBG(1,1,STATIS); # TURN AIP TRACE OFF #
- # GET NS VERSION #
- P<BNAMLEV> = LOC(NAMLEV);
- PRNAME[0] = "NS"; # SAVE NS VERSION/LEVEL #
- PRVER[0] = BNL$VER[0];
- PRLEV[0] = BNL$LEV[0];
- NSVER$VER[0] = BNL$VER[0];
- NSVER$LEV[0] = BNL$LEV[0];
- #
- * SEND NS VERSION AND LEVEL NUMBER TO NAM DAYFILE.
- #
- NLV$VER[0] = BNL$VER[0];
- NLV$LVL[0] = BNL$LVL[0];
- NS$MSG(NSLEV, NSLEVL$, DM$NLL);
- # OPEN NCF AND NLF #
- FETRAN[0] = TRUE; # THEY ARE BOTH RANDOM FILES #
- REQTSB(IBUFL,CIOTSBADDR,CIOTSBN); # GET CIO BUFFER #
- FOR I = I$NCF STEP 1 UNTIL I$NLF
- DO # OPEN FILES #
- BEGIN
- FETLFN[0] = NS$XZFN(FILENAME[I]);
- FETBIN[0] = TRUE; # BINARY FILE #
- FETCMPT[0] = TRUE; # COMPLETE BIT #
- FETFST[0] = CIOTSBADDR; # FIRST #
- FETIN[0] = CIOTSBADDR;
- FETOUT[0] = CIOTSBADDR;
- FETLMT[0] = CIOTSBADDR + IBUFL; # LIMIT #
- SKIPEI(SIOFET);
- SKIPB(SIOFET,2);
- READ(SIOFET);
- RECALL(SIOFET);
- P<PRF$TABLE> = CIOTSBADDR;
- P<DIR> = CIOTSBADDR + PRF$7700L; # FORMAT DIRECTORY #
- IF PRF$ID[0] NQ PRF$IDENT
- OR DIR$FID[0] NQ C<0,3>FILENAME[I]
- THEN
- BEGIN # BAD OPLD #
- FERR$LFN[0] = FILENAME[I];
- NS$MSG(MSG$FERR,FERRL,DM$FERR); # DAYFILE AND ABORT #
- END
- HISL2$DATE[I] = PRF$DATE[0]; # FILE CREATION DATE #
- HISL2$TIME[I] = PRF$TIME[0]; # FILE CREATION TIME #
- #
- * SEND FILE BUILD DATE AND TIME AND TITLE TO NAM DAYFILE.
- #
- FVR$FN[0] = FILENAME[I];
- FVR$DATE[0] = PRF$DATE[0];
- FVR$TIME[0] = PRF$TIME[0];
- NS$MSG(FVERSION, FVERSIONL$, DM$NLL);
- IF FILENAME[I] EQ LFN$NCF
- THEN
- BEGIN
- NTL$TITLE[0] = PRF$TITLE[0]; # SEND NCF TITLE #
- NS$MSG(NCFTIT, NCFTITL$, DM$NLL);
- END
- REQTSB(DIR$WC[0] + 1,TSBADDR,TSBN); # GET DIRECTORY BUFFER #
- INDXTSBN[I] = TSBN;
- P<PRF$TABLE> = TSBADDR;
- FETOUT[0] = FETOUT[0] + PRF$7700L; # SKIP OVER 7700 TABLE #
- READW(SIOFET,PRF$TABLE,DIR$WC[0] + 1,STATIS); # READ DIR. #
- END # END OF NCF OR NLF PROCESSING #
- RETTSB(CIOTSBN);
- NLFINDTSBN = INDXTSBN[I$NLF]; # SAVE NLF INDEX TSB #
- # BUILD THE NCT AND NPU TABLE #
- FETLFN[0] = NS$XZFN(FILENAME[I$NCF]);
- TSBINFO(TSBSIZE,TSBADDR,INDXTSBN[I$NCF]);
- P<DIR> = TSBADDR; # FORMAT DIRECTORY #
- FERR$LFN[0] = FILENAME[I$NCF];
- NDLOVLD(BNCT$OVLY,ERRCODE); # BUILD THE NCT #
- NDLOVLD(BNPT$OVLY,ERRCODE); # BUILD NPU TABLE #
- RETTSB(INDXTSBN[I$NCF]); # RETURN NCF DIRECTORY #
- RETTSB(FETTSBN); # RETURN FET #
- RTIME(RTSEC); # GET SECONDS SINCE DEADSTART #
- NMTIME = RTIMESEC[0] + ITIMER; # TIME TO REVERT TO NORMAL MODE #
- MOVEOK(NLFINDTSBN);
- MOVEOK(NCTTSBN);
- MOVEOK(NPTTSBN);
- SQUEEZE(0,RETFWA); # PACK FIXED-SIZE PERMANENT TSBS TOGETHER #
- # PRESET BASED ARRAY POINTERS FOR ALL NON-MOVABLE BUFFERS #
- TSBINFO(TSBSIZE,TSBADDR,NLFINDTSBN);
- NLFDIRFWA = TSBADDR; # FWA OF DEFAULT NLF DIRECTORY #
- P<DIR> = TSBADDR;
- TSBINFO(TSBSIZE,TSBADDR,NCTTSBN);
- P<NCT$NS> = TSBADDR;
- TSBINFO(TSBSIZE,TSBADDR,NPTTSBN);
- P<NPT$HEADER> = TSBADDR;
- P<NPT$ENTRY> = TSBADDR + NPT$HDRL;
- # SET UP HISTORY BUFFER #
- HISL2$Z[I$NLF] = 0; # SET LINE TERMINATOR #
- REQTSB(HIS$HDRL,TSBADDR,HISTSBN);
- P<HIS$BUFFER> = TSBADDR; # FORMAT HISTORY BUFFER #
- P<LIN$HEADER> =TSBADDR + HIS$HDRWDL; # FORMAT HISTORY LINE 1 #
- LIN$HDRWD[0] = 0;
- LIN$ID[0] = LIN$IDENT; # LINE IDENTIFIER #
- LIN$LNSIZE[0] = HIS$LN1TL + LIN$HDRL; # LINE SIZE #
- MOVEI(HIS$LN1TL,LOC(MSG$NSVER),P<LIN$HEADER>+LIN$HDRL); # MOVE LI#
- P<LIN$HEADER> = P<LIN$HEADER> + LIN$HDRL + HIS$LN1TL;
- LIN$HDRWD[0] = 0; # FORMAT HISTORY LINE 2 #
- LIN$ID[0] = LIN$IDENT; # LINE IDENTIFIER #
- LIN$LNSIZE[0] = HIS$LN2TL + LIN$HDRL; # LINE SIZE #
- MOVEI(HIS$LN2TL,LOC(HISL2),P<LIN$HEADER>+LIN$HDRL); # MOVE LINE 2#
- HIS$ID[0] = HIS$IDENT; # SET BUFFER IDENTIFIER #
- HIS$WC[0] = HIS$HDRL; # HISTORY BUFFER HEADER LENGTH #
- HIS$LC[0] = 2; # SET LINE COUNT #
- NSINITDONE = TRUE; # SET INITIALIZATION COMPLETED #
- RETURN;
- END # NS$NSI #
- TERM
cdc/nos2.source/nam5871/ns_nsi.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator