Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hplabs!nsc!taux01!amos From: amos@taux01.UUCP (Amos Shapir) Newsgroups: comp.unix.wizards Subject: Re: Indirect system call Summary: That's a pdp11-ism Message-ID: <2825@taux01.UUCP> Date: 9 Nov 89 06:07:17 GMT References: <28945@shemp.CS.UCLA.EDU> Organization: National Semiconductor (IC) Ltd, Israel, Home of the 32532 Lines: 22 Hdate: 11 Heshvan 5750 That's an elegant way to bypass the separate instruction/data address space mechanism on high-end models of PDP11. Early version of UNIX passed arguments to system calls by putting them in the words following the "sys" instruction (a.k.a. as "trap"): sys 3; fd; addr; size (This was a standard way of passing arguments to subroutines and system calls in DEC's systems). When PDP11/45 and /70 came along, that posed a problem, since they used a double address space to increase the limit of 16 bit virtual addresses - data address 524 is in a different place than instruction address 524, and there is no way to access the latter except branch there. The "indirect" system call was invented to solve this problem: a "sys" instruction is prepared with all its arguments in data space, then an indirect call is performed to execute it. Execution is carried out by the kernel, which can access all of the user's space. -- Amos Shapir amos@taux01.nsc.com, amos@nsc.nsc.com National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel Tel. +972 52 522261 TWX: 33691, fax: +972-52-558322 GEO: 34 48 E / 32 10 N