COMPILATION LISTING OF SEGMENT gcos_create_file_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/19/82 1005.3 mst Fri Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 gcos_create_file_: proc (a_dname, a_ename, a_info_ptr, a_code); 12 13 14 /* *************************************************************** 15* *************************************************************** 16* * 17* * 18* * This subroutine is called to create a segment or multisegment 19* * file that is to be used as a GCOS file with the GCOS 20* * Environment Simulator. The data structure gcos_file_info 21* * contains all GCOS file attributes that can be specified by the 22* * caller. The size is converted to a total bit count and an MSF 23* * is created if necessary. 24* * 25* * 26* * Written by M. R. Jordan, 12/10/77 27* * 28* * 29* *************************************************************** 30* *************************************************************** */ 31 32 dcl BITS_PER_LLINK fixed bin static internal options (constant) init (11520); 33 dcl RW fixed bin (5) static internal options (constant) init (01010b); 34 dcl SMA fixed bin (5) static internal options (constant) init (01011b); 35 dcl a_code fixed bin (35); /* returned status code */ 36 dcl a_dname char (*); /* directory name passed by caller */ 37 dcl a_ename char (*); /* entry name passed by caller */ 38 dcl a_info_ptr ptr; /* ptr to file info passed by caller */ 39 dcl bit_count fixed bin (24); /* bit count passed to hcs_ */ 40 dcl code fixed bin (35); /* status code from hcs_ */ 41 dcl comp_name char (32) ; /* component name for msf component */ 42 dcl comp_name_len fixed bin; /* length of component name */ 43 dcl component fixed bin; /* component number */ 44 dcl cu_$level_get entry () returns (fixed bin); 45 dcl divide builtin; 46 dcl dname char (168); /* directory name used in calls to hcs_ */ 47 dcl ecode fixed bin (35); /* temp status code */ 48 dcl ename char (32); /* entry name used in calls to hcs_ */ 49 dcl get_group_id_$tag_star entry () returns (char (32)); 50 dcl hcs_$append_branchx entry (char (*), char (*), fixed bin (5), (3) fixed bin (3), char (*), fixed bin (1), fixed bin (1), fixed bin (24), fixed bin (35)); 51 dcl hcs_$delentry entry (char (*), char (*), fixed bin (35)); 52 dcl ioa_$rsnnl entry options (variable); 53 dcl max_bits_per_seg fixed bin (24); 54 dcl max_llinks_per_seg fixed bin; 55 dcl msf_name char (168) ; /* name of msf being created */ 56 dcl msf_name_len fixed bin; /* length of msf name */ 57 dcl ncomp fixed bin; /* number of components needed */ 58 dcl rings (3) fixed bin (3) ; 59 dcl substr builtin; 60 dcl sys_info$max_seg_size fixed bin (24) ext; 61 dcl total_bit_count fixed bin (71); /* total bit count to represent # llinks */ 62 dcl user_id char (32); /* person.project.* */ 63 1 1 1 2 /* Begin include file ...... gcos_file_info.incl.pl1 */ 1 3 1 4 dcl gcos_file_info_ptr ptr; /* ptr to the info structure */ 1 5 1 6 dcl 1 gcos_file_info aligned based (gcos_file_info_ptr), /* a structure describing a GCOS file */ 1 7 2 version fixed bin, /* must be 1 */ 1 8 2 size_in_llinks fixed bin (35), /* number of 320 word units in file */ 1 9 2 max_size_in_llinks fixed bin (35), /* max number of these units */ 1 10 2 flags unal, 1 11 3 random bit (1), /* =1 if file is random */ 1 12 3 pad bit (35), 1 13 3 original_file_has_been_written bit (1), /* set =1 on first file write */ 1 14 3 user_specified_attributes bit (35), /* user attributes info */ 1 15 2 ids_attributes unal, /* IDS attributes */ 1 16 3 first_page_in_subfile fixed bin (17), 1 17 3 last_page_in_subfile fixed bin (17), 1 18 3 multiuser bit (1), 1 19 3 reserveed_1 bit (17), 1 20 3 words_per_page fixed bin (17), 1 21 3 reserved_2 bit (18), 1 22 3 lines_per_page fixed bin (17), 1 23 3 reserved_3 bit (18), 1 24 3 page_fill_percent bit (18), 1 25 3 reserved_4 bit (6), 1 26 3 area_number fixed bin (5), 1 27 3 reserved_5 bit (6), 1 28 3 num_pages_in_area fixed bin (17), 1 29 3 minus_one fixed bin (35), 1 30 3 reserved_6 (51) bit (36); 1 31 1 32 /* End include file ...... gcos_file_info.incl.pl1 */ 1 33 64 65 66 /* 67* 68* Copy all input arguments. 69* 70**/ 71 72 73 dname = a_dname; 74 ename = a_ename; 75 gcos_file_info_ptr = a_info_ptr; 76 77 78 /* 79* 80* Initialize a few essential data items. 81* 82**/ 83 84 85 code = 0; 86 max_bits_per_seg = sys_info$max_seg_size*36; 87 max_llinks_per_seg = divide (max_bits_per_seg, BITS_PER_LLINK, 17, 0); 88 rings (*) = cu_$level_get (); 89 user_id = get_group_id_$tag_star (); 90 91 92 /* 93* 94* Determine the number of components to be created and the total bit count needed. 95* 96**/ 97 98 99 ncomp = divide (gcos_file_info.size_in_llinks+max_llinks_per_seg-1, max_llinks_per_seg, 17); 100 total_bit_count = gcos_file_info.size_in_llinks*BITS_PER_LLINK; /* BITS_PER_LLINK = 320 * 36 */ 101 102 103 /* 104* 105* If only one component is to be created, do so. 106* Otherwise, create a MSF with the required number 107* of components. 108* 109**/ 110 111 112 if ncomp = 1 then call Create_A_Seg (); 113 else call Create_A_MSF (); 114 115 116 /* 117* 118* We are all finished. Clean up and get out. 119* 120**/ 121 122 123 a_code = code; 124 125 return; 126 127 /* 128* 129* This internal procedure creates a multisegment file with the proper 130* bit count and access. 131* 132**/ 133 134 135 Create_A_MSF: proc (); 136 137 138 call hcs_$append_branchx (dname, ename, SMA, rings, user_id, 1, 0, (ncomp), code); 139 if code ^= 0 then return; 140 141 142 do component = 0 to ncomp-1; 143 144 if total_bit_count <= max_bits_per_seg then bit_count = total_bit_count; 145 else bit_count = max_bits_per_seg; 146 total_bit_count = total_bit_count-bit_count; 147 148 call ioa_$rsnnl ("^a^[>^]^a", msf_name, msf_name_len, dname, (dname ^= ">"), ename); 149 call ioa_$rsnnl ("^d", comp_name, comp_name_len, component); 150 151 call hcs_$append_branchx (substr (msf_name, 1, msf_name_len), substr (comp_name, 1, comp_name_len), 152 RW, rings, user_id, 0, 0, bit_count, code); 153 if code ^= 0 then do; 154 call hcs_$delentry (dname, ename, ecode); 155 return; 156 end; 157 158 end; 159 160 161 return; 162 163 164 end Create_A_MSF; 165 166 /* 167* 168* This internal procedure creates a segment with the proper bit count 169* and access. 170* 171**/ 172 173 174 Create_A_Seg: proc (); 175 176 177 bit_count = total_bit_count; 178 call hcs_$append_branchx (dname, ename, RW, rings, 179 user_id, 0, 0, bit_count, code); 180 if code ^= 0 then return; 181 182 183 end Create_A_Seg; 184 185 186 187 end gcos_create_file_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/19/82 0930.8 gcos_create_file_.pl1 >spec>on>11/19/82>gcos_create_file_.pl1 64 1 03/27/82 0439.3 gcos_file_info.incl.pl1 >ldd>include>gcos_file_info.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. BITS_PER_LLINK constant fixed bin(17,0) initial dcl 32 ref 87 100 RW 000001 constant fixed bin(5,0) initial dcl 33 set ref 151* 178* SMA 000000 constant fixed bin(5,0) initial dcl 34 set ref 138* a_code parameter fixed bin(35,0) dcl 35 set ref 11 123* a_dname parameter char unaligned dcl 36 ref 11 73 a_ename parameter char unaligned dcl 37 ref 11 74 a_info_ptr parameter pointer dcl 38 ref 11 75 bit_count 000100 automatic fixed bin(24,0) dcl 39 set ref 144* 145* 146 151* 177* 178* code 000101 automatic fixed bin(35,0) dcl 40 set ref 85* 123 138* 139 151* 153 178* 180 comp_name 000102 automatic char(32) unaligned dcl 41 set ref 149* 151 151 comp_name_len 000112 automatic fixed bin(17,0) dcl 42 set ref 149* 151 151 component 000113 automatic fixed bin(17,0) dcl 43 set ref 142* 149* cu_$level_get 000010 constant entry external dcl 44 ref 88 divide builtin function dcl 45 ref 87 99 dname 000114 automatic char(168) unaligned dcl 46 set ref 73* 138* 148* 148 154* 178* ecode 000166 automatic fixed bin(35,0) dcl 47 set ref 154* ename 000167 automatic char(32) unaligned dcl 48 set ref 74* 138* 148* 154* 178* gcos_file_info based structure level 1 dcl 1-6 gcos_file_info_ptr 000272 automatic pointer dcl 1-4 set ref 75* 99 100 get_group_id_$tag_star 000012 constant entry external dcl 49 ref 89 hcs_$append_branchx 000014 constant entry external dcl 50 ref 138 151 178 hcs_$delentry 000016 constant entry external dcl 51 ref 154 ioa_$rsnnl 000020 constant entry external dcl 52 ref 148 149 max_bits_per_seg 000177 automatic fixed bin(24,0) dcl 53 set ref 86* 87 144 145 max_llinks_per_seg 000200 automatic fixed bin(17,0) dcl 54 set ref 87* 99 99 msf_name 000201 automatic char(168) unaligned dcl 55 set ref 148* 151 151 msf_name_len 000253 automatic fixed bin(17,0) dcl 56 set ref 148* 151 151 ncomp 000254 automatic fixed bin(17,0) dcl 57 set ref 99* 112 138 142 rings 000255 automatic fixed bin(3,0) array dcl 58 set ref 88* 138* 151* 178* size_in_llinks 1 based fixed bin(35,0) level 2 dcl 1-6 ref 99 100 substr builtin function dcl 59 ref 151 151 151 151 sys_info$max_seg_size 000022 external static fixed bin(24,0) dcl 60 ref 86 total_bit_count 000260 automatic fixed bin(71,0) dcl 61 set ref 100* 144 144 146* 146 177 user_id 000262 automatic char(32) unaligned dcl 62 set ref 89* 138* 151* 178* NAMES DECLARED BY EXPLICIT CONTEXT. Create_A_MSF 000154 constant entry internal dcl 135 ref 113 Create_A_Seg 000474 constant entry internal dcl 174 ref 112 gcos_create_file_ 000033 constant entry external dcl 11 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 664 710 555 674 Length 1104 555 24 157 107 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME gcos_create_file_ 324 external procedure is an external procedure. Create_A_MSF internal procedure shares stack frame of external procedure gcos_create_file_. Create_A_Seg internal procedure shares stack frame of external procedure gcos_create_file_. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME gcos_create_file_ 000100 bit_count gcos_create_file_ 000101 code gcos_create_file_ 000102 comp_name gcos_create_file_ 000112 comp_name_len gcos_create_file_ 000113 component gcos_create_file_ 000114 dname gcos_create_file_ 000166 ecode gcos_create_file_ 000167 ename gcos_create_file_ 000177 max_bits_per_seg gcos_create_file_ 000200 max_llinks_per_seg gcos_create_file_ 000201 msf_name gcos_create_file_ 000253 msf_name_len gcos_create_file_ 000254 ncomp gcos_create_file_ 000255 rings gcos_create_file_ 000260 total_bit_count gcos_create_file_ 000262 user_id gcos_create_file_ 000272 gcos_file_info_ptr gcos_create_file_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as alloc_cs call_ext_out_desc call_ext_out return shorten_stack ext_entry_desc divide_fx3 THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. cu_$level_get get_group_id_$tag_star hcs_$append_branchx hcs_$delentry ioa_$rsnnl THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. sys_info$max_seg_size LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000026 73 000053 74 000061 75 000065 85 000070 86 000071 87 000074 88 000076 89 000115 99 000124 100 000137 112 000142 113 000147 123 000150 125 000153 135 000154 138 000155 139 000231 142 000234 144 000243 145 000252 146 000254 148 000260 149 000326 151 000354 153 000444 154 000447 155 000470 158 000471 161 000473 174 000474 177 000475 178 000477 180 000550 183 000553 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved