COMPILATION LISTING OF SEGMENT dump_partition Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/15/82 1734.2 mst Mon 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 dump_partition: 12 procedure () options (variable); 13 14 /* * Command to use privileged partition I/O gate to display contents of disk partitions. 15* * 16* * dump_partition Pvname Partition_name Offset {Length} {-control_args} 17* * -header, -no_header, -short, -long, -character 18* * 19* * 10/18/80, W. Olin Sibert 20* */ 21 22 dcl ap pointer; 23 dcl al fixed bin (21); 24 dcl arg char (al) based (ap); 25 dcl rsp pointer; 26 dcl rsl fixed bin (21); 27 dcl rs char (rsl) varying based (rsp); 28 dcl code fixed bin (35); 29 dcl complain entry variable options (variable); 30 dcl (nargs, argno) fixed bin; 31 dcl af_sw bit (1) aligned; 32 33 dcl header_sw bit (1) aligned; 34 dcl pvname char (32); 35 dcl part_name char (4); 36 dcl pvid bit (36) aligned; 37 dcl offset fixed bin (35); 38 dcl lth fixed bin (18); 39 dcl part_lth fixed bin (35); 40 41 dcl 1 ds_arg unaligned, /* flags argument to dump_segment_ */ 42 (2 address, 43 2 offset, 44 2 short, 45 2 bcd, 46 2 ascii, 47 2 long, 48 2 ebcdic9, 49 2 ebcdic8, 50 2 fourbit, 51 2 hex8, 52 2 hex9) bit (1) unaligned; 53 54 dcl active_fnc_err_ entry options (variable); 55 dcl com_err_ entry options (variable); 56 dcl cu_$af_return_arg entry (fixed bin, pointer, fixed bin (21), fixed bin (35)); 57 dcl cu_$arg_ptr entry (fixed bin, pointer, fixed bin (21), fixed bin (35)); 58 dcl cv_oct_check_ entry (char (*), fixed bin (35)) returns (fixed bin (35)); 59 dcl dump_segment_ entry (pointer, pointer, fixed bin, fixed bin (35), fixed bin (18), bit (*)); 60 dcl find_partition_ entry (char (*), char (*), bit (36) aligned, fixed bin (35), fixed bin (35), fixed bin (35)); 61 dcl hphcs_$read_partition entry (bit (36) aligned, char (*), fixed bin (35), pointer, fixed bin (18), fixed bin (35)); 62 dcl hphcs_$write_partition entry (bit (36) aligned, char (*), fixed bin (35), pointer, fixed bin (18), fixed bin (35)); 63 dcl ioa_ entry options (variable); 64 dcl ioa_$rsnpnnl entry options (variable); 65 66 dcl (error_table_$badopt, 67 error_table_$too_many_args, 68 error_table_$noarg, 69 error_table_$not_act_fnc, 70 error_table_$bad_conversion) fixed bin (35) external static; 71 72 dcl iox_$user_output pointer external static; 73 74 dcl WHOAMI char (32) internal static options (constant) init ("dump_partition"); 75 76 dcl linkage_error condition; 77 78 dcl (addr, char, length, maxlength, rtrim, string) builtin; 79 80 /* */ 81 82 pvname = ""; 83 part_name = ""; 84 offset = -1; 85 lth = -1; 86 string (ds_arg) = ""b; 87 header_sw = "1"b; 88 89 call cu_$af_return_arg (nargs, rsp, rsl, code); 90 if code = 0 then do; 91 rs = ""; 92 complain = active_fnc_err_; 93 af_sw = "1"b; 94 end; 95 96 else if code = error_table_$not_act_fnc then do; 97 complain = com_err_; 98 af_sw = "0"b; 99 end; 100 101 else do; 102 call com_err_ (code, WHOAMI); 103 RETURN: return; 104 end; 105 106 do argno = 1 to nargs; 107 call cu_$arg_ptr (argno, ap, al, (0)); 108 109 if (arg = "-long") | (arg = "-lg") then 110 ds_arg.long = "1"b; 111 else if (arg = "-short") | (arg = "-sh") then 112 ds_arg.short = "1"b; 113 else if (arg = "-characters") | (arg = "-character") | (arg = "-char") | (arg = "-ch") then 114 ds_arg.ascii = "1"b; 115 else if (arg = "-bcd") then 116 ds_arg.bcd = "1"b; 117 else if (arg = "-header") | (arg = "-he") then 118 header_sw = "1"b; 119 else if (arg = "-no_header") | (arg = "-nhe") then 120 header_sw = "1"b; 121 122 else if char (arg, 1) = "-" then do; 123 call complain (error_table_$badopt, WHOAMI, "^a", arg); 124 goto RETURN; 125 end; 126 127 else if pvname = "" then /* first arg is volume name */ 128 pvname = arg; 129 130 else if part_name = "" then do; /* second arg is partition name */ 131 if length (rtrim (arg)) > maxlength (part_name) then do; 132 call complain (0, WHOAMI, "Partition name must be ^d characters or less. ^a", 133 maxlength (part_name), arg); 134 goto RETURN; 135 end; 136 137 part_name = rtrim (arg); 138 end; 139 140 else if offset < 0 then do; /* third arg is offset */ 141 offset = cv_oct_check_ (arg, code); 142 if code ^= 0 then 143 code = error_table_$bad_conversion; 144 145 if (code ^= 0) | (offset < 0) then do; 146 call complain (code, WHOAMI, "Offset must be a nonnegative octal number, not ^a", arg); 147 goto RETURN; 148 end; 149 end; 150 151 else if lth < 0 then do; /* fourth arg is length to dump */ 152 lth = cv_oct_check_ (arg, code); 153 if code ^= 0 then 154 code = error_table_$bad_conversion; 155 156 if (code ^= 0) | (lth < 0) then do; 157 call complain (code, WHOAMI, "Length must be a nonnegative octal number, not ^a", arg); 158 goto RETURN; 159 end; 160 end; 161 162 else do; 163 code = error_table_$too_many_args; 164 goto USAGE; 165 end; 166 end; /* of argument loop */ 167 168 if offset < 0 then do; /* length is optional */ 169 code = error_table_$noarg; 170 USAGE: call complain (code, WHOAMI, 171 "^/Usage:^-^a pvname part_name offset {length} {-control_args}", WHOAMI); 172 goto RETURN; 173 end; 174 175 /* */ 176 177 call find_partition_ (pvname, part_name, pvid, (0), part_lth, code); 178 if code ^= 0 then do; 179 call complain (code, WHOAMI, "Partition ^a on ^a", part_name, pvname); 180 goto RETURN; 181 end; 182 183 if lth <= 0 then /* apply defaults */ 184 lth = 1; 185 186 if (offset + lth) > part_lth then do; 187 call com_err_ (0, WHOAMI, "Partition ^a on ^a is only ^oo words long. Cannot dump ^oo words at ^oo.", 188 part_name, pvname, part_lth, lth, offset); 189 goto RETURN; 190 end; 191 192 ds_arg.offset = "1"b; /* print offset if we got a non-zero offset */ 193 /* Never print address column, because it's useless */ 194 195 begin; /* get a place to put the copied data */ 196 197 dcl copy_data (lth) bit (36) aligned; 198 199 on condition (linkage_error) begin; /* exit gracefully */ 200 call complain (0, WHOAMI, 201 "This opertaion requires privileged access (hphcs_) not given to this process."); 202 203 goto RETURN; /* and punt */ 204 end; 205 206 call hphcs_$read_partition (pvid, part_name, offset, addr (copy_data), lth, code); 207 208 revert condition (linkage_error); 209 210 if code ^= 0 then do; 211 call complain (code, WHOAMI, "Cannot read ^o word^[s^] from PV ^a, partition ^a|^o", 212 lth, (lth ^= 1), pvname, part_name, offset); 213 goto RETURN; 214 end; 215 216 if af_sw then /* return the result */ 217 call ioa_$rsnpnnl ("^(^w^x^)", rs, (0), copy_data); 218 219 else do; 220 if header_sw then 221 call ioa_ ("^/^3xVolume ^a, partition ^a: ^o word^[s^] at offset ^o:^/", 222 pvname, part_name, lth, (lth ^= 1), offset); 223 224 call dump_segment_ (iox_$user_output, addr (copy_data), 0, offset, lth, string (ds_arg)); 225 226 call ioa_ (""); /* blank line at the end */ 227 end; /* of command case */ 228 end; /* begin block */ 229 230 goto RETURN; /* all done */ 231 232 end dump_partition; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/15/82 1519.5 dump_partition.pl1 >dumps>old>recomp>dump_partition.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. WHOAMI 000000 constant char(32) initial unaligned dcl 74 set ref 102* 123* 132* 146* 157* 170* 170* 179* 187* 200* 211* active_fnc_err_ 000010 constant entry external dcl 54 ref 92 addr builtin function dcl 78 ref 206 206 224 224 af_sw 000116 automatic bit(1) dcl 31 set ref 93* 98* 216 al 000102 automatic fixed bin(21,0) dcl 23 set ref 107* 109 109 111 111 113 113 113 113 115 117 117 119 119 122 123 123 127 131 132 132 137 141 141 146 146 152 152 157 157 ap 000100 automatic pointer dcl 22 set ref 107* 109 109 111 111 113 113 113 113 115 117 117 119 119 122 123 127 131 132 137 141 146 152 157 arg based char unaligned dcl 24 set ref 109 109 111 111 113 113 113 113 115 117 117 119 119 122 123* 127 131 132* 137 141* 146* 152* 157* argno 000115 automatic fixed bin(17,0) dcl 30 set ref 106* 107* ascii 0(04) 000135 automatic bit(1) level 2 packed unaligned dcl 41 set ref 113* bcd 0(03) 000135 automatic bit(1) level 2 packed unaligned dcl 41 set ref 115* char builtin function dcl 78 ref 122 code 000107 automatic fixed bin(35,0) dcl 28 set ref 89* 90 96 102* 141* 142 142* 145 146* 152* 153 153* 156 157* 163* 169* 170* 177* 178 179* 206* 210 211* com_err_ 000012 constant entry external dcl 55 ref 97 102 187 complain 000110 automatic entry variable dcl 29 set ref 92* 97* 123 132 146 157 170 179 200 211 copy_data 000100 automatic bit(36) array dcl 197 set ref 206 206 216* 224 224 cu_$af_return_arg 000014 constant entry external dcl 56 ref 89 cu_$arg_ptr 000016 constant entry external dcl 57 ref 107 cv_oct_check_ 000020 constant entry external dcl 58 ref 141 152 ds_arg 000135 automatic structure level 1 packed unaligned dcl 41 set ref 86* 224 224 dump_segment_ 000022 constant entry external dcl 59 ref 224 error_table_$bad_conversion 000044 external static fixed bin(35,0) dcl 66 ref 142 153 error_table_$badopt 000034 external static fixed bin(35,0) dcl 66 set ref 123* error_table_$noarg 000040 external static fixed bin(35,0) dcl 66 ref 169 error_table_$not_act_fnc 000042 external static fixed bin(35,0) dcl 66 ref 96 error_table_$too_many_args 000036 external static fixed bin(35,0) dcl 66 ref 163 find_partition_ 000024 constant entry external dcl 60 ref 177 header_sw 000117 automatic bit(1) dcl 33 set ref 87* 117* 119* 220 hphcs_$read_partition 000026 constant entry external dcl 61 ref 206 ioa_ 000030 constant entry external dcl 63 ref 220 226 ioa_$rsnpnnl 000032 constant entry external dcl 64 ref 216 iox_$user_output 000046 external static pointer dcl 72 set ref 224* length builtin function dcl 78 ref 131 linkage_error 000000 stack reference condition dcl 76 ref 199 208 long 0(05) 000135 automatic bit(1) level 2 packed unaligned dcl 41 set ref 109* lth 000133 automatic fixed bin(18,0) dcl 38 set ref 85* 151 152* 156 183 183* 186 187* 197 206* 211* 211 220* 220 224* maxlength builtin function dcl 78 ref 131 132 132 nargs 000114 automatic fixed bin(17,0) dcl 30 set ref 89* 106 offset 0(01) 000135 automatic bit(1) level 2 in structure "ds_arg" packed unaligned dcl 41 in procedure "dump_partition" set ref 192* offset 000132 automatic fixed bin(35,0) dcl 37 in procedure "dump_partition" set ref 84* 140 141* 145 168 186 187* 206* 211* 220* 224* part_lth 000134 automatic fixed bin(35,0) dcl 39 set ref 177* 186 187* part_name 000130 automatic char(4) unaligned dcl 35 set ref 83* 130 131 132 132 137* 177* 179* 187* 206* 211* 220* pvid 000131 automatic bit(36) dcl 36 set ref 177* 206* pvname 000120 automatic char(32) unaligned dcl 34 set ref 82* 127 127* 177* 179* 187* 211* 220* rs based varying char dcl 27 set ref 91* 216* rsl 000106 automatic fixed bin(21,0) dcl 26 set ref 89* 91 216 rsp 000104 automatic pointer dcl 25 set ref 89* 91 216 rtrim builtin function dcl 78 ref 131 137 short 0(02) 000135 automatic bit(1) level 2 packed unaligned dcl 41 set ref 111* string builtin function dcl 78 set ref 86* 224 224 NAME DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. hphcs_$write_partition 000000 constant entry external dcl 62 NAMES DECLARED BY EXPLICIT CONTEXT. RETURN 000373 constant label dcl 103 ref 124 134 147 158 172 180 189 203 213 230 USAGE 001072 constant label dcl 170 ref 164 dump_partition 000275 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 2104 2154 1673 2114 Length 2352 1673 50 161 210 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME dump_partition 216 external procedure is an external procedure. begin block on line 195 144 begin block uses auto adjustable storage, and enables or reverts conditions. on unit on line 199 102 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME begin block on line 195 000100 copy_data begin block on line 195 dump_partition 000100 ap dump_partition 000102 al dump_partition 000104 rsp dump_partition 000106 rsl dump_partition 000107 code dump_partition 000110 complain dump_partition 000114 nargs dump_partition 000115 argno dump_partition 000116 af_sw dump_partition 000117 header_sw dump_partition 000120 pvname dump_partition 000130 part_name dump_partition 000131 pvid dump_partition 000132 offset dump_partition 000133 lth dump_partition 000134 part_lth dump_partition 000135 ds_arg dump_partition THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_ne_as enter_begin leave_begin call_var_desc call_ext_out_desc call_ext_out return tra_ext alloc_auto_adj enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. active_fnc_err_ com_err_ cu_$af_return_arg cu_$arg_ptr cv_oct_check_ dump_segment_ find_partition_ hphcs_$read_partition ioa_ ioa_$rsnpnnl THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. error_table_$bad_conversion error_table_$badopt error_table_$noarg error_table_$not_act_fnc error_table_$too_many_args iox_$user_output LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000274 82 000302 83 000305 84 000307 85 000311 86 000313 87 000315 89 000317 90 000333 91 000335 92 000336 93 000343 94 000345 96 000346 97 000351 98 000355 99 000356 102 000357 103 000373 106 000374 107 000403 109 000421 111 000436 113 000451 115 000474 117 000503 119 000516 122 000531 123 000540 124 000572 127 000573 130 000604 131 000611 132 000626 134 000666 137 000667 138 000672 140 000673 141 000675 142 000720 145 000725 146 000730 147 000762 149 000763 151 000764 152 000766 153 001013 156 001020 157 001023 158 001055 160 001056 163 001057 164 001062 166 001063 168 001065 169 001067 170 001072 172 001120 177 001121 178 001155 179 001157 180 001211 183 001212 186 001216 187 001226 189 001275 192 001276 195 001300 197 001303 216 001310 199 001320 200 001334 203 001362 206 001365 208 001424 210 001425 211 001430 213 001501 216 001504 220 001543 224 001611 226 001654 228 001665 230 001666 ----------------------------------------------------------- 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