-
Notifications
You must be signed in to change notification settings - Fork 0
/
real_initializer.list
2469 lines (2443 loc) · 139 KB
/
real_initializer.list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
COMPILATION LISTING OF SEGMENT real_initializer
Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989
Compiled at: Bull HN, Phoenix AZ, System-M
Compiled on: 11/11/89 1058.5 mst Sat
Options: optimize map
1 /****^ ***********************************************************
2* * *
3* * Copyright, (C) Honeywell Bull Inc., 1987 *
4* * *
5* * Copyright, (C) Honeywell Information Systems Inc., 1982 *
6* * *
7* *********************************************************** */
8
9 /* format: style4,indattr,ifthenstmt,ifthen,idind35,^indcomtxt */
10
11 /* WARNING: THIS PROGRAM MUST BE RUN THROUGH PL1_MACRO BEFORE COMPILATION */
12
13 real_initializer:
14 procedure;
15
16 /* * REAL_INITIALIZER
17* *
18* * This is the driving procedure for Multics initialization. It is called from
19* * initializer, a component of bound_active_1 which exists solely to call this
20* * program, so this program can be an init-seg and get deleted. Because it is
21* * essentially an extension of initializer itself, it calls itself initializer.
22* *
23* * As of this program's installation, the collection structure
24* * of the MST is as follows:
25* * "collection" 0:
26* * - the bootable label, if booted from tape (bootload_tape_label)
27* * - bound_bootload_0, which:
28* * & sets up a fault environment
29* * & loads tape firmware as needed, finding in in collection 0.5
30* * & loads collection 1.0
31* * & transfers to bootload_1 which
32* * sets up the pl1 environment, and calls initializer,
33* * which calls us.
34* * - other segments at fixed absolute locations, such as the
35* * flagbox, and iom_mailbox.
36* * collection 0.5
37* * - firmware images for tape mpc's. bound_bootload_0 reads through
38* * these until it finds the one it wants, and then uses it
39* * to boot the MPC. It and all other are then discarded.
40*
41* * collection 1.0
42* * - formerly collection 1. Programs to initialize paging and io.
43* * they include this program, and are called by it.
44* * collection 1.2
45* * - runcoms, config decks, etc for bootload Multics command level.
46* * They are loaded after the loading of collection 1.0 but before
47* * entering any user subsystems. They are paged.
48* * collection 1.5
49* * - programs paged off the bce partition for use by bce.
50*
51* * collection 2.0:
52* * - formerly collection 2. The hardcore file system and relatives.
53* *
54* * collection 3.0:
55* * - user ring programs neccessary for a cold boot.
56* *
57* * This program can be called on in a number of situations.
58* * First, there either is or is not a config deck available.
59* * This is indicated by the value of sys_boot_info$assume_config
60* * deck.
61* * Second, there are three possible initializations to be performed:
62* * - service Multics. Complete initialization and return
63* * to initializer.pl1 for the call out to ring 1.
64* * - Collection 1 command level. Complete initialization as
65* * far as making segs paged, but use a special partition
66* * on the RPV other than the HC partition. Store an image
67* * of the unpaged collection 1 environment on disk to be
68* * returned to in case of a crash, before making_segs_paged.
69* * - cool boot without BOS, and therefore
70* * without a config deck. This happens iff sys_boot_info$assume_config
71* * deck is off. Fabricate a minimal config, asking the operator
72* * (or trusting sys_boot_info) for the RPV model, device, and channel,
73* * load firmware into the rpv disk mpc. Read a config deck from
74* * the config partition on the RPV, then start one of the other
75* * two initializations using the real config deck.
76* *
77******************************************************************************
78******* JOURNALIZATION *******************************************************
79******************************************************************************
80* *
81* * Modification history:
82* * 80-12-21, W. Olin Sibert: Split out of initializer.pl1
83* * 82-07-01, BIM: Partially rethought, and brought up to date with
84* * current version of initializer.pl1 (mr10.0)
85* * 82-08-01, BIM: Metering and check_stop added back.
86* * 82-08-12, JJB: RLV parasites expunged, scavenger added
87* * 83-02-05, ENK: kst_util$garbage_collect
88* * 83-04-15, KPL: bootload command level, (through 5/84).
89* * 83-06-20, E. A. Ranzenbach: Modified for ocdcm_$init_all_consoles
90* * and ocdcm_$reconfigure.
91* * 83-06-26, CLJ: Deleted iobm stuff
92* * 84-08-20, KPL: Modified to not call scs_and_clock_init
93* * when shutting down bce.
94* * 84-10-17, WOS: Modified for new init_syserr_log and to initialize
95* * syserr log names in ring zero instead of AS initialization.
96* * 84-11-09, ADB: Added entry point collection_2 and collection_3 to
97* * make setting breakpoints in bce probe easier.
98* * 85-01-09, Keith Loepere: fix retry_rpv.
99* * 85-01-23, Keith Loepere: power up date/time software in paged bce;
100* * permanent collection 1.5 segs.
101* */
102
103 /****^ HISTORY COMMENTS:
104* 1) change(86-06-05,GJohnson), approve(86-06-05,MCR7387),
105* audit(86-06-10,Martinson), install(86-07-11,MR12.0-1091):
106* Correct error message documentation.
107* 2) change(86-09-05,Farley), approve(86-07-18,MCR7439),
108* audit(86-09-24,Fawcett), install(86-10-20,MR12.0-1189):
109* To move IOI into collection 1.0, so that it will be available
110* at BCE. Also reset sys_info$service_system. Added missing MESSAGE doc.
111* END HISTORY COMMENTS */
112
113 /**** MEMORY LAYOUT ISSUES:
114* * when this program is called, all of collection 1 has
115* * been loaded into the first 512K of absolute memory.
116* * init-segs and to-be-made-paged segs are high, and
117* * everything else (perm-wired segs) are low.
118* *
119* * Depending on what kind of initialization we are up to,
120* * this may need rearrangement.
121* *
122* * If service is to be booted, the high segments are relocated
123* * to actually high memory, leaving the low memory to be used
124* * for the sst and core map (which want to be high in the low
125* * controller).
126* *
127* * If we are booting the command environment, everything is left as is,
128* * since the returnable-to system will be a pre-make-segs-paged
129* * core image, and it wants to be restricted to 512K.
130* *
131* * If there is no config deck at all, then we have no idea
132* * memory is around, and there is no choice but to stay in 512K.
133* * Once the config deck has been read, all memory obtained with
134* * get_main is returned, and a command environment initialization is
135* * undertaken.
136* *
137* * If the config deck is changed, initialization to store
138* * the returnable-to system is repeated.
139* *
140* * To turn a command environment into a service boot, the special
141* * segments, if any, are deleted, the memory allocated with
142* * get_main is returned, and a service initialization is undertaken.
143*
144* */
145
146
147
148 dcl addr builtin;
149 dcl baseptr builtin;
150 dcl bin builtin;
151 dcl binary builtin;
152 dcl null builtin;
153 dcl pointer builtin;
154 dcl substr builtin;
155
156 dcl code fixed bin (35);
157 dcl done_one_initialization bit (1) aligned;
158 dcl meter_initialization bit (1) aligned;
159 dcl parm_ptr pointer;
160 dcl ready_to_y_and_s bit (1) aligned;
161 dcl saved_free_core_size fixed bin (24);
162 dcl saved_free_core_start fixed bin (24); /* Saved state of the SLT core allocation marks */
163 dcl saved_iupt_lth fixed bin; /* allocations in int_unpaged_page_tables */
164 dcl saved_upt_lth fixed bin; /* in unpaged_page_tables */
165 dcl yell_and_scream bit (1) aligned;
166
167 dcl bce_abs_seg$free entry;
168 dcl config_$find entry (char (4) aligned, pointer);
169 dcl config_$find_parm entry (char (4) aligned, pointer);
170 dcl condition_ entry (char (*), entry);
171 dcl initial_error_handler entry;
172 dcl ocdcm_$reconfigure entry (char (4), fixed bin (17), fixed bin (35));
173 dcl pmut$set_mask entry (bit (72) aligned);
174 dcl pmut$trace_rsw entry (bit (36) aligned);
175 dcl syserr entry options (variable);
176 dcl syserr$error_code entry options (variable);
177
178 dcl active_all_rings_data$system_id char (32) ext static;
179 dcl active_all_rings_data$version_id char (32) ext static;
180 dcl bce_request_table_$bce_request_table_ ext static;
181 dcl config_deck$ (4096) bit (36) aligned ext static;
182 dcl int_unpaged_page_tables$ ext static;
183 dcl safe_config_deck$ (4096) bit (36) aligned ext static;
184 dcl scs$sys_level bit (72) aligned external static;
185 dcl slt$ fixed bin external static;
186 dcl sys_boot_info$assume_config_deck bit (1) aligned external; /* implies BOS, by the way */
187 dcl sys_boot_info$boot_without_query bit (1) aligned external static;
188 dcl sys_boot_info$bootload_mem_size fixed bin (26) ext static;
189 dcl sys_boot_info$config_has_been_modified bit (1) aligned ext static;
190 dcl sys_boot_info$contig_mem_size fixed bin (26) ext static;
191 dcl sys_boot_info$rpv_cold_boot bit (1) aligned external static;
192 dcl sys_boot_info$system_type fixed bin external static;
193 dcl sys_info$initialization_state fixed bin external static;
194 dcl sys_info$service_system bit (1) aligned external static;
195 dcl sys_info$system_type fixed bin external static;
196 dcl 1 toehold$ aligned external like toe_hold;
197 dcl unpaged_page_tables$ ext static;
198
199
200 /* The programs called to to actual intitialization-like things. */
201
202 dcl accept_rpv entry;
203 dcl announce_chwm$after entry;
204 dcl announce_chwm$before entry;
205 dcl bce_get_to_command_level entry (ptr);
206 dcl collect_free_core entry;
207 dcl dbm_man$init entry;
208 dcl debug_check$copy_card entry;
209 dcl delete_segs$temp entry;
210 dcl dir_lock_init entry;
211 dcl disk_reader$init entry;
212 dcl disk_reader$final entry;
213 dcl establish_config_deck entry;
214 dcl establish_temp_segs entry;
215 dcl find_file_partition entry;
216 dcl find_rpv_subsystem entry;
217 dcl fnp_init entry;
218 dcl get_io_segs entry;
219 dcl getuid$init entry;
220 dcl init_bce$paged entry;
221 dcl init_bce$wired entry;
222 dcl init_branches entry;
223 dcl init_dm_journal_seg entry;
224 dcl init_early_config entry;
225 dcl init_hardcore_gates entry;
226 dcl init_lvt entry;
227 dcl init_partitions entry;
228 dcl init_pvt entry;
229 dcl init_root_dir entry;
230 dcl init_root_vols entry (fixed bin (35));
231 dcl init_scavenger_data entry;
232 dcl init_sst$early entry;
233 dcl init_sst$normal entry;
234 dcl init_sst_name_seg entry;
235 dcl init_stack_0 entry;
236 dcl init_str_seg entry;
237 dcl init_sys_var entry;
238 dcl init_toehold entry;
239 dcl init_toehold$save_safe_config_deck entry;
240 dcl init_vtoc_man entry;
241 dcl initialize_faults$fault_init_one entry;
242 dcl initialize_faults$fault_init_two entry;
243 dcl initialize_faults$interrupt_init entry;
244 dcl io_config_init entry;
245 dcl ioi_init entry;
246 dcl ioi_page_table$init entry;
247 dcl iom_data_init entry;
248 dcl kst_util$garbage_collect entry (fixed bin (35));
249 dcl load_disk_mpcs entry;
250 dcl load_mst entry;
251 dcl load_mst$init_commands entry;
252 dcl load_mst$make_permanent entry;
253 dcl load_system entry;
254 dcl make_segs_paged entry;
255 dcl move_non_perm_wired_segs entry;
256 dcl ocdcm_$init_all_consoles entry;
257 dcl pre_link_hc entry;
258 dcl read_disk$init entry;
259 dcl scas_init entry;
260 dcl scs_and_clock_init$date_time entry;
261 dcl scs_and_clock_init$early entry;
262 dcl scs_and_clock_init$normal entry;
263 dcl segment_loader entry;
264 dcl init_syserr_log entry;
265 dcl syserr_seg_manager$initialize_log_names entry;
266 dcl tape_reader$final entry;
267 dcl tape_reader$init entry;
268 dcl tc_init entry;
269 dcl tc_init$early entry;
270 dcl tc_init$part_2 entry;
271 dcl tc_init$start_other_cpus entry;
272
273 /* Set up debugging flags */
274
275 done_one_initialization = "0"b;
276 meter_initialization = "0"b;
277 yell_and_scream = "0"b;
278
279 sys_info$system_type = sys_boot_info$system_type;
280 addr (unpaged_page_tables$) -> upt.sst_absloc = 0;
281 addr (unpaged_page_tables$) -> upt.sst_last_loc = 0; /* so we don't confuse page table lookers */
282
283 addr (flagbox$) -> fgbx.return_to_bce_command = "";
284
285 if sys_boot_info$assume_config_deck then do; /* if we came from BOS */
286 parm_ptr = null;
287 call config_$find_parm ("mtin", parm_ptr);
288 meter_initialization = (parm_ptr ^= null);
289
290 parm_ptr = null ();
291 call config_$find_parm ("erly", parm_ptr);
292 if parm_ptr ^= null () then sys_boot_info$assume_config_deck = "0"b;
293 end;
294
295 /* Whatever the task at hand, set up fault handling */
296 /* The prds, set up by a call from scs_and_clock_init, is */
297 /* needed. */
298
299 /* if meter_initialization then call initial_meters$init; */
300
301 /* Everyone is interested in the SLT */
302
303 sltp = addr (slt$);
304
305 /* This cannot have any effect until faults are initialized */
306
307 call condition_ ("any_other", initial_error_handler);
308
309 /* First see if we need to do an exceptional initialization to */
310 /* Find the config deck. */
311
312 ready_to_y_and_s = "0"b;
313
314 sys_info$service_system = "0"b;
315 sys_info$initialization_state = 1;
316 sys_info$collection_1_phase = EARLY_INITIALIZATION;
317
318 if sys_boot_info$assume_config_deck then do;
319
320 /* When running BOS, we turn on rpv_cold_boot so that the normal pass */
321 /* of init_root_vols will format the root. When not running BOS, */
322 /* this is done in the early initialization pass. */
323
324 intk_cardp = null ();
325 call config_$find (INTK_CARD_WORD, intk_cardp);
326 if intk_cardp = null () then call syserr (CRASH, "initializer: intk card missing.");
327 sys_boot_info$rpv_cold_boot = (intk_card.warm_or_cold = "cold");
328 intk_card.warm_or_cold = "warm";
329
330 /* warm/cold here implies that of bce. warm/cold of service is decided in boot
331*command */
332
333
334
335 call check_stop (1, "scs_and_clock_init$normal");
336 call scs_and_clock_init$normal; /* may get called again to reflect config deck changes */
337
338 sys_info$collection_1_phase = BOOT_INITIALIZATION;
339 end;
340
341 bootload_Multics:
342 if sys_info$collection_1_phase ^= SERVICE_INITIALIZATION then do;
343 call collection_1;
344 if toehold$.memory_state = At_bce__shutdown then do; /* return from a previous boot */
345 call TURN_OFF$$masked;
346 sys_info$collection_1_phase = SHUT_INITIALIZATION; /* start up again */
347 end;
348 else if toehold$.memory_state = At_bce__crash then do;
349 call TURN_OFF$$masked;
350 if toehold$.multics_state.old_memory_state = At_bce__early then sys_info$collection_1_phase = RE_EARLY_INITIALIZATION;
351 else if toehold$.multics_state.old_memory_state = At_bce__boot then sys_info$collection_1_phase = BCE_CRASH_INITIALIZATION;
352 else sys_info$collection_1_phase = CRASH_INITIALIZATION; /* we made it far enough to feel config_deck was not the crash cause */
353 end;
354 else do; /* normal pass completion */
355 call TURN_OFF;
356 if sys_info$collection_1_phase = EARLY_INITIALIZATION then
357 sys_info$collection_1_phase = BOOT_INITIALIZATION;
358 else sys_info$collection_1_phase = SERVICE_INITIALIZATION;
359 end;
360 go to bootload_Multics;
361 end;
362
363 /* Perform normal initialization. */
364
365 call collection_1;
366
367 collection_1:
368 proc;
369
370 /* Repeated collection 1 initialization. This is run 4 times (for
371*corresponding values of sys_info$collection_1_phase. First to find the
372*config deck. Second, to set up the crash handler and command environments.
373*Fourth for service. The first uses limited everything. The second uses
374*limited memory (and sst). The fourth uses all.
375*The "third" time is when we shutdown and crash, to rebuild tables. */
376
377 collection_1_start:
378 if sys_info$collection_1_phase = RE_EARLY_INITIALIZATION | sys_info$collection_1_phase = BCE_CRASH_INITIALIZATION then
379 config_deck$ = safe_config_deck$;
380
381 sys_boot_info$config_has_been_modified = "0"b; /* set when modified, forces query when booting service */
382
383 ready_to_y_and_s = "0"b;
384
385 saved_free_core_start = slt.free_core_start;
386 saved_free_core_size = slt.free_core_size;
387 saved_iupt_lth = addr (int_unpaged_page_tables$) -> upt.current_length;
388 saved_upt_lth = addr (unpaged_page_tables$) -> upt.current_length;
389 sys_boot_info$contig_mem_size = sys_boot_info$bootload_mem_size;
390 /* for the benefit of announce_chwm */
391
392 if sys_info$collection_1_phase = EARLY_INITIALIZATION then do;
393
394
395
396 call check_stop (2, "init_early_config");
397 call init_early_config; /* Fill in console, clock default, tape mpc, itk, sst, tcd, */
398 /* bootload cpu, mem, iom and dummy rpv subsystem */
399 end;
400
401
402
403 RETRY_RPV:
404 if sys_info$collection_1_phase = EARLY_INITIALIZATION then do;
405 /* The early entrypoint is as the normal, except that it fills in */
406 /* port number on the cpu card. */
407 call check_stop (3, "scs_and_clock_init$early");
408 call scs_and_clock_init$early;
409 end;
410 else do;
411 call check_stop (3, "scs_and_clock_init$normal");
412 call scs_and_clock_init$normal; /* get new clok card if there is one */
413 end;
414
415
416
417 call check_stop (4, "initialize_faults$fault_init_one");
418 call initialize_faults$fault_init_one;
419
420
421
422 if sys_info$collection_1_phase = SERVICE_INITIALIZATION then do;
423 call check_stop (5, "move_non_perm_wired_segs");
424 call move_non_perm_wired_segs; /* use memory, move segs, fix SLT header */
425 end;
426
427
428
429 call check_stop (6, "get_io_segs");
430 call get_io_segs; /* Allocate the disk_seg, pvt, iom_data, and ioi_data */
431 /* appropriately for the configuration */
432
433
434
435 call check_stop (7, "iom_data_init");
436 call iom_data_init; /* Initialize the iom_data for all configured devices. */
437
438
439
440 call check_stop (8, "ocdcm_$init_all_consoles");
441 call ocdcm_$init_all_consoles;
442
443 parm_ptr = null;
444 call config_$find_parm ("loud", parm_ptr);
445 yell_and_scream = (parm_ptr ^= null);
446
447 ready_to_y_and_s = "1"b;
448
449
450
451 call check_stop (9, "scas_init");
452 call scas_init; /* Set up the SCAS again */
453
454
455
456 if sys_info$collection_1_phase ^= SERVICE_INITIALIZATION then do;
457 call check_stop (10, "tc_init$early");
458 call tc_init$early;
459 end;
460 else do;
461 call check_stop (10, "tc_init");
462 call tc_init;
463 end;
464
465
466
467 if sys_info$collection_1_phase = SERVICE_INITIALIZATION then do;
468 call check_stop (11, "init_sst$normal");
469 call init_sst$normal; /* Set up the full sized SST, with table sizes determined */
470 end;
471 else do;
472 call check_stop (11, "init_sst$early");
473 call init_sst$early;
474 end;
475
476 call debug_check$copy_card; /* not worth a stop */
477
478 if sys_info$collection_1_phase = EARLY_INITIALIZATION
479 | sys_info$collection_1_phase = BOOT_INITIALIZATION
480 | sys_info$collection_1_phase = SERVICE_INITIALIZATION then
481 call announce_chwm$before; /* from the config deck, and announce the size of memory. */
482
483
484
485 call check_stop (12, "disabling slt allocation");
486 slt.free_core_start, slt.free_core_size = 0; /* no more SLT mem allocations */
487
488
489
490 call check_stop (13, "initialize_faults$interrupt_init");
491 call initialize_faults$interrupt_init;
492
493
494
495 if ^done_one_initialization then do;
496 call check_stop (14, "init_bce$wired");/* Bootload Command Environment */
497 call init_bce$wired;
498 end;
499
500 if sys_info$collection_1_phase = EARLY_INITIALIZATION then do;
501
502 /* This call locates the RPV either via sys_boot_info or */
503 /* operator query, as needed. it fills in the config */
504 /* ROOT card, and fixes the fields in the prph dska and appropriate mpc */
505 /* and (someday) mpcs cards. After it is called, paging can really be setup */
506
507
508
509 call check_stop (15, "find_rpv_subsystem");
510 call find_rpv_subsystem;
511 end;
512
513 if ^((sys_info$collection_1_phase = SERVICE_INITIALIZATION) |
514 (sys_info$collection_1_phase = EARLY_INITIALIZATION) |
515 (sys_info$collection_1_phase = BOOT_INITIALIZATION & sys_boot_info$assume_config_deck)) then do;
516
517
518
519 call check_stop (16, "load_disk_mpcs");
520 call load_disk_mpcs;
521 end;
522
523
524
525 call check_stop (17, "init_pvt");
526 call init_pvt;
527
528
529
530 call check_stop (18, "read_disk$init");
531 call read_disk$init; /* This has to come AFTER init_pvt */
532
533
534
535 call check_stop (19, "init_root_vols");
536 call init_root_vols (code);
537 if code ^= 0 then
538 if sys_info$collection_1_phase = EARLY_INITIALIZATION then do;
539 sys_boot_info$boot_without_query = "0"b;
540 call TURN_OFF;
541 go to RETRY_RPV;
542 end;
543 else call syserr (CRASH, "initializer: bad root volume.");
544
545
546
547 if sys_info$collection_1_phase ^= SERVICE_INITIALIZATION then do;
548
549 call check_stop (20, "establish_temp_segs");
550 call establish_temp_segs;
551
552
553
554 call check_stop (21, "find_file_partition");
555 call find_file_partition;
556
557 if ^done_one_initialization then do;
558
559
560
561 call check_stop (22, "tape_reader$init");
562 call tape_reader$init; /* Initialize the tape reading package. */
563
564
565
566 call check_stop (23, "load_mst");
567 call load_mst;
568
569
570
571 call check_stop (24, "tape_reader$final");
572 call tape_reader$final;
573 end;
574
575
576
577 call check_stop (25, "load_mst$init_commands");
578 call load_mst$init_commands; /* and get into addr space
579* load_mst$make_permanent is the counterpart for service pass */
580
581
582
583 if ^done_one_initialization then do;
584 call check_stop (26, "init_bce$paged");
585 call init_bce$paged; /* and add to bce_data switches */
586 end;
587 end;
588 else do;
589
590
591
592 call check_stop (27, "load_mst$make_permanent");
593 call load_mst$make_permanent; /* move coll 1.5 perm segs into coll 2 */
594 end;
595
596 sys_boot_info$rpv_cold_boot = "0"b; /* in case it was on; we are done with special cold boot operations */
597
598
599
600 call check_stop (28, "scs_and_clock_init$date_time");
601 call scs_and_clock_init$date_time; /* power up the date/time software */
602
603
604
605 call check_stop (29, "io_config_init");
606 call io_config_init; /* initialize io_config_data */
607
608
609
610 call check_stop (30, "ioi_init");
611 call ioi_init; /* Initialize the I/O Interfacer. */
612
613
614
615 if sys_info$collection_1_phase = SHUT_INITIALIZATION then
616 sys_info$collection_1_phase = BOOT_INITIALIZATION;
617
618 safe_config_deck$ = config_deck$; /* config_deck$ is good, save for crashing */
619
620 if ^done_one_initialization then do;
621 done_one_initialization = "1"b; /* don't redo per-system initializations (set before saving toehold) */
622
623 /* Set up crash handler. */
624
625 call check_stop (31, "init_toehold");
626 call init_toehold;
627 if toehold$.memory_state = At_bce__crash | toehold$.memory_state = At_bce__shutdown then return; /* return to bce returns to image saved here */
628 end;
629 else if sys_info$collection_1_phase = EARLY_INITIALIZATION | sys_info$collection_1_phase = BOOT_INITIALIZATION | sys_info$collection_1_phase = SERVICE_INITIALIZATION then do;
630 call check_stop (31, "init_toehold$save_safe_config_deck");
631 call init_toehold$save_safe_config_deck;
632 end;
633
634 if sys_info$collection_1_phase = RE_EARLY_INITIALIZATION then
635 sys_info$collection_1_phase = EARLY_INITIALIZATION;
636
637 if sys_info$collection_1_phase = EARLY_INITIALIZATION then
638 toehold$.memory_state = At_bce__early;
639 else if sys_info$collection_1_phase = BOOT_INITIALIZATION then
640 toehold$.memory_state = At_bce__boot;
641 else if sys_info$collection_1_phase = SERVICE_INITIALIZATION then
642 toehold$.memory_state = Multics;
643
644 if sys_info$collection_1_phase = EARLY_INITIALIZATION | sys_info$collection_1_phase = BOOT_INITIALIZATION | sys_info$collection_1_phase = CRASH_INITIALIZATION | sys_info$collection_1_phase = BCE_CRASH_INITIALIZATION then do;
645
646
647
648 call check_stop (32, "bce_get_to_command_level");
649 call bce_get_to_command_level (addr (bce_request_table_$bce_request_table_));
650
651 if sys_info$collection_1_phase = BCE_CRASH_INITIALIZATION then do; /* operator decided to boot again */
652 sys_info$collection_1_phase = BOOT_INITIALIZATION;
653 toehold$.memory_state = At_bce__boot;
654 end;
655
656 /* As of now, the Early Initialization has completed its task. */
657 end;
658
659
660
661 call check_stop (33, "establish_config_deck");
662 call establish_config_deck; /* read in the config deck */
663
664 if sys_info$collection_1_phase = SERVICE_INITIALIZATION then do;
665
666
667
668 call check_stop (34, "init_partitions");
669 call init_partitions;
670
671
672
673 call check_stop (35, "make_segs_paged");
674 call make_segs_paged; /* Make all pageable segments paged */
675
676
677
678 call check_stop (36, "collect_free_core");
679 call collect_free_core; /* and collect all unused core */
680 call announce_chwm$after; /* Announce the results */
681 end;
682 return;
683
684 end collection_1;
685
686
687
688
689 call check_stop (37, "delete_segs$temp 1");
690 call delete_segs$temp; /* Delete collection one temp segs */
691
692
693
694 call check_stop (38, "disk_reader$init");
695 call disk_reader$init;
696
697
698
699 call check_stop (39, "segment_loader 2.0");
700 call segment_loader; /* Load collection 2 */
701
702
703
704 call check_stop (40, "pre_link_hc 2.0");
705 call pre_link_hc; /* prelink collection 2 */
706
707 /* COLLECTION TWO */
708
709 collection_2:
710 entry; /* This will make setting breakpoints in bce_probe easier. */
711
712
713 sys_info$initialization_state = 2; /* Begin collection 2 */
714
715
716
717 call check_stop (41, "initialize_faults$fault_init_two");
718 call initialize_faults$fault_init_two;
719
720
721
722 call check_stop (42, "getuid$init");
723 call getuid$init; /* set up UID generator */
724
725
726 call check_stop (43, "init_vtoc_man");
727 call init_vtoc_man; /* Set up vtoc_man's buffers */
728
729
730
731 call check_stop (44, "dbm_man$init");
732 call dbm_man$init; /* Init the volume dumper's bit map. */
733
734
735
736
737 call check_stop (45, "init_scavenger_data");
738 call init_scavenger_data;
739
740
741
742 call check_stop (46, "init_dm_journal_seg");
743 call init_dm_journal_seg;
744
745
746
747
748 call check_stop (47, "init_sys_var");
749 call init_sys_var; /* Set some system variables */
750
751
752
753 call check_stop (48, "dir_lock_init");
754 call dir_lock_init;
755
756
757
758 /* ioi_page_table$init is also called by ioi_init, but this call is
759* needed to have it switch over to using io_page_table_seg. */
760
761 call check_stop (49, "ioi_page_table$init");
762 call ioi_page_table$init; /* setup standard io_page_table_seg */
763
764
765
766 call check_stop (50, "fnp_init");
767 call fnp_init; /* make tty_buf SDW before tc_init$part_2 */
768
769 /* * After this point, changes to the hardcore descriptor segment may
770* * not be reflected in idle process and hproc descriptor segments.
771* */
772
773
774
775 call check_stop (51, "tc_init$part_2");
776 call tc_init$part_2; /* Stage 2 of traffic control initialization */
777
778
779
780
781 call check_stop (52, "init_syserr_log");
782 call init_syserr_log ();
783
784 call syserr (LOG, "initializer: Multics ^a (^a) syserr logging initialized", active_all_rings_data$system_id,
785 active_all_rings_data$version_id);
786
787
788
789
790 call check_stop (53, "init_str_seg");
791 call init_str_seg; /* Initialize the trailer seg */
792
793
794
795 call check_stop (54, "init_sst_name_seg");
796 call init_sst_name_seg; /* Set up the SST name table */
797
798
799
800
801 call check_stop (55, "init_hardcore_gates");
802 call init_hardcore_gates; /* initialize linkage pointers in gates */
803
804 /* The permanent file system has not been touched up to this point.
805* Everything has been placed in the hc partition. */
806
807
808
809
810 call check_stop (56, "accept_rpv");
811 call accept_rpv; /* Flush PD, salvage, load vol map */
812
813
814
815 call check_stop (57, "init_lvt");
816 call init_lvt; /* get LVT in order */
817
818 call condition_ ("bad_dir_", bad_dir_handler);
819 call condition_ ("seg_fault_error", seg_fault_handler);
820
821
822
823 call check_stop (58, "init_root_dir");
824 call init_root_dir; /* Make the "root" known. */
825
826
827
828 call check_stop (59, "kst_util$garbage_collect");
829 call kst_util$garbage_collect ((0)); /* Clean up the KST after salvaging */
830
831
832
833 call check_stop (60, "init_branches");
834 call init_branches; /* Set up branches for init. and per-process segs. */
835
836
837
838 call check_stop (61, "syserr_seg_manager$initialize_log_names");
839 call syserr_seg_manager$initialize_log_names ();
840
841
842
843 call check_stop (62, "init_stack_0");
844 call init_stack_0;
845
846
847
848 call check_stop (63, "delete_segs$temp 2.0");
849 call delete_segs$temp; /* Delete collection 2 temp segs */
850
851
852 /*
853* Initialize collection 3.
854**/
855 sys_info$initialization_state = 3; /* Begin collection 3 */
856
857 collection_3:
858 entry; /* This will make setting breakpoints in bce_probe easier. */
859
860
861
862 call check_stop (64, "load_system");
863 call load_system; /* Load collection 3. */
864
865
866
867 call check_stop (65, "disk_reader$final");
868 call disk_reader$final;
869
870
871
872 call check_stop (66, "tc_init$start_other_cpus");
873
874
875 call tc_init$start_other_cpus; /* Start up additional CPUs */
876 sys_info$initialization_state = 4; /* Begin normal operation (collection 4) */
877 sys_info$service_system = "1"b;
878
879
880
881 call check_stop (67, "init_proc");
882
883 return;
884
885 bad_dir_handler:
886 procedure (a_mcp, a_condition, a_infop, a_wcp, a_continue);
887
888 dcl a_mcp pointer parameter;
889 dcl a_condition char (*) parameter;
890 dcl a_infop pointer parameter;
891 dcl a_wcp pointer parameter;
892 dcl a_continue bit (1) aligned parameter;
893
894 dcl ppr pointer;
895 dcl tpr pointer;
896
897 dcl pvt$root_pvtx fixed bin ext;
898
899 pvt_arrayp = addr (pvt$array);
900 pvt_array (pvt$root_pvtx).vol_trouble_count = pvt_array (pvt$root_pvtx).vol_trouble_count + 1;
901
902
903 CRASH_BAD_DIR:
904 call syserr (CRASH, "initializer: bad_dir_ signal raised.");
905 goto CRASH_BAD_DIR;
906
907
908
909 seg_fault_handler:
910 entry (a_mcp, a_condition, a_infop, a_wcp, a_continue);
911
912 mcp = a_mcp;
913 scup = addr (mc.scu);
914 ppr = pointer (baseptr (binary (scu.psr, 15)), scu.ilc);
915 tpr = pointer (baseptr (binary (scu.tsr, 15)), scu.ca);
916
917 CRASH_SEG_FAULT:
918 call syserr$error_code (CRASH, mc.errcode, "initializer: Segment fault error by ^p referencing ^p:", ppr, tpr);
919 goto CRASH_SEG_FAULT;
920
921 end bad_dir_handler;
922
923 check_stop:
924 procedure (P_Stop_Number, About_To);
925 dcl P_Stop_Number fixed bin;
926 dcl About_To char (*);
927 dcl cpu_switches bit (36) aligned;
928 dcl call_bce entry;
929 dcl stop_number fixed bin;
930 dcl Stop_Number fixed bin;
931
932 Stop_Number = P_Stop_Number + 1000 * sys_info$collection_1_phase;
933
934 /* if meter_initialization then call initialization_meters$entry (Stop_Number, About_To); */
935
936 if yell_and_scream & ready_to_y_and_s then call syserr (ANNOUNCE, "initializer: ^d^20t^a^2xstate ^d^2xphase ^d.", Stop_Number, About_To, sys_info$initialization_state, sys_info$collection_1_phase);
937
938 call pmut$trace_rsw (cpu_switches);
939 if substr (cpu_switches, 1, 9) = "123"b3 then do;
940 stop_number = BCD (substr (cpu_switches, 10, 24));
941 if stop_number = Stop_Number then do;
942 if yell_and_scream & ready_to_y_and_s then call syserr (ANNOUNCE, "initializer: ^a check_stop.", About_To);
943 call call_bce;
944 end;
945 end;
946
947 BCD:
948 procedure (Bits) returns (fixed bin);
949
950 declare Bits bit (24);
951 declare digits (4) fixed bin;
952 declare digits_bits (4) bit (6) unaligned defined (Bits);
953
954 digits = bin (digits_bits, 6); /* Aggregate */
955 return (digits (1) * 1000 + digits (2) * 100 + digits (3) * 10 + digits (4));
956 end BCD;
957
958 end check_stop;
959
960 TURN_OFF: procedure;
961
962 dcl not_masked bit (1) aligned init ("0"b);
963
964 not_masked = "1"b;
965
966 TURN_OFF$$masked: entry; /* We are already masked; also, our masks may be screwed up so don't try masking. */
967
968 ready_to_y_and_s = "0"b;
969 if not_masked then call ocdcm_$reconfigure ("", SUSPEND_CONSOLE_SERVICE, (0)); /* deactivate the console... */
970 addr (syserr_data$syserr_area) -> sd.ocdcm_init_flag = "0"b; /* PANIC */
971
972 call bce_abs_seg$free; /* release SDWs */
973
974 if not_masked then call pmut$set_mask (scs$sys_level);
975 call initialize_faults$fault_init_one;
976
977 addr (int_unpaged_page_tables$) -> upt.current_length = saved_iupt_lth;
978 addr (unpaged_page_tables$) -> upt.current_length = saved_upt_lth;
979 slt.free_core_start = saved_free_core_start;
980 slt.free_core_size = saved_free_core_size;
981 addr (unpaged_page_tables$) -> upt.sst_absloc = 0;
982 addr (unpaged_page_tables$) -> upt.sst_last_loc = 0; /* so we don't confuse page table lookers */
983 return;
984 end TURN_OFF;
985 /* BEGIN include file collection_1_phases.incl.pl1 */
1 2
1 3 /* Symbolic names for the various collection1 phases.
1 4*Keith Loepere, October 1983. */
1 5
1 6 /* format: style4,indattr,ifthenstmt,ifthen,idind33,^indcomtxt */
1 7
1 8 dcl sys_info$collection_1_phase fixed bin external static;
1 9
1 10 dcl EARLY_INITIALIZATION fixed bin init (1) static options (constant); /* phase to find the config deck */