From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13232 invoked from network); 1 Sep 2021 18:10:44 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 1 Sep 2021 18:10:44 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 4A25E9D559; Thu, 2 Sep 2021 04:10:41 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 2CFD79BA1D; Thu, 2 Sep 2021 04:10:11 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=bsdimp-com.20150623.gappssmtp.com header.i=@bsdimp-com.20150623.gappssmtp.com header.b="oVZIS/e3"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 43EFC9BA1D; Thu, 2 Sep 2021 04:10:04 +1000 (AEST) Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) by minnie.tuhs.org (Postfix) with ESMTPS id 491EB9B9F9 for ; Thu, 2 Sep 2021 04:10:03 +1000 (AEST) Received: by mail-ua1-f50.google.com with SMTP id g2so347133uad.4 for ; Wed, 01 Sep 2021 11:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Kxnb8UJAXJGh8yvatQlYkmVfTKd4gR/9jYtHr+gTVqA=; b=oVZIS/e3O2w6y8KVo2MGPR0mdUAkPbaycV77M8ncRF3QbeY/76FopTJGJU+TrJm4lO 8Mankw2NrLS7xJTSVlK7u20W91lwWrBHDRgNF52cS77qUvgd8q6yBKfnpnyPVJFDb1Ye VMJUCOym7h0cc/QVzl0C/RjkFFEHAW6r3QGWfjbxixab9FEB2SZaERD7GpaEkx/2yhPw 1jI1JVSfzKVHt9UpWVrhZ3IARB2vN99sFBC8bnEEuzAJHmHtFoxdPNjRhSzlZBzO0srA L6ygCgnGGX2SLwWIjOhuoTqP4vqe8JsGDIEmXk/BsPJE9SV1U+oH5BOXMp4BoQH6LxfZ ReXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Kxnb8UJAXJGh8yvatQlYkmVfTKd4gR/9jYtHr+gTVqA=; b=QwqhcWMUS6Z0IQ5hdT/DI59aLPR0XwIdaHyKjggSmZ81A5KvgxfKM7pstI0kJR16Mm JZybVhSxq/uhxrALhbmkmnV7qMlHQs6ut6BqNYJpx7H/RMQagdQICcSDwiEtvYfbrwyz qa/4gZZkwXH74pDg1SSCfmNwMuTb3109mVH6F8Y97JPo3y9bfCmFDAU+yD2Ya7QnmK++ GEMZNkhAbIjhHg0qj+2S9PcgPqpjD2/3yOu64BRwaFnS78YKwwLK4KCedbRI9xX3Qsk7 /jzXGR7mNfVEh7LpdMGpZWih5s7R5IpubmFl3oZqZSvhAZRrVyLB6BiObJMktipM4V0o 5zFA== X-Gm-Message-State: AOAM5316Q3XrZ8GDsDus+SGZtnNsZuK2/K2n0LXw+rs9r7MovXXASoEj Pg/jVf5b9fyBcFi+kotTJlIMjKqVwI+rt5vRFBuzWnRq/0c= X-Google-Smtp-Source: ABdhPJwWBFnBPJn2UnMw8TKtIeX08HQmulQxqAsG6vBnM7IhRrEFGPz4Ak0k02NUZtCBB6kjDuCUN8aSYZ8idF1Yspo= X-Received: by 2002:ab0:74cc:: with SMTP id f12mr947514uaq.85.1630519802212; Wed, 01 Sep 2021 11:10:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Warner Losh Date: Wed, 1 Sep 2021 12:09:51 -0600 Message-ID: To: Ron Natalie Content-Type: multipart/alternative; boundary="0000000000009c443e05caf2f9e2" Subject: Re: [TUHS] A language question X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000009c443e05caf2f9e2 Content-Type: text/plain; charset="UTF-8" On Wed, Sep 1, 2021 at 10:07 AM Ron Natalie wrote: > I disagree. TRAP according to the processor handbook was intended to be > used for what UNIX calls system calls. EMT was the emulator trap used to > simulate other operating systems on the same hardware. Oddly, for some > reason, all the DEC OSes use EMT instructions for their system calls. > This came in handy when JHU ported BasicPlus from RSTS to UNIX. That > executable could run fine on UNIX because we caught the few EMT traps that > mattered to us and simulated them. The only thing we had to do other than > that was to add a "nostack()" system call that got rid of the normal > UNIX-maintained stack starting at the address space (RSTS executables like > many DEC OSs used a stack that started around 1000). > The various RT-11 emulators use variations on this theme as well, some inside the kernel, some as a signal handler (fast forward 40-odd years and I'm catching the SIGSEGV traps in executing 16-bit code to implement the unix system calls)... It's a very useful and elegant trick that's been oft-repeated. > Many of the UNIX signals come straight from PDP-11 traps: SIGFPE, SIGIOT, > SIGSEGV, SIGBUS, SIGILL, SIGEMT. and those traps invoked those signals. > Yes. They seemed to make perfect sense when I encountered them in Unix after growing up on RSTS/e and RT-11 before my first contact with Unix.... > FPE - floating point exception > ILL - illegal exception (either unknown opcode or CERTAIN of the > privileged instructions, others were ignored) > BUS - fatal unibus timeout trap. Usually an attempt to access a > memory/unibus address that doesn't respond, or to do word accesses on odd > boundaries. > SEGV - accessing memory not mapped to you > IOT - the IOT instruction > BPT - the BPT instruction > TRAP, EMT - these instructions > > --0000000000009c443e05caf2f9e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Sep 1, 2021 at 10:07 AM Ron N= atalie <ron@ronnatalie.com>= wrote:
I disagree.=C2=A0 TRAP according to the processor handbook was intended t= o be used for what UNIX calls system calls.=C2=A0 =C2=A0 EMT was the emulat= or trap used to simulate other operating systems on the same hardware.=C2= =A0 =C2=A0 Oddly, for some reason, all the DEC OSes use EMT instructions fo= r their system calls.=C2=A0 =C2=A0This came in handy when JHU ported BasicP= lus from RSTS to UNIX.=C2=A0 =C2=A0 =C2=A0That executable could run fine on= UNIX because we caught the few EMT traps that mattered to us and simulated= them.=C2=A0 =C2=A0The only thing we had to do other than that was to add a= "nostack()" system call that got rid of the normal UNIX-maintain= ed stack starting at the address space (RSTS executables like many DEC OSs = used a stack that started around 1000).

The various RT-11 emulators use variations on this theme as well, = some inside the kernel, some as a signal handler (fast forward 40-odd years= and I'm catching the SIGSEGV traps in executing 16-bit code to impleme= nt the unix system calls)... It's a very useful and elegant trick that&= #39;s been oft-repeated.
=C2=A0
Many of the UNIX signals come straight from= PDP-11 traps:=C2=A0 SIGFPE, SIGIOT, SIGSEGV, SIGBUS, SIGILL, SIGEMT. and t= hose traps invoked those signals.

Yes. They seemed to make perfect sense when I encountered them in Unix a= fter growing up on RSTS/e and RT-11 before my first contact with Unix....
=C2=A0
FPE - floating point exception
ILL - illegal exception (eit= her unknown opcode or CERTAIN of the privileged instructions, others were i= gnored)
BUS - fatal unibus timeout trap.=C2=A0 =C2=A0Usually an a= ttempt to access a memory/unibus address that doesn't respond, or to do= word accesses on odd boundaries.
SEGV - accessing memory not map= ped to you
IOT - the IOT instruction
BPT - the BPT inst= ruction
TRAP, EMT - these instructions

--0000000000009c443e05caf2f9e2--