/* *********************************************************** * * * Copyright, (C) Honeywell Information Systems Inc., 1982 * * * * Copyright (c) 1972 by Massachusetts Institute of * * Technology and Honeywell Information Systems, Inc. * * * *********************************************************** */ ring_zero_peek_filter_: proc (from_pointer, to_pointer, word_count, code); /* This is a ring-1 program which filters ring-0 peek requests and passes valid requests to ring-0. Valid requests are those whose target lies entirely within a region defined in a table (>system_library_1>ring_zero_meter_limits.table). This filter is intended to allow limited read access to ring-0 segments (for example, to users interested in metering information) without giving away the entire (ring-0) farm. Re-written in December 80 by J. Bongiovanni for new table format */ /* Parameter */ dcl from_pointer ptr; /* pointer to ring-0 data */ dcl to_pointer ptr; /* where to copy data to */ dcl word_count fixed bin (19); /* number of words to copy */ dcl code fixed bin (35); /* standard error code */ /* Automatic */ dcl begin_word fixed bin (19); dcl end_word fixed bin (19); dcl found_valid bit (1); dcl save_level fixed bin (3); dcl seg_no fixed bin; dcl valid_length fixed bin (19); dcl valid_pointer ptr; /* Static */ dcl meter_limits_table_ptr ptr int static init (null()); dcl LIMITSEG_DIR char (17) init (">system_library_1") int static options (constant); dcl LIMITSEG_NAME char (28) init ("ring_zero_meter_limits.table") int static options (constant); /* Based */ %include meter_limits; /* Entry */ dcl admin_ring_zero_peek_ entry (ptr, ptr, fixed bin (19)); dcl get_ring_ entry() returns(fixed bin(3)); dcl hcs_$initiate entry (char(*), char(*), char(*), fixed bin(1), fixed bin(2), ptr, fixed bin(35)); dcl hcs_$level_get entry (fixed bin (3)); dcl hcs_$level_set entry (fixed bin (3)); /* External */ dcl error_table_$bad_arg fixed bin (35) external; dcl error_table_$no_info fixed bin (35) external; dcl error_table_$segknown fixed bin (35) external; /* Builtin */ dcl baseno builtin; dcl bin builtin; dcl null builtin; dcl ptr builtin; dcl rel builtin; /* */ /* Initialize if this is the first call. Note that meter_limits_table.initialized will be off if either the initialization program (initialize_peek_limits) was never called, or if it encountered an irrecoverable error. In either case, no access to ring-0 can be allowed through this filter */ if meter_limits_table_ptr=null() then do; call hcs_$level_get (save_level); call hcs_$level_set (get_ring_ ()); /* Prevent user foolishness */ call hcs_$initiate (LIMITSEG_DIR, LIMITSEG_NAME, "", 0, 1, meter_limits_table_ptr, code); call hcs_$level_set (save_level); if code^=0 then if code^=error_table_$segknown then return; else code = 0; if ^meter_limits_table_ptr->meter_limits_table.initialized then do; /* table not valid */ meter_limits_table_ptr = null(); /* set to try again on next call */ code = error_table_$no_info; return; end; end; /* Copy ring-0 pointer and number of words so that caller can't change them after we validate */ valid_pointer = from_pointer; valid_length = word_count; if valid_length < 0 then do; code = error_table_$bad_arg; return; end; /* Check filter table to make sure request is entirely within a region defined therein */ mtablep = meter_limits_table_ptr; seg_no = bin (baseno (valid_pointer), 17); if seg_no<0 | seg_no>meter_limits_table.high_seg_no then do; reject: code = error_table_$no_info; return; end; found_valid = "0"b; begin_word = bin (rel (valid_pointer), 19); end_word = begin_word + valid_length -1; mentryp = ptr (mtablep, thread_head (seg_no)); do while (^found_valid&mentryp^=mtablep); if begin_word>=meter_limits_entry.begin_offset & end_word<=meter_limits_entry.end_offset then found_valid = "1"b; mentryp = ptr (mtablep, meter_limits_entry.thread); end; if ^found_valid then goto reject; code = 0; call admin_ring_zero_peek_ (valid_pointer, to_pointer, valid_length); return; end ring_zero_peek_filter_; */ ----------------------------------------------------------- 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 */