Path: utzoo!utgpu!water!watmath!clyde!ima!johnl From: johnl@ima.ima.isc.com (John R. Levine) Newsgroups: comp.arch Subject: Re: call gates, was PEP: Page Execution Priviledge Summary: great minds think alike Message-ID: <2740@ima.ima.isc.com> Date: 6 Oct 88 03:13:47 GMT References: <2550@sultra.UUCP> <76700049@p.cs.uiuc.edu> <16017@ames.arc.nasa.gov> Reply-To: johnl@ima.UUCP (John R. Levine) Organization: Not much Lines: 30 In article <16017@ames.arc.nasa.gov> lamaster@ames.arc.nasa.gov.UUCP (Hugh LaMaster) writes: >May I assume that the [Multics] mechanism permitted unrestricted branching >WITHIN a particular code segment, and only restricted accesses OUTSIDE of the >current segment via a protected CALL/ENTER? > >This mechanism would seem to be a very low overhead means of providing >"top half of the kernel" type services to a process, since it provides >a protection mechanism which doesn't require a context switch. It also >extends nicely to a multiprocessor environment: anything which doesn't >require single threaded access could be in the protected system segments. >So, how come everybody doesn't do it? It's pretty common on machines with segmented addressing. Even the justly reviled Intel 286 has "call gates" which are funny segments that exist only to be entry points to protected segments. The gate segment's descriptor points to the actual address of the routine to call and has some other odds and ends like the number of argument words to copy from the caller's stack to the callee's stack. (Different modes have different stacks, otherwise you could compromise the system by setting the stack pointer to something bad and calling the system.) It is true that a call through a call gate takes 82 clocks as opposed to 26 clocks for a normal inter-segment call, but I suspect that for a system call that's not too bad. This sort of scheme only makes sense on a machine with segmented addresses, but on the small set of segmented machines I know (HP3000, B5500 et suc.) it is the standard method of making inter-mode transitions. -- John R. Levine, IECC, PO Box 349, Cambridge MA 02238-0349, +1 617 492 3869 { bbn | think | decvax | harvard | yale }!ima!johnl, Levine@YALE.something Rome fell, Babylon fell, Scarsdale will have its turn. -G. B. Shaw