1 /* ***********************************************************
  2    *                                                         *
  3    * Copyright, C Honeywell Bull Inc., 1987                *
  4    *                                                         *
  5    * Copyright, C Honeywell Information Systems Inc., 1984 *
  6    *                                                         *
  7    * Copyright c 1972 by Massachusetts Institute of        *
  8    * Technology and Honeywell Information Systems, Inc.      *
  9    *                                                         *
 10    *********************************************************** */
 11 
 12 
 13 
 14 
 15 /* HISTORY COMMENTS:
 16   1) change85-11-27Herbst, approve87-07-20MCR7697,
 17      audit87-07-20GDixon, install87-08-04MR12.1-1055:
 18      Added system_message_ IPS signal.
 19   2) change99-06-23Haggett:
 20      Y2K
 21                                                    END HISTORY COMMENTS */
 22 
 23 
 24 /* SYS_INFO - This is the Wired All Rings Database. */
 25 
 26 /* format: style4,delnl,insnl,tree,ifthenstmt,indnoniterend */
 27 
 28 sys_info:
 29      procedure;
 30 
 31 /* This program creates the sys_info data base */
 32 
 33 /* Last modified Date and reason:
 34    2/6/76 by S. Webber Initial coding
 35    July 77 by T. Casey to add new IPS signals "susp" and "term"
 36    Oct 77 by T. Casey to rename them to "sus_" and "trm_" to avoid conflicts with users' signal names.
 37    29 Jan 79 by D. Spector to add initialization_state variable
 38    11/28/80, W. Olin Sibert, to add reasonable times
 39    7/82 BIM merge in bootload multics variables with CAH changes.
 40    September 1982, J. Bongiovanni, for data_management_ringno
 41    December 1982, E. N. Kittlitz, for seg_size_256K, default_256K_enable, hfp_exponent_available.
 42    October 1983 through April 1984 for more bootload Multics variables by Keith Loepere.
 43    83-12-03 BIM for pgt_ IPS signal.
 44    11 Jun 1984 by Lee A. Newcomb:  added the new IPS' dm_shutdown_warning_
 45    and dm_user_shutdown_.
 46    08/22/84 by R. Michael Tague:  Removed dm_shutdown_warning_ and
 47    dm_user_shutdown_ IPS signals.  Added system_shutdown_scheduled_
 48    and dm_shutdown_scheduled_ IPS signals.
 49    84-11-09 by EJ Sharpe for access_class_floor, and the three audit thresholds
 50    84-11-20 by EJ Sharpe to change thresholds to system_high as a default and
 51    added the "security_audit_enable" bit
 52    84-11-27 by EJ Sharpe to replace "security_audit_enable" with per-threshold
 53    bits: "audit_covert_channel", "audit_successful_access", "audit_unsuccessful_access".
 54    84-12-11 by EJ Sharpe to rearrange new flags & thresholds for better alignment
 55    1985-01-28, BIM: AIM privilege masks.
 56 */
 57 
 58 dcl  1 sys_info aligned automatic,
 59        2 clock_ bit 3 aligned,                            /* word used in reading the clock */
 60        2 time_zone char 4 aligned,                        /* time zone for current site */
 61        2 time_correction_constant fixed bin,                /* first word of double-word correction factor */
 62        2 time_delta fixed bin,                              /* second word of double-word correction factor */
 63        2 page_size fixed bin,                               /* page size used by the system */
 64        2 max_seg_size fixed bin 18,                       /* maximum segment size in words */
 65        2 bce_max_seg_size fixed bin 18,                   /* max length in words of pagable segs in bce also max file size therein */
 66        2 default_stack_length fixed bin 18,               /* default length of stack created by makestack */
 67        2 default_max_length fixed bin 19,                 /* default maximum length of segments */
 68        2 default_dir_max_length fixed bin 19,             /* ditto for directories */
 69        2 access_class_ceiling aligned like aim_template,    /* who cares */
 70        2 access_class_floor aligned like aim_template,      /* these must be double-word aligned so ldaq may be used */
 71        2 successful_access_threshold aligned like aim_template,
 72        2 unsuccessful_access_threshold aligned like aim_template,
 73        2 covert_channel_threshold aligned like aim_template,
 74        2 audit_successful_access bit 1 aligned,
 75        2 audit_unsuccessful_access bit 1 aligned,
 76        2 audit_covert_channel bit 1 aligned,
 77        2 system_control_dir character 168 varying,
 78        2 time_of_bootload fixed bin 71,                   /* time system was booted */
 79        2 first_reasonable_time fixed bin 71,              /* Used to check "reasonableness" of times */
 80        2 last_reasonable_time fixed bin 71,
 81        2 system_type fixed bin,                             /* ADP_SYSTEM or L68_SYSTEM */
 82        2 initialization_state fixed bin,                    /* current collection of initialization being run */
 83        2 service_system bit 1 aligned,                    /* initialization_state = 4 service */
 84        2 collection_1_phase fixed bin,                      /* phase of collection 1 initialization, has value SERVICE_INITIALIZATION after bce runs */
 85        2 maxlinks fixed bin,                                /* maximum number of links searched */
 86        2 data_management_ringno fixed bin,                  /* Ring where Data Management runs */
 87        2 seg_size_256K fixed bin 19,                      /* like max_seg_size, but the WHOLE thing in words */
 88        2 default_256K_enable fixed bin,                     /* non-zero if default is on */
 89        2 hfp_exponent_available bit 1 aligned,            /* whether hex-floating point is available on this system. */
 90        2 all_valid_ips_mask bit 35 aligned,               /* a mask containing a "1" for all valid ips bits; masked against intended ips words */
 91        2 highest_ips_index bit 0 aligned,
 92        2 ips_mask_data fixed bin,                           /* start of IPS info -- first word is number */
 93        2 quit_name char 32 aligned,
 94        2 quit_mask bit 35 aligned,
 95        2 cput_name char 32 aligned,
 96        2 cput_mask bit 35 aligned,
 97        2 alrm_name char 32 aligned,
 98        2 alrm_mask bit 35 aligned,
 99        2 neti_name char 32 aligned,
100        2 neti_mask bit 35 aligned,
101        2 susp_name char 32 aligned,
102        2 susp_mask bit 35 aligned,
103        2 term_name char 32 aligned,
104        2 term_mask bit 35 aligned,
105        2 wkp_name char 32 aligned,
106        2 wkp_mask bit 35 aligned,
107        2 pgt_name char 32 aligned,
108        2 pgt_mask bit 36 aligned,
109        2 system_shutdown_scheduled_name char 32 aligned,
110        2 system_shutdown_scheduled_mask bit 36 aligned,
111        2 dm_shutdown_scheduled_name char 32 aligned,
112        2 dm_shutdown_scheduled_mask bit 36 aligned,
113        2 system_message_name char 32 aligned,
114        2 system_message_mask bit 36 aligned,
115        2 ipc_privilege bit 36 aligned,
116        2 dir_privilege bit 36 aligned,
117        2 seg_privilege bit 36 aligned,
118        2 soos_privilege bit 36 aligned,
119        2 ring1_privilege bit 36 aligned,
120        2 rcp_privilege bit 36 aligned,
121        2 comm_privilege bit 36 aligned;
122 %page;
123 dcl  i fixed bin;
124 dcl  1 cdsa aligned like cds_args;
125 dcl  code fixed bin 35;
126 
127 dcl  double_fixed fixed bin 71 based;
128 
129 dcl  sys_infoname char 8 static init "sys_info" options constant;
130 dcl  exclude_pad 1 char 32 aligned static options constant init "pad*";
131 
132 dcl  addr bin mod null rel size string unspec builtin;
133 
134 dcl  com_err_ entry options variable;
135 dcl  convert_date_to_binary_ entry char * fixed bin 71 fixed bin 35;
136 dcl  create_data_segment_ entry pointer fixed bin 35;
137 %page;
138 /* Now begins the initialization */
139 
140           unspec sys_info = ""b;                          /* Fill it with zeros */
141 
142           sys_info.time_zone = "none";                      /* default time zone is invalid */
143           addr sys_info.time_correction_constant -> double_fixed = 5 * 3600 * 1000000;
144                                                             /* NOTE KLUDGE: must be done to preserve time_delta segdef
145                                                                _^Hi_^Hn _^Ht_^Hh_^He _^Hm_^Hi_^Hd_^Hd_^Hl_^He of the variable time_correction_constant */
146           sys_info.page_size = 1024;
147           sys_info.max_seg_size = 255 * 1024;
148           sys_info.default_max_length = 255 * 1024;
149           sys_info.seg_size_256K = 256 * 1024;
150           sys_info.default_256K_enable = 0;
151           sys_info.default_dir_max_length = 205 * 1024;
152           sys_info.default_stack_length = 64 * 1024;
153           sys_info.maxlinks = 10;
154           sys_info.data_management_ringno = 2;
155           sys_info.access_class_ceiling.categories = 18"1"b || 18"0"b;
156           sys_info.access_class_ceiling.level = 7;
157           sys_info.successful_access_threshold = sys_info.access_class_ceiling;
158           sys_info.unsuccessful_access_threshold = sys_info.access_class_ceiling;
159           sys_info.covert_channel_threshold = sys_info.access_class_ceiling;
160 
161           sys_info.system_control_dir = ">system_control_dir";
162 
163           sys_info.initialization_state = 0;                /* Begins with bootloading */
164 
165           sys_info.system_type = L68_SYSTEM;                /* A sensible default, for now. */
166 
167           call set_time "02/24/73 14:00 est Saturday" sys_info.first_reasonable_time;
168                                                             /* The invention of NSS, roughly */
169           call set_time "09/10/2040 0400." sys_info.last_reasonable_time;
170 
171 
172           sys_info.hfp_exponent_available = "0"b;           /* we're all L68s on this bus */
173           sys_info.ips_mask_data = 11;                      /* number of known IPS events */
174           sys_info.quit_name = "quit";
175           sys_info.quit_mask = "1000"b;
176           sys_info.cput_name = "cput";
177           sys_info.cput_mask = "0100"b;
178           sys_info.alrm_name = "alrm";
179           sys_info.alrm_mask = "0010"b;
180           sys_info.neti_name = "neti";
181           sys_info.neti_mask = "0001"b;
182           sys_info.susp_name = "sus_";
183           sys_info.susp_mask = "00001"b;
184           sys_info.term_name = "trm_";
185           sys_info.term_mask = "000001"b;
186           sys_info.wkp_name = "wkp_";
187           sys_info.wkp_mask = "0000001"b;
188           sys_info.pgt_name = "pgt_";
189           sys_info.pgt_mask = "00000001"b;
190           sys_info.system_shutdown_scheduled_name = "system_shutdown_scheduled_";
191           sys_info.system_shutdown_scheduled_mask = "000000001"b;
192           sys_info.dm_shutdown_scheduled_name = "dm_shutdown_scheduled_";
193           sys_info.dm_shutdown_scheduled_mask = "0000000001"b;
194           sys_info.system_message_name = "system_message_";
195           sys_info.system_message_mask = "00000000001"b;
196           sys_info.all_valid_ips_mask = "11111111111"b;     /* format: off */
197           sys_info.ipc_privilege =     "1"b;
198           sys_info.dir_privilege =     "01"b;
199           sys_info.seg_privilege =     "001"b;
200           sys_info.soos_privilege =    "0001"b;
201           sys_info.ring1_privilege =   "00001"b;
202           sys_info.rcp_privilege =     "000001"b;
203           sys_info.comm_privilege =    "0000001"b;
204 /* format:  on */
205 
206 /* Now make some checks on alignment of certain variables */
207 
208           call check addr sys_info.successful_access_threshold "successful_access_threshold" 2;
209           call check addr sys_info.time_correction_constant "time_correction_constant" 2;
210           call check addr sys_info.time_of_bootload "time_of_bootload" 2;
211           call check addr sys_info.first_reasonable_time "first_reasonable_time" 2;
212           call check addr sys_info.last_reasonable_time "last_reasonable_time" 2;
213 
214 /* Now set up call to create data base */
215 
216           cdsa.sections 1.p = addr sys_info;
217           cdsa.sections 1.len = size sys_info;
218           cdsa.sections 1.struct_name = sys_infoname;
219 
220           cdsa.seg_name = sys_infoname;
221           cdsa.num_exclude_names = 1;
222           cdsa.exclude_array_ptr = addr exclude_pad;
223 
224           string cdsa.switches = "0"b;
225           cdsa.switches.have_text = "1"b;
226 
227           call create_data_segment_ addr cdsa code;
228 
229           if code ^= 0 then call com_err_ code sys_infoname;
230 
231 GIVE_IT_UP:
232           return;
233 %page;
234 check:
235      proc where message modulo;
236 
237 dcl  where ptr;
238 dcl  message char *;
239 dcl  modulo fixed bin;
240 
241           if mod binary rel where 18 - binary rel addr sys_info 18 modulo ^= 0 then do;
242                call com_err_ 0 sys_infoname "The variable ^a is not aligned on a ^d-word boundary." message modulo;
243                goto GIVE_IT_UP;
244                end;
245 
246      end check;
247 
248 
249 
250 set_time:
251      proc P_string P_time;
252 
253 dcl  
254      P_string char *
255      P_time fixed bin 71
256       parameter;
257 
258           call convert_date_to_binary_ P_string P_time code;
259 
260           if code ^= 0 then do;
261                call com_err_ code sys_infoname "Cannot convert ^a" P_string;
262                goto GIVE_IT_UP;
263                end;
264 
265           return;
266      end set_time;
267 %page;
268 %include cds_args;
269 %page;
270 %include aim_template;
271 %page;
272 %include system_types;
273 
274      end sys_info;
275