User Tools

Site Tools


cdc:nos2.source:nam5871:ns_n00

NS$N00

Table Of Contents

  • [00016] PROC NS$N00(ERRCODE)
  • [00018] NS$N00 - PROCESS NPU LOAD REQUEST.
  • [00022] PROCESS NPU LOAD REQUEST.
  • [00087] PROC NS$DBG
  • [00093] PROC MOVEOK
  • [00094] PROC NETPUT
  • [00095] PROC NS$FBH
  • [00096] FUNC NS$FEC U
  • [00097] PROC NS$FLR
  • [00098] PROC NS$INL
  • [00099] PROC NS$LSN
  • [00100] PROC NS$MSG
  • [00101] PROC NS$NAI
  • [00102] PROC NS$SGT
  • [00103] PROC NS$SLT
  • [00104] PROC NS$XPD
  • [00105] FUNC NS$XZFN C(10)
  • [00106] PROC READ
  • [00107] PROC RECALL
  • [00108] PROC REQTSB
  • [00109] PROC RETTSB
  • [00110] PROC TSBINFO

Source Code

NS$N00.txt
  1. *DECK NS$N00
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT ERR$NS
  5. USETEXT LTSB$NS
  6. USETEXT NAT$NS
  7. USETEXT NCT$NS
  8. USETEXT NDCB$NS
  9. USETEXT NPT$NS
  10. USETEXT NST$NS
  11. USETEXT PFC$NS
  12. USETEXT PIC$NS
  13. USETEXT SMB$NS
  14. USETEXT SMD$NS
  15.  
  16. PROC NS$N00(ERRCODE); # PROCESS NPU LOAD REQUEST #
  17.  
  18. # TITLE NS$N00 - PROCESS NPU LOAD REQUEST. #
  19.  
  20. BEGIN # NS$N00 #
  21. #
  22. ** NS$N00 - PROCESS NPU LOAD REQUEST.
  23. *
  24. * J.C. LEE 1981
  25. *
  26. * THIS ROUTINE PROCESS NPU LOAD REQUEST.
  27. *
  28. * PROC NS$N00(ERRCODE)
  29. *
  30. * ENTRY:
  31. * NPU-TABLE ORDINAL.
  32. *
  33. * EXIT:
  34. * ERRCODE - IF SPCB IS MISSING.
  35. *
  36. * METHOD:
  37. * IF NOT IN GRADUAL SHUTDOWN MODE:
  38. * PERFORM NPU ACTIVITY INITIALIZATION.
  39. * UPDATE NCT TABLE ENTRY.
  40. * SET NPU-PRIMARY-STATE TO "LOADING NPU".
  41. * EXTRACT NPU-VARIANT FROM NPT TABLE ENTRY.
  42. * FIND LOAD PARTITION TO LOCATE PICB.
  43. * IF ERRCODE EQ 0:
  44. * ALLOCATE TSB FOR PICB.
  45. * READ LOGICL RECORD TO READ PICB.
  46. * ACCESS RECORD-HEADER OF LOAD-PARTITION RECORD.
  47. * IF RECORD-NAME EQ NPU-VARIANT NAME:
  48. * STORE ASSIGNED TSBN FROM PICB IN NAT.
  49. * CASE ON LOAD TYPE:
  50. * 1) SAM BOOTSTRAP LOAD:
  51. * IF SPICB EXISTS IN PICB:
  52. * SET XPCB-DIRECTIVE-INDEX TO
  53. * PICB INDEX OF SPCB-HEADER.
  54. * VALIDATE SPCB SIZE.
  55. * SET XPCB-END-DIRECTIVE-INDEX TO
  56. * PICB-INDEX OF SPCB END DIRECTIVE.
  57. * SET NPU-PRIMARY-STATE TO "LOADING SAM".
  58. * FORMAT EVENT MESSAGE AND DISPATCH IT.
  59. * START GLOBAL TIMER.
  60. * PROCESS NEXT XPCB DIRECTIVE.
  61. * ELSE
  62. * SET ERRCODE TO "SPCB MISSING".
  63. * 2) LOCAL-NPU OR REMOTE-NPU LOAD:
  64. * IF LOAD-TYPE IS REMOTE-NPU LOAD
  65. * SET REMOTE-LOAD-INDICATOR IN NAT.
  66. * IF NDCB-ADDRESS NONZERO:
  67. * SET NPU-PRIMARY-STATE TO
  68. * "WAITING FOR DUMP NDCB RESPONSE".
  69. * FORMAT EVENT MESSAGE AND DISPATCH IT.
  70. * STORE NDCB-ADDRESS IN XPCB-DIRECTIVE.
  71. * FORMAT OVL/DT/R AND NETPUT IT.
  72. * START LOCAL TIMER.
  73. * ELSE
  74. * SET SELF-LOADING-INDICATOR IN NAT.
  75. * INITIATE NPU LOAD.
  76. * PROCESS NEXT XPCB DIRECTIVE.
  77. * ELSE
  78. * SET ERRCODE.
  79. *
  80. #
  81.  
  82. ITEM ERRCODE U; # ERROR CODE #
  83.  
  84. $BEGIN
  85. XREF
  86. BEGIN
  87. PROC NS$DBG; # TRACE PROCEDURE CALL #
  88. END
  89. $END
  90.  
  91. XREF
  92. BEGIN
  93. PROC MOVEOK; # ALLOW TSB TO MOVE #
  94. PROC NETPUT; # NETPUT #
  95. PROC NS$FBH; # FORMAT SPECIAL ABH #
  96. FUNC NS$FEC U; # FORMAT ERROR CODE #
  97. PROC NS$FLR; # FIND LOAD RECORD #
  98. PROC NS$INL; # INITIATE NPU LOAD #
  99. PROC NS$LSN; # INCREMENT LOAD SEQUENCE NUMBER #
  100. PROC NS$MSG; # DISPATCH MESSAGE #
  101. PROC NS$NAI; # INITIALIZE NPU ACTIVITY #
  102. PROC NS$SGT; # START ACTIVITY TIMER #
  103. PROC NS$SLT; # START RESPONSE TIMER #
  104. PROC NS$XPD; # PROCESS NEXT XPCB DIRECTIVE #
  105. FUNC NS$XZFN C(10); # ZERO-FILLED FILE NAME #
  106. PROC READ; # READ RECORD #
  107. PROC RECALL; # RECALL #
  108. PROC REQTSB; # REQUEST TSB #
  109. PROC RETTSB; # RELEASE TSB #
  110. PROC TSBINFO; # LOCATE TSB #
  111. END
  112.  
  113. ITEM BACKPTR U; # BACK POINTER #
  114. ITEM HEADPTR U; # HEAD POINTER #
  115. ITEM LFN C(7); # LFN OF NPU LOAD FILE #
  116. ITEM LT S:LOADTYPE; # \PU LOAD TYPE #
  117. ITEM NCTORD U; # NODE CONNECTION TABLE ORDINAL #
  118. ITEM NDCBFWA U; # FWA OF NDCB #
  119. ITEM NEXTPTR U; # NEXT POINTER #
  120. ITEM NPUVAR C(6); # NPU VARIANT NAME #
  121. ITEM PCBCI I; # PICB INDEX OF FIRST SPCB DIRECTIVE #
  122. ITEM PCBLI I; # PICB INDEX FOR LAST SPCB DIRECTIVE #
  123. ITEM PCBSIZE U; # SPCB SIZE #
  124. ITEM PICBSIZE U; # PICB SIZE #
  125. ITEM RI U; # RANDOM INDEX #
  126. ITEM TSBFWA U; # TSB FWA #
  127. ITEM TSBN U; # TSB NUMBER #
  128. ITEM TSBSIZE U; # TSB SIZE #
  129.  
  130. ARRAY PICBFET [1:L$LFET] S(1);
  131. BEGIN
  132. ITEM FETWORD U(0,0,60) = [L$LFET(0)];
  133. END
  134.  
  135. DEF L$EM10 # 3 #;
  136. DEF DM$EM10 # DM$LOCAL+DM$EVENT+DM$NAMLOG #; # ROUTING OPT #
  137. ARRAY MSG$EM10 [0:0] S(L$EM10);
  138. BEGIN
  139. ITEM EM10$TEXT C(0,0,27) = # EVENT MESSAGE TEXT #
  140. ["NPUNAME, SAM LOAD STARTED."];
  141. ITEM EM10$NPNAM C(0,00,7); # NPU NAME #
  142. ITEM EM10$END U(02,42,18) = [0]; # END OF TEXT #
  143. END
  144.  
  145. DEF L$EM20 # 4 #;
  146. DEF DM$EM20 # DM$LOCAL+DM$EVENT+DM$NAMLOG #; # ROUTING OPT #
  147. ARRAY MSG$EM20 [0:0] S(L$EM20);
  148. BEGIN
  149. ITEM EM20$TEXT C(0,0,37) = # EVENT MESSAGE TEXT #
  150. ["NPUNAME, DUMP/LOAD(VARIAN) REQUESTED."];
  151. ITEM EM20$NPNAM C(0,00,7); # NPU NAME #
  152. ITEM EM20$NPVAR C(1,54,6); # NPU VARIANT #
  153. ITEM EM20$END U(3,42,18) = [0]; # END OF TEXT #
  154. END
  155.  
  156. SWITCH LTCASE:LOADTYPE # STATUS SWITCH FOR NPU LOAD TYPE #
  157. SAM:LT$SAM, # SAM LOAD #
  158. LOCAL:LT$LOCAL, # LOCAL NPU LOAD #
  159. REMOTE:LT$REMOT; # REMOTE NPU LOAD #
  160.  
  161. CONTROL EJECT;
  162. $BEGIN
  163. NS$DBG("N00"); # TRACE CALL #
  164. $END
  165.  
  166. ERRCODE = 0;
  167.  
  168. IF NOT GRADSHUT
  169. THEN # NOT IN GRADUAL SHUTDOWN MODE #
  170. BEGIN
  171. NS$NAI; # INITIALIZE NPU ACTIVITY #
  172.  
  173. NAT$PN[0] = NPUPO[0]; # SET PORT NUMBER OF TRUNK #
  174. NAT$SPN[0] = NPUSP[0]; # SET SUBPORT NUMBER OF TRUNK #
  175. NCTORD = NAT$NCTORD[0]; # NODE CONNECTION TABLE ORDINAL #
  176. NCT$F$ACT[NCTORD] = TRUE; # SET NEIGHBOR NPU ACTIVE FLAG #
  177.  
  178. HEADPTR = NCT$LISTHP[0]; # HEAD PTR OF LIST #
  179. IF HEADPTR NQ NCTORD
  180. THEN # NCT ENTRY NOT AT HEAD OF LIST #
  181. BEGIN # LINK NCT ENTRY TO HEAD OF LIST #
  182. NEXTPTR = NCT$LISTFP[NCTORD];
  183. BACKPTR = NCT$LISTBP[NCTORD];
  184. NCT$LISTFP[BACKPTR] = NEXTPTR;
  185. NCT$LISTBP[NEXTPTR] = BACKPTR;
  186. NCT$LISTHP[0] = NCTORD;
  187. NCT$LISTBP[HEADPTR] = NCTORD;
  188. NCT$LISTFP[NCTORD] = HEADPTR;
  189. NCT$LISTBP[NCTORD] = 0;
  190. END
  191.  
  192. NAT$PSTATE[0] = S"NPS$LNPU"; # PRIMARY STATE = LOADING NPU #
  193. NPUVAR = NPT$NPUVAR[NTORD]; # NPU VARIANT NAME #
  194.  
  195. NS$FLR(NPUVAR,RI,PICBSIZE,ERRCODE); # LOCATE PICB RECORD #
  196.  
  197. IF PICBSIZE LS PRUSIZE
  198. THEN # CIO BUFFER MUST BE AT LEAST ONE PRU LONG #
  199. PICBSIZE = PRUSIZE;
  200. IF ERRCODE EQ 0
  201. THEN # PICB RECORD FOUND #
  202. BEGIN
  203. REQTSB(PICBSIZE+1,TSBFWA,TSBN); # REQUEST TSB FOR PICB #
  204.  
  205. P<LTSB$FET> = LOC(PICBFET); # FORMAT FET FOR PICB READ #
  206. IF NPT$ALFWD[NTORD] NQ 0
  207. THEN # ALTERNATE CCP LOAD FILE #
  208. LFN = NPT$ALFPFN[NTORD];
  209. ELSE # DEFAULT CCP LOAD FILE #
  210. LFN = LFN$NLF;
  211. LFET$LFN[0] = NS$XZFN(LFN); # SET LFN #
  212. LFET$FM[0] = TRUE;
  213. LFET$COMP[0] = TRUE;
  214. LFET$RAN[0] = TRUE;
  215. LFET$LEN[0] = L$LFET - 5;
  216. LFET$FIRST[0] = TSBFWA;
  217. LFET$IN[0] = TSBFWA;
  218. LFET$OUT[0] = TSBFWA;
  219. LFET$LIMIT[0] = TSBFWA + PICBSIZE + 1;
  220. LFET$RR[0] = RI;
  221.  
  222. READ(LTSB$FET); # READ PICB RECORD #
  223. RECALL(LTSB$FET); # WAIT TILL I/O COMPLETES #
  224.  
  225. P<PICB> = TSBFWA; # FWA OF PICB #
  226. IF PICB$RNAME[0] EQ NPUVAR
  227. THEN # VALID PICB RECORD #
  228. BEGIN
  229. NAT$PITSBN[0] = TSBN; # STORE PICB TSB NO IN NAT #
  230. PICB$HDRW1[0] = 0; # CLEAR HEADER WORD #
  231. PICB$ID[0] = PICB$IDENT; # REFORMAT PICB HEADER WORD #
  232. PICB$BS[0] = PICBSIZE + 1;
  233. PICB$VAR[0] = NPUVAR;
  234. #
  235.   CASE ON LOAD TYPE
  236. #
  237. LT = NPULT[0]; # NPU LOAD TYPE #
  238. GOTO LTCASE[LT];
  239.  
  240. SAM: # SAM BOOTSTRAP LOAD #
  241. PCBSIZE = PICB$LSPCB[PICB$HDRL]; # SPCB SIZE #
  242. PCBCI = PICB$HDRL + PICB$PARWL + # CURRENT PICB INDEX #
  243. PICB$LDPCB[PICB$HDRL] +
  244. PICB$LLPCB[PICB$HDRL];
  245. PCBLI = PCBCI + PCBSIZE - 1; # LAST PICB INDEX #
  246. NAT$PSTATE[0] = S"NPS$LSAM"; # SET PRIMARY STATE #
  247.  
  248. IF PCBSIZE NQ 0
  249. AND PICB$PCBID[PCBCI] EQ ID$SPCB
  250. AND PCBLI LQ PICBSIZE
  251. AND PICB$CODE[PCBLI] EQ DIRCODE"ENDPCB"
  252. THEN # VALID SPCB EXISTS #
  253. BEGIN # START SAM LOAD PROCEDURE #
  254. NAT$PDIRI[0] = PCBCI; # SET CURRENT PICB INDEX #
  255. NAT$PENDI[0] = PCBLI; # SET LAST PICB INDEX #
  256. EM10$NPNAM[0] = NPNAM; # SET NPU NAME #
  257. NS$MSG(MSG$EM10,L$EM10,DM$EM10); # DISPATCH EVENT MSG #
  258.  
  259. NS$LSN; # ASSIGN LSN FOR LOADING SAM #
  260.  
  261. NS$XPD(ERRCODE); # PROCESS NEXT XPCB DIRECTIVE #
  262.  
  263. NS$SGT; # START ACTIVITY TIMER #
  264. END
  265.  
  266. ELSE # BAD SPCB #
  267. BEGIN
  268. ERRCODE = NS$FEC(EC"ERR$FILE",FEC"ERR$SPCB");
  269. END
  270.  
  271. GOTO N00EXIT;
  272.  
  273. REMOTE: # REMOTE NPU LOAD #
  274. NAT$F$RMTL[0] = TRUE; # SET REMOTE LOAD FLAG #
  275.  
  276. LOCAL: # LOCAL NPU LOAD #
  277. NDCBFWA = PICB$NDCBA[PICB$HDRL]; # FWA OF NDCB #
  278.  
  279. IF NDCBFWA NQ 0
  280. THEN # HOST LOADING/CONFIGURING NPU #
  281. BEGIN
  282. NAT$PSTATE[0] = S"NPS$DNDCB"; # SET PRIMARY STATE #
  283.  
  284. EM20$NPNAM[0] = NPNAM; # SET NPU NAME #
  285. EM20$NPVAR[0] = NPUVAR; # SET NPU VARIANT #
  286. NS$MSG(MSG$EM20,L$EM20,DM$EM20); # DISPATCH EVENT MSG #
  287.  
  288. NAT$NDCBA[0] = NDCBFWA; # SAVE NDCB ADDRESS #
  289. MOVEOK(NPT$NSTTSB[NTORD]); # ALLOW NST TO MOVE #
  290.  
  291. NS$LSN; # ASSIGN LSN FOR DUMPING NDCB #
  292.  
  293. NS$FBH(LNPUDTDR,TRUE); # FORMAT ABH FOR NETWORK SM #
  294. PFCSFC[0] = NPUDT; # PFC/SFC #
  295. NPUPO[0] = NAT$PN[0]; # PORT NO #
  296. NPUSP[0] = NAT$SPN[0]; # SUBPORT NO #
  297. NPUCC[0] = CMDCODE"CC$DUMP"; # DUMP COMMAND CODE #
  298. NPULS[0] = NAT$LSN[0]; # LOAD SEQUENCE NO #
  299. NPUBA1[0] = B<36,4>NDCBFWA; # DUMP BEGINNING ADDR #
  300. NPUBA2[0] = B<40,20>NDCBFWA;
  301. NPUEA[0] = NDCBFWA+NDCB$SIZE-1; # DUMP ENDING ADDR #
  302. NETPUT(ABH$WORD,SMB$BUFFER); # SEND NPU/DT/R (DUMP NDCB) #
  303.  
  304. NS$SLT; # START RESPONSE TIMER #
  305. END
  306.  
  307. ELSE # SELF LOADING/HOST CONFIGURING NPU #
  308. BEGIN
  309. NAT$F$SEFL[0] = TRUE; # SET SELF-LOADING FLAG #
  310. NS$INL(ERRCODE); # INITIATE NPU LOAD #
  311.  
  312. IF ERRCODE EQ 0
  313. THEN
  314. NS$XPD(ERRCODE); # PROCESS NEXT XPCB DIRECTIVE #
  315. END
  316.  
  317. N00EXIT:
  318. MOVEOK(TSBN); # ALLOW PICB TSB TO MOVE #
  319. END
  320.  
  321. ELSE # BAD PICB RECORD #
  322. BEGIN
  323. RETTSB(TSBN); # RETURN BAD PICB TSB #
  324. ERRCODE = NS$FEC(EC"ERR$FILE",FEC"ERR$PICB");
  325. END
  326.  
  327. END
  328.  
  329. ELSE # CANNOT LOCATE PICB #
  330. BEGIN
  331. ERRCODE = NS$FEC(EC"ERR$FILE",FEC"ERR$PICBNF");
  332. END
  333.  
  334. END
  335.  
  336. RETURN;
  337. END # NS$N00 #
  338. TERM
cdc/nos2.source/nam5871/ns_n00.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator