Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/listings/tkb-vnp/vnp20.bpt
There are no other files named vnp20.bpt in the archive.
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

   1	!<SAUTER.TKB20>VNP20.BLI.98,  5-Feb-79 09:19:14, Edit by SROBINSON
   2	!<SAUTER.TKB20>VNP20.BLI.97,  3-Jan-79 07:10:29, Edit by SROBINSON
   3	!<SAUTER.TKB20>VNP20.BLI.90, 30-Dec-78 11:47:32, Edit by SROBINSON
   4	!<SAUTER.TKB20>VNP20.BLI.82, 19-Dec-78 08:41:54, Edit by SROBINSON
   5	!<SAUTER.TKB20>VNP20.BLI.76, 16-Dec-78 09:44:11, Edit by SROBINSON
   6	!<SAUTER.TKB20>VNP20.BLI.75, 15-Dec-78 10:32:49, Edit by SROBINSON
   7	!<SAUTER.TKB20>VNP20.BLI.65, 14-Nov-78 15:25:13, Edit by SROBINSON
   8	!<SAUTER.TKB20>VNP20.BLI.61, 14-Nov-78 15:21:23, Edit by SROBINSON
   9	MODULE VNP20 (					!MAIN PROGRAM FOR VNP20
  10			IDENT = 'X0.2-1',
  11			MAIN = VNP20,
  12			ENVIRONMENT (STACK = VNP_STACK)
  13			) =
  14	BEGIN
  15	!
  16	!
  17	!
  18	! COPYRIGHT (C) 1978, 1979 BY
  19	! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
  20	!
  21	!
  22	! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
  23	! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
  24	! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
  25	! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
  26	! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
  27	! TRANSFERRED.
  28	!
  29	!
  30	! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
  31	! AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
  32	! CORPORATION.
  33	!
  34	! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
  35	! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
  36	!
  37	
  38	!++
  39	! FACILITY: VNP-20
  40	!
  41	! ABSTRACT:
  42	!
  43	!
  44	! THIS MODULE IS THE MAIN PROGRAM FOR VNP20.  IT DRIVES ALL OF THE
  45	!  OTHER MODULES BY CALLING ROUTINES IN THEM.
  46	!
  47	!
  48	! ENVIRONMENT: TOPS-20 USER MODE
  49	!
  50	! AUTHOR: J. SAUTER, CREATION DATE: 30-MAY-78
  51	!
  52	! MODIFIED BY:
  53	!
  54	!	Scott G. Robinson, 26-SEP-78 : VERSION X0.1-2A
  55	!	- Modify to put more storage in the initial storage list
  56	!	- Correct minor bugs
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

  57	!
  58	!	Scott G. Robinson, 14-NOV-78 : VERSION X0.2, X0.2-1
  59	!	- Initial TOPS-20 Release 4 Features
  60	!	- Fix LOAD_TSKS to enter POSI in the clock queue
  61	!
  62	!	, : VERSION
  63	! 01	-
  64	!--
  65	
  66	!<BLF/PAGE>
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

  67	!
  68	! TABLE OF CONTENTS:
  69	!
  70	
  71	FORWARD ROUTINE
  72	    VNP20 : NOVALUE,				!MAIN PROGRAM
  73	    DEL_BLK,
  74	    DEL_DDM,
  75	    DEL_CNT,
  76	    DEL_SLT,
  77	    LOAD_TSKS;
  78	
  79	!
  80	! INCLUDE FILES:
  81	!
  82	
  83	LIBRARY 'VNP-LIB.L36';
  84	
  85	!REQUIRE 'BLOCKH.REQ';				!PREPARE TO DEFINE STORAGE BLOCKS
  86	!REQUIRE 'FILE.REQ';				!DEFINE FILE BLOCK
  87	!REQUIRE 'FILSW.REQ';				!DEFINE FILE SWITCHES
  88	!REQUIRE 'VNPVAL.REQ';				!DEFINE VALUES BLOCK
  89	!REQUIRE 'BLOCKT.REQ';				!END OF DEFINING STORAGE BLOCKS
  90	!REQUIRE 'TSKDEF.REQ';				!DEFINE TASK OFFSETS
  91	!
  92	! MACROS:
  93	!
  94	!	NONE
  95	!
  96	! EQUATED SYMBOLS:
  97	!
  98	
  99	LITERAL
 100	    DEBUG = 0;
 101	
 102	!
 103	! OWN STORAGE:
 104	!
 105	
 106	OWN
 107	    VNP_STACK : VECTOR [4000];
 108	
 109	!
 110	! EXTERNAL REFERENCES:
 111	!
 112	
 113	EXTERNAL ROUTINE
 114	    RCOR : NOVALUE,				!READ CORE IMAGE
 115	    WCOR : NOVALUE,				!WRITE OUT CORE IMAGE
 116	    FCOR : NOVALUE,				!FREE A CORE IMAGE
 117	    RSTB : NOVALUE,				!READ SYMBOL TABLE
 118	    RCET : NOVALUE,				!READ CETAB.MAC
 119	    MCEX : NOVALUE,				!MERGE CEX INTO CORE IMAGE
 120	    GETSYM : NOVALUE,				!GET SYMBOLS FROM SYMBOL TABLES
 121	    M_PCB,					!MAKE A PARTITION CONTROL BLOCK
 122	    INSTAL : NOVALUE,				!INSTALL A TASK
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 123	    LOADD : NOVALUE,				!LOAD A DEVICE DRIVER
 124	    M_POOL,					!SET UP THE POOL PARTITION
 125	    LOADP : NOVALUE,				!LOAD COMM PROCESSES
 126	    MOUACP : NOVALUE,				!"MOUNT" THE NETWORK ACP
 127	    FCLEAN : NOVALUE,				!DO FINAL CLEANUP OF THE KERNEL
 128	    TELLK : NOVALUE,				!TELL ABOUT THE CORE IMAGE
 129	    ERROR : NOVALUE,				!SIGNAL PROGRAMMING ERROR
 130	    OPEN,					!OPEN A FILE
 131	    ERRMSG : NOVALUE,				!ERROR MESSAGE
 132	    GETSTG,					!GET STORAGE
 133	    FRESTG : NOVALUE,				!FREE STORAGE
 134	    CLOSE : NOVALUE,				!CLOSE A FILE
 135	    INISTG : NOVALUE,				!INITIALIZE STORAGE MANAGER
 136	    FND_CHAIN,					!FIND A BLOCK IN A CHAIN
 137	    GETBLK,					!GET A STORAGE BLOCK
 138	    FREBLK : NOVALUE,				!FREE A STORAGE BLOCK
 139	    RESET_ALL,					!RESET ALL I/O
 140	    DEL_PTRS : NOVALUE,				!DELETE POINTER BLOCKS
 141	    PUTBYT : NOVALUE,				!PUT A BYTE INTO A TSK IMAGE
 142	    GETBYT,					!GET A BYTE FROM A TSK IMAGE
 143	    PUTWRD : NOVALUE,				!PUT A WORD INTO A TSK IMAGE
 144	    GETWRD,					!GET A WORD FROM A TSK IMAGE
 145	    R50TOA,					!CONVERT RADIX-50 TO ASCII
 146	    ALOCB;					!ALLOCATE SOME STORAGE (EXEC POOL)
 147	
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 148	ROUTINE VNP20 : NOVALUE = 			!MAIN PGM
 149	
 150	!++
 151	! FUNCTIONAL DESCRIPTION:
 152	!
 153	!	TOP LEVEL PROGRAM FOR THE CORE IMAGE BUILDER
 154	!
 155	! FORMAL PARAMETERS:
 156	!
 157	!	NONE
 158	!
 159	! IMPLICIT INPUTS:
 160	!
 161	!	NONE
 162	!
 163	! IMPLICIT OUTPUTS:
 164	!
 165	!	NONE
 166	!
 167	! ROUTINE VALUE:
 168	!
 169	!	NONE
 170	!
 171	! SIDE EFFECTS
 172	!
 173	!	WRITES OUT THE DN20 OR DN200 CORE IMAGE
 174	!
 175	!--
 176	
 177	    BEGIN
 178	
 179	    BIND
 180		ROUTINE_NAME = UPLIT (%ASCIZ'VNP20');
 181	
 182	!
 183	! THE GENERAL PLAN OF ATTACK IS AS FOLLOWS:
 184	!
 185	!  READ RSX11S.TSK INTO THE INTERNAL 124K CORE IMAGE.
 186	!
 187	!  READ RSX11S.STB INTO THE SYMBOL TABLE
 188	!
 189	!  READ THE COMM EXEC SIMILARLY
 190	!
 191	!  READ THE EXEC SYMBOLS FROM RSXMS.STB
 192	!   AND THE NETWORK SYMBOLS FROM NETMS.STB
 193	!
 194	!  READ CETAB.MAC TO GET PARAMETERS FOR THIS CORE IMAGE
 195	!
 196	!  READ AND LOAD EACH TASK FILE NEEDED TO COMPLETE THE CORE IMAGE.
 197	!   (THIS INCLUDES THE MEMORY DRIVER.)
 198	!
 199	!  CREATE THE POOL SUB-PARTITION
 200	!
 201	!  READ THE .DAT FILES AND CREATE THE DATA BASES
 202	!
 203	!  COMPUTE AND TYPE OUT THE CORE SIZE AND PARTITION BASES.
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 204	!
 205	!  WRITE OUT THE CORE IMAGE
 206	!
 207	
 208	    LOCAL
 209		CETAB_FILE : REF FILE_BLOCK,
 210		CEX_FILE : REF FILE_BLOCK,
 211		NTINIT_FILE : REF FILE_BLOCK,
 212		NTINIT_LABEL : REF VECTOR [1024],
 213		NTINIT_PCB,
 214		NTINIT_PAR_LEN,
 215		NTINIT_TSK_BASE,
 216		NETACP_FILE : REF FILE_BLOCK,
 217		NETACP_LABEL : REF VECTOR [1024],
 218		NETACP_PCB,
 219		NETACP_PAR_LEN,
 220		NETACP_TSK_BASE,
 221		KERNEL_FILE : REF FILE_BLOCK,
 222		RSXMS_FILE : REF FILE_BLOCK,
 223		NETMS_FILE : REF FILE_BLOCK,
 224		TASK_PCB,
 225		TASK_PAR_BASE,
 226		TASK_PAR_LEN,
 227		GEN_PCB,
 228		GEN_PAR_BASE,
 229		POOL_PCB,
 230		PAR_BLK : VECTOR [4],
 231		VALUES : REF VNPVAL_BLOCK;
 232	
 233	    RESET_ALL ();				!RESET ALL I/O
 234	    INISTG (7000);				!INITIALIZE THE CORE MANAGER
 235	    VALUES = GETBLK (VNPVAL_TYP, VNPVAL_LEN);
 236	    KERNEL_FILE = GETBLK (FILE_TYP, FILE_LEN);
 237	    CETAB_FILE = GETBLK (FILE_TYP, FILE_LEN);
 238	    CEX_FILE = GETBLK (FILE_TYP, FILE_LEN);
 239	    RSXMS_FILE = GETBLK (FILE_TYP, FILE_LEN);
 240	    NETMS_FILE = GETBLK (FILE_TYP, FILE_LEN);
 241	    NTINIT_FILE = GETBLK (FILE_TYP, FILE_LEN);
 242	    NETACP_FILE = GETBLK (FILE_TYP, FILE_LEN);
 243	
 244	    IF (DEBUG GEQ 1)
 245	    THEN
 246		BEGIN
 247		CH$MOVE (10, CH$PTR (UPLIT (%ASCIZ'TRACE.TXT')), CH$PTR (KERNEL_FILE [FILE_NAME]));
 248		OPEN (1, KERNEL_FILE [FILE_NAME], 1, 1, UPLIT (%ASCIZ'TXT'));
 249		END;					!DEBUG
 250	
 251	!
 252	! READ IN RSX11S KERNEL
 253	!
 254	    CH$MOVE (7, CH$PTR (UPLIT (%ASCIZ'RSX11S')), CH$PTR (KERNEL_FILE [FILE_NAME]));
 255	    RSTB (2, .KERNEL_FILE);			!READ SYMBOL TABLE
 256	    RCOR (.KERNEL_FILE, 2, 124*2048);		!READ IMAGE
 257	    KERNEL_FILE [FILE_HWM] = 0;			!INITIALIZE HIGH WATER MARK
 258	!
 259	! NOW READ IN COMM EXEC
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 260	!
 261	    CH$MOVE (4, CH$PTR (UPLIT (%ASCIZ'CEX')), CH$PTR (CEX_FILE [FILE_NAME]));
 262	    RSTB (2, .CEX_FILE);			!READ COMM EXEC SYMBOL TABLE
 263	    RCOR (.CEX_FILE, 2, 16*2048);		!READ CEX.TSK
 264	!
 265	!  READ SYMBOL TABLE FROM RSXMS.STB, WHICH CONTAINS ALL THE USEFUL
 266	!   SYMBOLS FROM EXEMC.MLB
 267	!
 268	    CH$MOVE (6, CH$PTR (UPLIT (%ASCIZ'RSXMS')), CH$PTR (RSXMS_FILE [FILE_NAME]));
 269	    RSTB (2, .RSXMS_FILE);
 270	!
 271	!  READ SYMBOL TABLE FROM NETMS.STB, WHICH CONTAINS ALL THE USEFUL
 272	!   SYMBOLS FROM NETLIB.MLB
 273	!
 274	    CH$MOVE (6, CH$PTR (UPLIT (%ASCIZ'NETMS')), CH$PTR (NETMS_FILE [FILE_NAME]));
 275	    RSTB (2, .NETMS_FILE);
 276	!
 277	!  READ CETAB.MAC
 278	!
 279	    CH$MOVE (10, CH$PTR (UPLIT (%ASCIZ'CETAB.MAC')), CH$PTR (CETAB_FILE [FILE_NAME]));
 280	    RCET (2, .CETAB_FILE, .VALUES);		!EXTRACT VALUES FROM CETAB.MAC
 281	!
 282	! WE DON'T NEED THE CETAB FILE ANY LONGER FREE IT
 283	!
 284	    FCOR (.CETAB_FILE);
 285	!
 286	! GET THE USEFUL SYMBOLS FROM THE SYMBOL TABLES AND STORE THEM
 287	!  INTO THE VALUES ARRAY.  THIS IS DONE HERE FOR EFFICIENCY.
 288	!
 289	    GETSYM (.KERNEL_FILE, .CEX_FILE, .RSXMS_FILE, .NETMS_FILE, .VALUES);
 290	!
 291	! RELEASE THE FILES WE DON'T NEED ANY MORE
 292	!
 293	    FCOR (.RSXMS_FILE);
 294	    FCOR (.NETMS_FILE);
 295	!
 296	! BUILD A PARTITION IN THE KERNEL TO HOLD THE COMM EXEC, AND
 297	!  COPY THE COMM EXEC INTO IT.
 298	!
 299	    MCEX (.KERNEL_FILE, .CEX_FILE, .VALUES);
 300	!
 301	! WE DON'T NEED THE COMM EXEC ANY MORE (IT'S IN THE CORE INAGE NOW),
 302	!  SO DELETE OUR COPY OF IT.
 303	!
 304	    FCOR (.CEX_FILE);
 305	!
 306	! READ THE NTINIT, AND NETACP
 307	!
 308	    CH$MOVE (7, CH$PTR (UPLIT (%ASCIZ'NTINIT')), CH$PTR (NTINIT_FILE [FILE_NAME]));
 309	    RCOR (.NTINIT_FILE, 2, 16*2048);
 310	    NTINIT_LABEL = .NTINIT_FILE [FILE_LABEL];
 311	!
 312	    CH$MOVE (7, CH$PTR (UPLIT (%ASCIZ'NETACP')), CH$PTR (NETACP_FILE [FILE_NAME]));
 313	    RCOR (.NETACP_FILE, 2, 16*2048);
 314	    NETACP_LABEL = .NETACP_FILE [FILE_LABEL];
 315	!
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 316	! BUILD A PARTITION BIG ENOUGH TO HOLD ALL.
 317	!
 318	    NTINIT_TSK_BASE = .NTINIT_LABEL [L$BSA] + (.NTINIT_LABEL [L$BSA + 1]*256);
 319	    NTINIT_PAR_LEN = (.NTINIT_LABEL [L$BHGV] + (.NTINIT_LABEL [L$BHGV + 1]*256)) - .NTINIT_TSK_BASE + 1;
 320	    NETACP_TSK_BASE = .NETACP_LABEL [L$BSA] + (.NTINIT_LABEL [L$BSA + 1]*256);
 321	    NETACP_PAR_LEN = (.NETACP_LABEL [L$BHGV] + (.NETACP_LABEL [L$BHGV + 1]*256)) - .NETACP_TSK_BASE + 1;
 322	    TASK_PAR_LEN = .NTINIT_PAR_LEN + .NETACP_PAR_LEN;
 323	    TASK_PAR_BASE = .KERNEL_FILE [FILE_HWM] + 1;
 324	    TASK_PCB = M_PCB (.KERNEL_FILE, UPLIT (%ASCIZ'TASK  '), 0, .TASK_PAR_BASE,
 325		.TASK_PAR_BASE + .TASK_PAR_LEN - 1, %O'074200', %O'000000', 0, .VALUES);
 326	!
 327	! NOW BUILD A SUB-PARTITION FOR EACH TASK
 328	!
 329	    NTINIT_PCB = M_PCB (.KERNEL_FILE, UPLIT (%ASCIZ'NTINIT'), .TASK_PCB, .TASK_PAR_BASE,
 330		.TASK_PAR_BASE + .NTINIT_PAR_LEN - 1, %O'040100', %O'000000', 0, .VALUES);
 331	    NETACP_PCB = M_PCB (.KERNEL_FILE, UPLIT (%ASCIZ'NETACP'), .TASK_PCB, .TASK_PAR_BASE + .NTINIT_PAR_LEN,
 332		.TASK_PAR_BASE + .NTINIT_PAR_LEN + .NETACP_PAR_LEN - 1, %O'020040', %O'000000', 0, .VALUES);
 333	!
 334	! NOW BUILD THE GEN PARTITION
 335	!
 336	    GEN_PAR_BASE = .KERNEL_FILE [FILE_HWM] + 1;
 337	    GEN_PCB = M_PCB (.KERNEL_FILE, UPLIT (%ASCIZ'GEN   '), 0, .GEN_PAR_BASE, 0, %O'100200', .VALUES [PS_SYS],
 338		0, .VALUES);
 339	!
 340	! INSTALL EACH TASK WHICH BELONGS IN THE 'TASK' PARTITION.
 341	!
 342	    INSTAL (.KERNEL_FILE, .NTINIT_FILE, UPLIT (%ASCIZ'NTINIT'), .NTINIT_PCB, .VALUES);
 343	    INSTAL (.KERNEL_FILE, .NETACP_FILE, UPLIT (%ASCIZ'NETACP'), .NETACP_PCB, .VALUES);
 344	!
 345	! DELETE OUR COPIES OF THESE TASKS
 346	!
 347	    FCOR (.NTINIT_FILE);
 348	    FCOR (.NETACP_FILE);
 349	!
 350	! SET UP THE POOL PARTITION, AND ALLOCATE THE CCBS, SDBS AND RDBS.
 351	!
 352	    POOL_PCB = M_POOL (.KERNEL_FILE, .GEN_PCB, .VALUES);
 353	!
 354	! LOAD THE COMMUNICATIONS PROCESSES
 355	!
 356	    LOADP (.KERNEL_FILE, .GEN_PCB, 2, .VALUES);
 357	!
 358	! NOW DELETE ALL INFORMATION BLOCKS BUILT FROM CETAB
 359	!
 360	    FND_CHAIN (.VALUES [LLC_CHAIN], DEL_BLK, 0);
 361	    DEL_PTRS (.VALUES [LLC_CHAIN]);
 362	    FND_CHAIN (.VALUES [DLC_CHAIN], DEL_BLK, 0);
 363	    DEL_PTRS (.VALUES [DLC_CHAIN]);
 364	    FND_CHAIN (.VALUES [DDM_CHAIN], DEL_DDM, 0);
 365	    DEL_PTRS (.VALUES [DDM_CHAIN]);
 366	    FND_CHAIN (.VALUES [SLT_CHAIN], DEL_SLT, 0);
 367	    DEL_PTRS (.VALUES [SLT_CHAIN]);
 368	!
 369	! AND INFORMATION ABOUT LOADED LIBRARIES
 370	!
 371	    FND_CHAIN (.VALUES [LIBR_CHAIN], DEL_BLK, 0);
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 372	    DEL_PTRS (.VALUES [LIBR_CHAIN]);
 373	!
 374	! INSTALL THE OTHER TASKS.  THEY WILL GO INTO THE 'GEN' PARTITION.
 375	!
 376	    PAR_BLK [0] = .GEN_PCB;
 377	    PAR_BLK [1] = .KERNEL_FILE;
 378	    PAR_BLK [2] = .VALUES;
 379	    PAR_BLK [3] = 2;
 380	    FND_CHAIN (.VALUES [TSK_CHAIN], LOAD_TSKS, PAR_BLK);
 381	!
 382	! DELETE THE TASK INFORMATION
 383	!
 384	    FND_CHAIN (.VALUES [TSK_CHAIN], DEL_BLK, 0);
 385	    DEL_PTRS (.VALUES [TSK_CHAIN]);
 386	!
 387	! "MOUNT" THE NETWORK ACP
 388	!
 389	    MOUACP (.KERNEL_FILE, .NTINIT_PCB, .VALUES);
 390	!
 391	! DO THE FINAL CLEANUP OF THE KERNEL.
 392	!
 393	    FCLEAN (.KERNEL_FILE, .GEN_PCB, .VALUES);
 394	!
 395	! TELL SOFTWARE SUPPORT ABOUT THIS CORE IMAGE, AND CHANGE THE
 396	!  NAME OF THE KERNEL FILE TO THE NAME OF THE NODE.
 397	!
 398	    TELLK (.KERNEL_FILE, 0, .VALUES);
 399	!
 400	! WRITE OUT THE CORE IMAGE
 401	!
 402	    WCOR (2, .KERNEL_FILE);
 403	!
 404	! FREE THE KERNEL FILE, SINCE WE DON'T NEED IT ANY MORE.
 405	!
 406	    FCOR (.KERNEL_FILE);
 407	!
 408	! FREE THE VALUES BLOCK, SINCE WE DON'T NEED IT ANY MORE EITHER.
 409	!
 410	    FREBLK (.VALUES);
 411	!
 412	
 413	    IF (DEBUG GEQ 1) THEN CLOSE (1);
 414	
 415	    END;					!OF VNP20
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 416	ROUTINE DEL_BLK (BLK_PTR, UNUSED) = 		!FREE ANY BLOCK OF MEMORY
 417	
 418	!++
 419	! FUNCITONAL DESCRIPTION:
 420	!
 421	!	CALLS FREBLK TO FREE ANY BLOCK OF MEMORY
 422	!
 423	! FORMAL PARAMETERS:
 424	!
 425	!	BLK_PTR - ADDRESS OF BLOCK TO FREE
 426	!
 427	! IMPLICIT INPUTS:
 428	!
 429	!	NONE
 430	!
 431	! IMPLICIT OUTPUTS:
 432	!
 433	!	NONE
 434	!
 435	! ROUTINE VALUE:
 436	!
 437	!	ALWAYS 0
 438	!
 439	! SIDE EFFECTS:
 440	!
 441	!	SOME MEMORY IS RETURNED TO FREE CORE
 442	!--
 443	
 444	    BEGIN
 445	
 446	    MAP
 447		BLK_PTR : REF ANY_BLOCK;
 448	
 449	    FREBLK (.BLK_PTR);
 450	    0
 451	    END;					!END OF DEL_BLK
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 452	ROUTINE DEL_DDM (DDM_PTR, UNUSED) = 		!FREE A DDM BLOCK
 453	
 454	!++
 455	! FUNCITONAL DESCRIPTION:
 456	!
 457	!	CALLS FREBLK TO FREE DDM AND FIND_CHAIN TO REMOVE CONTROLLERS ETC.
 458	!
 459	! FORMAL PARAMETERS:
 460	!
 461	!	DDM_PTR - ADDRESS OF DDM BLOCK TO FREE
 462	!
 463	! IMPLICIT INPUTS:
 464	!
 465	!	NONE
 466	!
 467	! IMPLICIT OUTPUTS:
 468	!
 469	!	NONE
 470	!
 471	! ROUTINE VALUE:
 472	!
 473	!	ALWAYS 0
 474	!
 475	! SIDE EFFECTS:
 476	!
 477	!	SOME MEMORY IS RETURNED TO FREE CORE
 478	!--
 479	
 480	    BEGIN
 481	
 482	    MAP
 483		DDM_PTR : REF DDM_BLOCK;
 484	
 485	    FND_CHAIN (.DDM_PTR [DDM_CNT], DEL_CNT, 0);
 486	    DEL_PTRS (.DDM_PTR [DDM_CNT]);
 487	    FREBLK (.DDM_PTR);
 488	    0
 489	    END;					!END OF DEL_DDM
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 490	ROUTINE DEL_CNT (CNT_PTR, UNUSED) = 		!FREE CNT BLOCKS
 491	
 492	!++
 493	! FUNCITONAL DESCRIPTION:
 494	!
 495	!	CALLS FREBLK TO FREE CNT BLOCK RELATED MEMORY
 496	!
 497	! FORMAL PARAMETERS:
 498	!
 499	!	CNT_PTR - ADDRESS OF CNT BLOCK TO FREE
 500	!
 501	! IMPLICIT INPUTS:
 502	!
 503	!	NONE
 504	!
 505	! IMPLICIT OUTPUTS:
 506	!
 507	!	NONE
 508	!
 509	! ROUTINE VALUE:
 510	!
 511	!	ALWAYS 0
 512	!
 513	! SIDE EFFECTS:
 514	!
 515	!	SOME MEMORY IS RETURNED TO FREE CORE
 516	!--
 517	
 518	    BEGIN
 519	
 520	    MAP
 521		CNT_PTR : REF CNT_BLOCK;
 522	
 523	    FND_CHAIN (.CNT_PTR [CNT_UNT], DEL_BLK, 0);	!FIND AND DELETE UNITS
 524	    DEL_PTRS (.CNT_PTR [CNT_UNT]);
 525	    FREBLK (.CNT_PTR);
 526	    0
 527	    END;					!END OF DEL_CNT
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 528	ROUTINE DEL_SLT (SLT_PTR, UNUSED) = 		!FREE AN SLT BLOCK
 529	
 530	!++
 531	! FUNCITONAL DESCRIPTION:
 532	!
 533	!	CALLS FREBLK TO FREE AN SLT BLOCK
 534	!
 535	! FORMAL PARAMETERS:
 536	!
 537	!	SLT_PTR - ADDRESS OF SLT BLOCK TO FREE
 538	!
 539	! IMPLICIT INPUTS:
 540	!
 541	!	NONE
 542	!
 543	! IMPLICIT OUTPUTS:
 544	!
 545	!	NONE
 546	!
 547	! ROUTINE VALUE:
 548	!
 549	!	ALWAYS 0
 550	!
 551	! SIDE EFFECTS:
 552	!
 553	!	SOME MEMORY IS RETURNED TO FREE CORE
 554	!--
 555	
 556	    BEGIN
 557	
 558	    MAP
 559		SLT_PTR : REF SLT_BLOCK;
 560	
 561	    FND_CHAIN (.SLT_PTR [SLT_STA], DEL_BLK, 0);	!FIND AND DELETE ANY STATIONS
 562	    DEL_PTRS (.SLT_PTR [SLT_STA]);
 563	    FREBLK (.SLT_PTR);
 564	    0
 565	    END;					!END OF DEL_SLT
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 566	ROUTINE LOAD_TSKS (TSKB_PTR, PAR_BLK) = 	!LOAD TASKS INTO THE GEN PARTITION
 567	
 568	!++
 569	! FUNCTIONAL DESCRIPTION:
 570	!
 571	!	LOAD TASKS INTO THE GEN PARTITION.
 572	!
 573	! FORMAL PARAMETERS:
 574	!
 575	!	TSKB_PTR - POINTS TO THE VNPTSK BLOCK FOR THIS TASK
 576	!	PAR_BLK - A VECTOR OF USEFUL LOCATIONS
 577	!
 578	! IMPLICIT INPUTS:
 579	!
 580	!	NONE
 581	!
 582	! IMPLICIT OUTPUTS:
 583	!
 584	!	NONE
 585	!
 586	! ROUTINE VALUE:
 587	!
 588	!	ALWAYS 0
 589	!
 590	! SIDE EFFECTS:
 591	!
 592	!	NONE
 593	!
 594	!--
 595	
 596	    BEGIN
 597	
 598	    BIND
 599		ROUTINE_NAME = UPLIT (%ASCIZ'LOAD_TSKS');
 600	
 601	    MAP
 602		TSKB_PTR : REF VNPTSK_BLOCK,
 603		PAR_BLK : REF VECTOR;
 604	
 605	    BIND
 606		GEN_PCB = PAR_BLK [0],
 607		KERNEL_FILE = PAR_BLK [1] : REF FILE_BLOCK,
 608		VALUES = PAR_BLK [2] : REF VNPVAL_BLOCK,
 609		FILE_CHAN = PAR_BLK [3];
 610	
 611	    LOCAL
 612		TSK_FILE : REF FILE_BLOCK,
 613		TSK_LABEL : REF VECTOR [1024],
 614		TSK_BASE,
 615		TSK_TOP,
 616		TSK_SIZE,
 617		TSK_PCB,
 618		TSK_R50,
 619		TASK_NAME : VECTOR [CH$ALLOCATION (7)],
 620		PARTITION_NAME : VECTOR [CH$ALLOCATION (7)],
 621		PARTITION_BASE,
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 622		CLK_ADDR;
 623	
 624	    IF (CH$NEQ (1, CH$PTR (TSKB_PTR [TSK_NAME]), 1, CH$PTR (UPLIT (0)), 0))
 625	    THEN
 626		BEGIN
 627	!
 628	! GET FILE FIRST
 629	!
 630	
 631		IF ((TSK_FILE = GETBLK (FILE_TYP, FILE_LEN)) EQL 0)
 632		THEN
 633		    ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
 634		ELSE
 635		    BEGIN
 636		    CH$MOVE (LEN_TSK_NAME, CH$PTR (TSKB_PTR [TSK_NAME]), CH$PTR (TSK_FILE [FILE_NAME]));
 637		    RSTB (.FILE_CHAN, .TSK_FILE);
 638		    RCOR (.TSK_FILE, .FILE_CHAN, 32*2048);
 639		    TSK_LABEL = .TSK_FILE [FILE_LABEL];
 640		    TSK_BASE = .TSK_LABEL [L$BSA] + (.TSK_LABEL [L$BSA + 1]*256);
 641		    TSK_TOP = .TSK_LABEL [L$BHGV] + (.TSK_LABEL [L$BHGV + 1]*256);
 642		    TSK_SIZE = .TSK_TOP - .TSK_BASE + 1;
 643	!
 644	! FORM THE PARTITION
 645	!
 646		    CH$MOVE (LEN_TSK_NAME, CH$PTR (TSKB_PTR [TSK_NAME]), CH$PTR (PARTITION_NAME));
 647		    PARTITION_BASE = .KERNEL_FILE [FILE_HWM] + 1;
 648		    TSK_PCB = M_PCB (.KERNEL_FILE, PARTITION_NAME, .GEN_PCB, .PARTITION_BASE,
 649			.PARTITION_BASE + .TSK_SIZE - 1, %O'004010', 0, 0, .VALUES);
 650	!
 651	! COPY THE TASK IN
 652	!
 653	
 654		    INCR COUNTER FROM 0 TO .TSK_SIZE - 1 DO
 655			PUTBYT (.KERNEL_FILE, .PARTITION_BASE + .COUNTER, GETBYT (.TSK_FILE, .TSK_BASE + .COUNTER));
 656	
 657	!
 658	! BUILD THE TASK NAME
 659	!
 660		    TSK_R50 = (.TSK_LABEL [L$BTSK]^16) + (.TSK_LABEL [L$BTSK + 1]^24) + (.TSK_LABEL [L$BTSK + 2]) + (
 661		    .TSK_LABEL [L$BTSK + 3]^8);
 662		    R50TOA (.TSK_R50, TASK_NAME);
 663	!
 664	! INSTALL THE TASK
 665	!
 666		    INSTAL (.KERNEL_FILE, .TSK_FILE, TASK_NAME, .TSK_PCB, .VALUES);
 667	!
 668	! DETERMINE WHETHER THIS TASK REQUIRES A CLOCK QUEUE ENTRY AND BUILD ONE IF
 669	!  APPROPRIATE.
 670	
 671		    IF (CH$EQL (LEN_TSK_NAME, CH$PTR (TSKB_PTR [TSK_NAME]), 4, CH$PTR (UPLIT (%ASCIZ'POSI')), 0))
 672		    THEN
 673			BEGIN
 674			CLK_ADDR = ALOCB (.KERNEL_FILE, .VALUES [CLK_LGTH], 0, .VALUES);
 675			PUTWRD (.KERNEL_FILE, .CLK_ADDR + .VALUES [CLK_TIM],
 676			    GETWRD (.KERNEL_FILE, .VALUES [ABTIM]) + 180);
 677			PUTWRD (.KERNEL_FILE, .CLK_ADDR + .VALUES [CLK_RQT], .VALUES [CLK_SSHT]);
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

 678			PUTWRD (.KERNEL_FILE, .CLK_ADDR + .VALUES [CLK_TCB],
 679			    GETWRD (.KERNEL_FILE,
 680				.TSK_PCB + .VALUES [P_TCB]));
 681			PUTWRD (.KERNEL_FILE, .CLK_ADDR + .VALUES [CLK_LNK], GETWRD (.KERNEL_FILE, .VALUES [CLKHD]));
 682			PUTWRD (.KERNEL_FILE, .VALUES [CLKHD], .CLK_ADDR);
 683			END;
 684	
 685	!
 686	! FREE THE FILE ETC.
 687	!
 688		    FCOR (.TSK_FILE);
 689		    END;
 690	
 691		END;
 692	
 693	    IF (CH$NEQ (1, CH$PTR (TSKB_PTR [DRIVER_NAME]), 1, CH$PTR (UPLIT (0)), 0))
 694	    THEN
 695		BEGIN
 696	!
 697	! GET THE DRIVER FILE
 698	!
 699	
 700		IF ((TSK_FILE = GETBLK (FILE_TYP, FILE_LEN)) EQL 0)
 701		THEN
 702		    ERRMSG (0, 1, ROUTINE_NAME, 0, 0, 0, 0)
 703		ELSE
 704		    BEGIN
 705		    CH$MOVE (LEN_TSK_NAME, CH$PTR (TSKB_PTR [DRIVER_NAME]), CH$PTR (TSK_FILE [FILE_NAME]));
 706		    RSTB (.FILE_CHAN, .TSK_FILE);
 707		    RCOR (.TSK_FILE, .FILE_CHAN, 4*2048);
 708		    LOADD (.KERNEL_FILE, .TSK_FILE, UPLIT (%ASCIZ'GEN   '), .GEN_PCB, .VALUES);
 709		    FCOR (.TSK_FILE)
 710		    END;
 711	
 712		END;
 713	
 714	    END;					!OF LOAD_TSKS
 715	END
 716	
 717	ELUDOM
 718	! Local Modes:
 719	! Comment Column:36
 720	! Comment Start:!
 721	! Mode:Fundamental
 722	! Auto Save Mode:2
 723	! End:
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

ABTIM		 676
ALOCB		 146	 674
ANY_BLOCK	 447
BLK_PTR		 416	 447	 449
CETAB_FILE	 209	 237#	 279	 280	 284
CEX_FILE	 210	 238#	 261	 262	 263	 289	 299
		 304
CLKHD		 681	 682
CLK_ADDR	 622	 674#	 675	 677	 678	 681	 682
CLK_LGTH	 674
CLK_LNK		 681
CLK_RQT		 677
CLK_SSHT	 677
CLK_TCB		 678
CLK_TIM		 675
CLOSE		 134	 413
CNT_BLOCK	 521
CNT_PTR		 490	 521	 523	 524	 525
CNT_UNT		 523	 524
COUNTER		 654	 655
DDM_BLOCK	 483
DDM_CHAIN	 364	 365
DDM_CNT		 485	 486
DDM_PTR		 452	 483	 485	 486	 487
DEL_BLK		  73	 360	 362	 371	 384	 416*	 523
		 561
DEL_CNT		  75	 485	 490*
DEL_DDM		  74	 364	 452*
DEL_PTRS	 140	 361	 363	 365	 367	 372	 385
		 486	 524	 562
DEL_SLT		  76	 366	 528*
DLC_CHAIN	 362	 363
DRIVER_NAME	 693	 705
ERRMSG		 131	 633	 702
ERROR		 129
FCLEAN		 127	 393
FCOR		 116	 284	 293	 294	 304	 347	 348
		 406	 688	 709
FILE_BLOCK	 209	 210	 211	 216	 221	 222	 223
		 607	 612
FILE_CHAN	 609#	 637	 638	 706	 707
FILE_HWM	 257	 323	 336	 647
FILE_LABEL	 310	 314	 639
FILE_LEN	 236	 237	 238	 239	 240	 241	 242
		 631	 700
FILE_NAME	 247	 248	 254	 261	 268	 274	 279
		 308	 312	 636	 705
FILE_TYP	 236	 237	 238	 239	 240	 241	 242
		 631	 700
FND_CHAIN	 136	 360	 362	 364	 366	 371	 380
		 384	 485	 523	 561
FREBLK		 138	 410	 449	 487	 525	 563
FRESTG		 133
GEN_PAR_BASE	 228	 336#	 337
GEN_PCB		 227	 337#	 352	 356	 376	 393	 606#
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

		 648	 708
GETBLK		 137	 235	 236	 237	 238	 239	 240
		 241	 242	 631	 700
GETBYT		 142	 655
GETSTG		 132
GETSYM		 120	 289
GETWRD		 144	 676	 679	 681
INISTG		 135	 234
INSTAL		 122	 342	 343	 666
KERNEL_FILE	 221	 236#	 247	 248	 254	 255	 256
		 257#	 289	 299	 323	 324	 329	 331
		 336	 337	 342	 343	 352	 356	 377
		 389	 393	 398	 402	 406	 607#	 647
		 648	 655	 666	 674	 675	 676	 677
		 678	 679	 681	 682	 708
L$BHGV		 319	 321	 641
L$BSA		 318	 320	 640
L$BTSK		 660	 661
LEN_TSK_NAME	 636	 646	 671	 705
LIBR_CHAIN	 371	 372
LLC_CHAIN	 360	 361
LOADD		 123	 708
LOADP		 125	 356
LOAD_TSKS	  77#	 380	 566*
MCEX		 119	 299
MOUACP		 126	 389
M_PCB		 121	 324	 329	 331	 337	 648
M_POOL		 124	 352
NETACP_FILE	 216	 242#	 312	 313	 314	 343	 348
NETACP_LABEL	 217	 314#	 320	 321
NETACP_PAR_LEN	 219	 321#	 322	 332
NETACP_PCB	 218	 331#	 343
NETACP_TSK_BASE	 220	 320#	 321
NETMS_FILE	 223	 240#	 274	 275	 289	 294
NTINIT_FILE	 211	 241#	 308	 309	 310	 342	 347
NTINIT_LABEL	 212	 310#	 318	 319	 320
NTINIT_PAR_LEN	 214	 319#	 322	 330	 331	 332
NTINIT_PCB	 213	 329#	 342	 389
NTINIT_TSK_BASE	 215	 318#	 319
OPEN		 130	 248
PARTITION_BASE	 621	 647#	 648	 649	 655
PARTITION_NAME	 620	 646	 648
PAR_BLK		 230	 376#	 377#	 378#	 379#	 380	 566
		 603	 606	 607	 608	 609
POOL_PCB	 229	 352#
PS_SYS		 337
PUTBYT		 141	 655
PUTWRD		 143	 675	 677	 678	 681	 682
P_TCB		 680
R50TOA		 145	 662
RCET		 118	 280
RCOR		 114*	 256	 263	 309	 313	 638	 707
RESET_ALL	 139	 233
ROUTINE_NAME	 180#	 599#	 633	 702
RSTB		 117	 255	 262	 269	 275	 637	 706
		DSK:VNP20.XRF[4,31]              31-Aug-79 15:04

RSXMS_FILE	 222	 239#	 268	 269	 289	 293
SLT_BLOCK	 559
SLT_CHAIN	 366	 367
SLT_PTR		 528	 559	 561	 562	 563
SLT_STA		 561	 562
TASK_NAME	 619	 662	 666
TASK_PAR_BASE	 225	 323#	 324	 325	 329	 330	 331
		 332
TASK_PAR_LEN	 226	 322#	 325
TASK_PCB	 224	 324#	 329	 331
TELLK		 128	 398
TSKB_PTR	 566	 602	 624	 636	 646	 671	 693
		 705
TSK_BASE	 614	 640#	 642	 655
TSK_CHAIN	 380	 384	 385
TSK_FILE	 612	 631#	 636	 637	 638	 639	 655
		 666	 688	 700#	 705	 706	 707	 708
		 709
TSK_LABEL	 613	 639#	 640	 641	 660	 661
TSK_NAME	 624	 636	 646	 671
TSK_PCB		 617	 648#	 666	 680
TSK_R50		 618	 660#	 662
TSK_SIZE	 616	 642#	 649	 654
TSK_TOP		 615	 641#	 642
UNUSED		 416	 452	 490	 528
VALUES		 231	 235#	 280	 289	 299	 325	 330
		 332	 337	 338	 342	 343	 352	 356
		 360	 361	 362	 363	 364	 365	 366
		 367	 371	 372	 378	 380	 384	 385
		 389	 393	 398	 410	 608#	 649	 666
		 674	 675	 676	 677	 678	 680	 681
		 682	 708
VNP20		   9#	  11#	  72	 148*
VNPTSK_BLOCK	 602
VNPVAL_BLOCK	 231	 608
VNPVAL_LEN	 235
VNPVAL_TYP	 235
VNP_STACK	  12	 107
WCOR		 115	 402