User Tools

Site Tools


cdc:nos2.source:nam5871:ns_exc

NS$EXC

Table Of Contents

  • [00008] PROC NS$EXC
  • [00010] NS$EXC - NS EXECUTIVE.
  • [00014] NS EXECUTIVE.
  • [00055] PROC NS$DBG
  • [00061] PROC NDLOVLD
  • [00062] PROC NETCHEK
  • [00063] PROC NETWAIT
  • [00064] FUNC NS$FEC U
  • [00065] PROC NS$MSG
  • [00066] PROC NS$OFF
  • [00067] PROC NS$SHD
  • [00068] PROC NS$SMP
  • [00069] PROC MOVEOK
  • [00070] PROC RECALL
  • [00071] PROC RTIME
  • [00072] PROC TSBINFO
  • [00073] PROC XFLMGR

Source Code

NS$EXC.txt
  1. *DECK NS$EXC
  2. USETEXT COM$NS
  3. USETEXT DEF$NS
  4. USETEXT ERR$NS
  5. USETEXT NAT$NS
  6. USETEXT NPT$NS
  7.  
  8. PROC NS$EXC; # NS EXECUTIVE #
  9.  
  10. # TITLE NS$EXC - NS EXECUTIVE. #
  11.  
  12. BEGIN # NS$EXC #
  13. #
  14. ** NS$EXC - NS EXECUTIVE.
  15. *
  16. * J.C. LEE 1981
  17. *
  18. * THIS IS THE NS MAIN PROGRAM. IT IS THE EXECUTIVE.
  19. *
  20. * PROC NS$EXC
  21. *
  22. * ENTRY:
  23. * NONE.
  24. *
  25. * EXIT:
  26. * NONE.
  27. *
  28. * METHOD:
  29. * LOAD AND EXECUTE NS INITIALIZATION OVERLAY.
  30. * THIS PROC CONSISTS PRIMARY OF A LARGE LOOP.
  31. * EACH TIME THROUGH THE LOOP, THE FOLLOWING IS DONE:
  32. * GET REAL TIME CLOCK READING AND SET CURRENT TIME
  33. * IN SECONDS.
  34. * IF NS NOT IN NORMAL MODE AND STARTUP MODE TIMER
  35. * EXPIRED:
  36. * SET NS TO NORMAL MODE.
  37. * CALL SM PROCESSOR TO PROCESS ALL INCOMING SMS.
  38. * IF FORCE SHUTDOWN IN EFFECT:
  39. * NETOFF NS.
  40. * STOP RUN.
  41. * IF NOT FORCE SHUTDOWN:
  42. * CHECK NPU ACTIVITY TIMER.
  43. * IF NPU-TIMEOUT-INTERVAL NQ 0:
  44. * SET NETWAIT TIME TO NPU-TIMEOUT-INTERVAL.
  45. * ELSE:
  46. * SET NETWAIT TIME TO 4095 SECONDS.
  47. * CALL TSB MANAGER TO PERFORM MEMORY COMPACTION.
  48. * LOOP TERMINATES WHEN NS NETOFF, OR ERROR IS DETECTED.
  49. *
  50. #
  51.  
  52. $BEGIN
  53. XREF
  54. BEGIN
  55. PROC NS$DBG; # TRACE PROCEDURE CALL #
  56. END
  57. $END
  58.  
  59. XREF
  60. BEGIN
  61. PROC NDLOVLD; # OVERLAY LOADER #
  62. PROC NETCHEK; # AIP NETCHEK CALL #
  63. PROC NETWAIT; # NETWAIT #
  64. FUNC NS$FEC U; # FORMAT ERROR CODE #
  65. PROC NS$MSG; # MESSAGE DISPATCHER #
  66. PROC NS$OFF; # DISCONNECT FROM NETWORK #
  67. PROC NS$SHD; # SHUTDOWN PROCESSOR #
  68. PROC NS$SMP; # SUPERVISORY MESSAGE PROCESSOR #
  69. PROC MOVEOK; # ALLOW TSB TO MOVE #
  70. PROC RECALL; # RECALL #
  71. PROC RTIME; # GET REAL TIME CLOCK READING #
  72. PROC TSBINFO; # LOCATE TSB #
  73. PROC XFLMGR; # EXCESS FIELD LENGTH MANAGER #
  74. END
  75.  
  76. ITEM ERRCODE U; # ERROR CODE #
  77. ITEM GTIMER U; # ACTIVITY TIMER #
  78. ITEM I I; # LOOP VARIABLE #
  79. ITEM LTIMER U; # RESPONSE TIMER #
  80. ITEM NATFWA U; # NAT FWA #
  81. ITEM NATSIZE U; # NAT SIZE #
  82. ITEM NEXTNATTSB U; # NAT TSB NUMBER #
  83. ITEM TSBN U; # TSB NUMBER #
  84.  
  85. DEF L$CSHDMSG # 3 #; # MESSAGE SIZE #
  86. DEF DM$CSHDMSG # DM$LOCAL + DM$NAMLOG #; # ROUTING OPTIONS #
  87. ARRAY MSG$CSHD [0:0] S(L$CSHDMSG);
  88. BEGIN # SHUTDOWN COMPLETED MESSAGE #
  89. ITEM CSHD$TEXT C(00,00,25) =
  90. ["SHUTDOWN COMPLETED."];
  91. ITEM CSHD$END U(02,30,30) = [0];
  92. END
  93.  
  94. ARRAY REALTIME [0:0] S(1);
  95. BEGIN # STATUS WORD FOR RTIME CALL #
  96. ITEM CURSEC U(00,00,24); # SECOND CLOCK #
  97. ITEM CURMS U(00,24,36); # MILLISECOND CLOCK #
  98. END
  99. ARRAY NSI$OVLY [0:0] S(1);
  100. BEGIN # INITIALIZATION OVERLAY NAME AND LEVEL #
  101. ITEM NO$NAM C(00,00,07) = ["NSIOVLY"];
  102. ITEM NO$LV1 U(00,42,09) = [1];
  103. ITEM NO$LV2 U(00,51,09) = [0];
  104. END
  105. ARRAY MKD$OVLY [0:0] S(1);
  106. BEGIN # K-DISPLAY MANAGER OVERLAY NAME/LEVEL #
  107. ITEM MO$NAM C(00,00,07) = ["MKDOVLY"];
  108. ITEM MO$LV1 U(00,42,09) = [3];
  109. ITEM MO$LV2 U(00,51,09) = [0];
  110. END
  111. ARRAY ERR$OVLY [0:0] S(1);
  112. BEGIN # ERROR PROCESSOR OVERLAY NAME AND LEVEL #
  113. ITEM EO$NAM C(00,00,07) = ["ERROVLY"];
  114. ITEM EO$LV1 U(00,42,09) = [5];
  115. ITEM EO$LV2 U(00,51,09) = [0];
  116. END
  117.  
  118. CONTROL EJECT;
  119.  
  120. $BEGIN
  121. NS$DBG("EXC");
  122. $END
  123. #
  124.   LOAD AND EXECUTE NS INITIALIZATION OVERLAY
  125. #
  126. NDLOVLD(NSI$OVLY);
  127.  
  128.  
  129. FOR I = 0
  130. DO # NS EXECUTIVE LOOP #
  131. BEGIN
  132.  
  133. RTIME(REALTIME); # GET REAL TIME CLOCK READING #
  134. CURTIME = CURSEC[0]; # SET CURRENT TIME IN SECONDS #
  135.  
  136. IF NSM NQ M$NORMAL # NS NOT IN NORMAL MODE #
  137. AND CURTIME GR NMTIME # STARTUP MODE TIMER EXPIRED #
  138. THEN
  139. NSM = M$NORMAL; # SET NS TO NORMAL MODE #
  140. #
  141.   CALL SUPERVISORY MESSAGE PROCESSOR TO PROCESS ALL
  142.   INCOMING SUPERVISORY MESSAGES
  143. #
  144. NS$SMP;
  145.  
  146. IF NOT FORCESHUT
  147. THEN # FORCE SHUTDOWN IS NOT IN EFFECT #
  148. BEGIN
  149. #
  150.   CHECK NPU ACTIVITY TIMERS FOR EXPIRATION
  151. #
  152. NEXTNATTSB = NPT$NLHEAD[0]; # HEAD PTR OF NAT LIST #
  153.  
  154. FOR I = 0 WHILE NEXTNATTSB NQ 0
  155. DO # MORE NAT IN LIST #
  156. BEGIN # CHECK NAT FOR TIMER EXPIRATION#
  157. TSBINFO(NATSIZE,NATFWA,NEXTNATTSB); # LOCATE NAT #
  158. P<NAT> = NATFWA; # FWA OF NAT #
  159. TSBN = NEXTNATTSB; # SAVE CURRENT NAT TSBN #
  160.  
  161. NEXTNATTSB = NAT$NLFP[0]; # NEXT NAT IN LIST #
  162. LTIMER = NAT$LTIMER[0]; # RESPONSE TIMER #
  163. GTIMER = NAT$GTIMER[0]; # ACTIVITY TIMER #
  164.  
  165. IF CURTIME GR LTIMER
  166. OR (GTIMER NQ 0
  167. AND CURTIME GR GTIMER)
  168. THEN # TIMEOUT ERROR #
  169. BEGIN
  170. NTORD = NAT$NTORD[0]; # NPU TABLE ORDINAL #
  171. ERRCODE = NS$FEC(EC"ERR$TIMER",0);
  172. NDLOVLD(ERR$OVLY,ERRCODE); # PROCESS TIMEOUT ERROR #
  173.  
  174. IF NPT$NATTSB[NTORD] NQ 0
  175. THEN
  176. NEXTNATTSB = TSBN;
  177.  
  178. END
  179.  
  180. ELSE # TIMER(S) ARE STILL RUNNING #
  181. BEGIN
  182. MOVEOK(TSBN); # ALLOW NAT TO MOVE #
  183. END
  184. END
  185. END
  186.  
  187. IF FORCESHUT # FORCE SHUTDOWN IN EFFECT #
  188. OR (GRADSHUT AND NPT$NLHEAD[0] EQ 0) # GRADUAL SHUTDOWN/NO NP#
  189. THEN # SHUTDOWN NS #
  190. BEGIN
  191. NS$MSG(MSG$CSHD,L$CSHDMSG,DM$CSHDMSG);
  192. NS$OFF; # DISCONNECT FROM NETWORK #
  193. STOP; # ENDRUN #
  194. END
  195.  
  196. IF DCW$F$SKD[0]
  197. THEN # K-DISPLAY DATA TO SEND #
  198. NDLOVLD(MKD$OVLY); # CALL K-DISPLAY MANAGER #
  199. #
  200.   PERFORM EXCESS FIELD LENGTH PROCESSING
  201. #
  202. XFLMGR;
  203. #
  204.   GIVE UP CPU WHILE WAITING FOR NEXT INPUT
  205. #
  206. IF NPT$NLHEAD[0] NQ 0
  207. THEN # ACTIVE NPU(S) STILL EXIST #
  208. BEGIN # STAY IN CONTROL POINT UNTIL ACTIVITY COMPLETED #
  209. NETCHEK; # FLUSH WORKLIST AND GET UPDATED S/I STATUS #
  210. RECALL(0); # RELINQUISH CPU WHILE WAITING FOR INPUT #
  211. END
  212. ELSE # NO ACTIVE NPU #
  213. NETWAIT(MAX$NWTIME,FALSE);
  214.  
  215. END
  216.  
  217. RETURN;
  218. END # NS$EXC #
  219. TERM
cdc/nos2.source/nam5871/ns_exc.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator