/* ****************************************************** * * * * * Copyright (c) 1972 by Massachusetts Institute of * * Technology and Honeywell Information Systems, Inc. * * * * * ****************************************************** */ /* FIRMWARE_UTIL_ - A procedure for locating firmware segments in a firmware archive */ /* Written July 1975 by Larry Johnson */ firmware_util_: proc; return; /* parameters */ dcl fwptr ptr; /* pointer to firmware archive */ dcl code fixed bin (35); /* system status code */ dcl ident char (6); /* firmware program ident */ dcl name char (4); /* firmware program name */ dcl segp ptr; /* returned pointer to firmware segment */ dcl seglen fixed bin (18); /* returned length of firmware segment */ /* automatic storage */ dcl dir char (168); /* directory name */ dcl ename char (32); /* entry name */ dcl v_ename char (32) varying; /* varying form of entry name */ dcl segname char (32); /* name of segment in archive */ dcl ac_code fixed bin; /* error code form archive_util_ */ dcl head_ptr ptr; /* pointer to header in archive */ dcl temp_ptr ptr; dcl star_sw bit (1); /* set if name uses star convention */ dcl bit_count fixed bin (24); /* bit count of segment */ /* entry variables */ dcl get_wdir_ entry returns (char (168)); dcl hcs_$initiate entry (char (*), char (*), char (*), fixed bin (1), fixed bin (2), ptr, fixed bin (35)); dcl hcs_$terminate_noname entry (ptr, fixed bin (35)); dcl archive_util_$first_element entry (ptr, fixed bin); dcl archive_util_$first_disected entry (ptr, ptr, char (32), fixed bin (24), fixed bin); dcl archive_util_$disected_element entry (ptr, ptr, char (32), fixed bin (24), fixed bin); dcl match_star_name_ entry (char (*), char (*), fixed bin (35)); dcl error_table_$noentry ext fixed bin (35); dcl error_table_$archive_fmt_err ext fixed bin (35); dcl error_table_$zero_length_seg ext fixed bin (35); dcl (divide, index, null, substr) builtin; /* entry point to initialize processing of firmware directory */ init: entry (fwptr, code); dir = get_wdir_ (); /* use working directory for now */ call hcs_$initiate (dir, "firmware.archive", "", 0, 0, fwptr, code); /* initiate segment */ if fwptr = null then do; /* failed in -wd so try >firmware */ call hcs_$initiate (">firmware", "firmware.archive", "", 0, 0, fwptr, code); if fwptr = null then return; /* failed there too */ end; call archive_util_$first_element (fwptr, ac_code); /* check first element */ if ac_code = 0 then do; /* archive ok */ code = 0; /* return good status */ return; end; call hcs_$terminate_noname (fwptr, code); /* bad archive, so terminate */ if ac_code = 1 then code = error_table_$zero_length_seg; /* if empty */ else code = error_table_$archive_fmt_err; /* if bad format */ return; /* entry point to locate a firmware segment in the archive */ find: entry (fwptr, ident, name, segp, seglen, code); /* first build name of module to be found (may be a star name) */ star_sw = "0"b; /* use of star convention not found yet */ v_ename = "fw."; /* standard first component */ v_ename = v_ename || cvt_name (ident); /* add ident portion */ v_ename = v_ename || "."; v_ename = v_ename || cvt_name (name); /* add name portion */ ename = v_ename; /* final name */ /* check first entry */ head_ptr = fwptr; /* initialize pointer for the scan */ call archive_util_$first_disected (head_ptr, temp_ptr, segname, bit_count, ac_code); if ac_code ^= 0 then do; /* some error */ if ac_code = 1 then code = error_table_$zero_length_seg; else code = error_table_$archive_fmt_err; segp = null; seglen = 0; return; end; /* check to see if this is the entry wanted */ check: if star_sw then do; /* if start name needed */ call match_star_name_ (segname, ename, code); /* try match */ if code = 0 then go to hit; /* found it */ end; else if segname = ename then go to hit; /* simple match will do */ /* step to next entry in segment */ call archive_util_$disected_element (head_ptr, temp_ptr, segname, bit_count, ac_code); if ac_code = 0 then go to check; /* if no error, check for match */ if ac_code = 1 then code = error_table_$noentry; /* not found */ else code = error_table_$archive_fmt_err; segp = null; seglen = 0; return; /* come here when match made */ hit: segp = temp_ptr; seglen = divide (bit_count, 36, 18, 0); code = 0; return; /* subroutine to return character string with leading and trailing blanks removed */ cvt_name: proc (string) returns (char (6) var); dcl string char (*); dcl temp char (6); dcl i fixed bin; temp = string; /* copy input */ loop: if temp = "" | temp = "*" then do; star_sw = "1"b; return ("*"); end; i = index (temp, " "); /* find a blank */ if i = 0 then return (temp); /* no blanks */ if i = 1 then do; /* blank is first */ temp = substr (temp, 2); go to loop; end; return (substr (temp, 1, i-1)); /* return string without trailing blanks */ end cvt_name; end firmware_util_; */ ----------------------------------------------------------- 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 */