From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id f68c2058 for ; Tue, 7 Jan 2020 21:09:15 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id E24189BCBF; Wed, 8 Jan 2020 07:09:13 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 908299BCAB; Wed, 8 Jan 2020 07:08:39 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="B+eyN7Nv"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 6FE0D9BCA9; Wed, 8 Jan 2020 07:08:36 +1000 (AEST) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) by minnie.tuhs.org (Postfix) with ESMTPS id A56C0945FC for ; Wed, 8 Jan 2020 07:08:35 +1000 (AEST) Received: by mail-qk1-f178.google.com with SMTP id r14so690648qke.13 for ; Tue, 07 Jan 2020 13:08:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yYtQeqcKa5HTYPo3fjaMvouB1xEswZVgCyH/9llIjU4=; b=B+eyN7Nv0ULUk4NyZbIkVcj9flyYzfRRkmswLAi1ahpLP4VxrwWg/rJTzJcFIsSRiq qegJc4lbpmeMHDwZfaZBdBn5ZKlWdQGsYw8Z72lu13Kq2gvx39JExAkpahItSO+fM92P a0iQFVpZvwiediNp/1ab2WHxH9XSDgCNUHAwQ= 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=yYtQeqcKa5HTYPo3fjaMvouB1xEswZVgCyH/9llIjU4=; b=I/Q1rxoLxAna4ela/NeSiMtN27jKIVQQPbem2Mv4pjDx2z9Nw9M4YPH5bch24L9u40 8yQS/yl+MV/3QX8HxvvNzvS4C89NUMAMZ/5B5kF4VxPdGWAlhznDz/T9BzuCYvp8zilF ni1hOdmsBHDN7a5V58pa3n+N84WeG6eaqS8SHA1Wo1x0gyaF4NPc+M65qxUXbaLHdAgY CcHumiY+8ed4hJB5qUSxZWZKDbTabwVhuIREu3h3plM+KbMpCG2GHt0z4BTkYZoM2kPw HGoD3S+uvkXK5mPhnWAhGqz4s05wpc5N/OaTI3QSemD3WRD/d5G7P51C9VeKdto2rtHh 1OqQ== X-Gm-Message-State: APjAAAWwiy8PkJpSLX6RuJo/7DEq/IHNziPCpAR+15hSYcTrXsoiSFjm mk9PURooUuewVOD3ch2ul8bes1NAtueN1tkn6hCSjA== X-Google-Smtp-Source: APXvYqyjgTm8CKc2ZE4PcJcGOH8p0i+bOUVtTUhv/+DqhLILEHKzSBpdQ8iU7pbFW2vVdgs5z9AifVddDeD/ZXSkB7g= X-Received: by 2002:a37:6346:: with SMTP id x67mr1292681qkb.476.1578431314462; Tue, 07 Jan 2020 13:08:34 -0800 (PST) MIME-Version: 1.0 References: <42cf63eb-d51e-d1ab-34ed-fbff94e18999@gmail.com> <682F5EA8-A1D2-4A5A-933F-C46B3631030E@gmail.com> <20200107200447.GA3211@mail.ewe2.ninja> In-Reply-To: <20200107200447.GA3211@mail.ewe2.ninja> From: Clem Cole Date: Tue, 7 Jan 2020 16:08:08 -0500 Message-ID: To: Sean Dwyer Content-Type: multipart/alternative; boundary="000000000000cd4630059b932dac" Subject: Re: [TUHS] wump.c for v6 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" --000000000000cd4630059b932dac Content-Type: text/plain; charset="UTF-8" Nice job -- one comment: You said at the end of your document: "Both cno and phx were written at what appears to have been what I would call v6b, version 6 as the standard library was moving from libS to libc, as Dennis Ritchie formalised the library proper. This can be seen in crt0.s where the form is not of standard V6 but of the libc V6 before it became standard in V7 and changed yet again. I was able to track this using the UNSW archives which have both libraries at the critical point." I will place a bet it is not your v6b idea... (which was basically V6 plus Ken's patch tape - although as Noel and I have decoded some of PWB 1.0 - which was based on V6 too -- made it into the wild in a couple of places). Anyway, I think you are seeing code output from what was called the 'Typesetter C" compiler release which came out before V7 and was needed to compile troff *et al.* which actually what conforms with the original K&R. Indeed, that compiler used libS as the library. The other thing, many v6 implementations (like CMU's and I think MIT) had a preprocessor (it was called /lib/cpp ) before we got Typesetter C. i.e. a version of cpp that predated the Riesner cpp rewrite that was in Typesetter C and later V7. Steve Johnson probably knows the history of the preprocessor better than I. I know when we went through the V5 to V6 upgrade we somehow had a preprocessor. I remember being curious about it and then being disappointed it was not as good as the BLISS macro facility. But ... neither the binary nor the sources for that cpp are in Warner's Archives for V6 when I just looked. The Interdata 7/32 stuff Warren has is a V6 port, and has a version of cpp, but a note in the source says it is based on what looks like the Typesetter C compiler - which was sometimes called the Level 7 compiler because Dennis had told us all it was the new compiler for the next releases (TS and V7). PWB 1.0 has a copy of cpp in the sources, but a quick look its not clear how close the V7 version it is. So, unless anyone else can illuminate, I'm not sure where the first cpp that some of us using v6 had originated. On Tue, Jan 7, 2020 at 3:14 PM Sean Dwyer via TUHS wrote: > On Mon, Jan 06, 2020 at 11:48:02AM -0700, Warner Losh wrote: > > On Mon, Jan 6, 2020 at 11:38 AM Will Senn wrote: > > > > > On 1/6/20 12:29 PM, Warner Losh wrote: > > > > > > The good news is that disassembly will tell you right away if it was > > > written in C or not. > > > > > > > > > OK. I give up. How? > > > > > > > Generally, the C compiler generates code that's quite distinctive (at > least > > PCC does, not sure about Dennis' compiler). People writing free assembler > > tend to do really weird things for function entry / return. > > > > And it will likely tell you if it's some weird wrapper around another > > binary, though that wasn't too common at bell labs. > > > > Warner > > A while back I did some analysis (https://ewe2.ninja/computers/cno/) of > another source-less v6 binary, cno. Fortunately, it hadn't been stripped > but I > still did some disasembly because of the interesting differences. v6 > binaries > have a different crt0 preamble and simpler subroutine setup, and I narrowed > dowh the library code to an intermediate stage of iolib (which IIRC still > exists in the UNSW archive on TUHS). There's a few cribs in that essay to > help > you figure out some basic things, pdp11 assembly isn't hard to decode. > > -- > I love deadlines. I love the whooshing noise as they fly by. > --000000000000cd4630059b932dac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Nice job -- one comment:=C2=A0 = You said at the end of your document:
"Both cno and phx were written at what appears to have b= een what I would call v6b, version 6 as the standard library was moving fro= m libS to libc, as Dennis Ritchie formalised the library proper. This can b= e seen in crt0.s where the form is not of standard V6 but of the libc V6 be= fore it became standard in V7 and changed yet again. I was able to track th= is using the UNSW archives which have both libraries at the critical point.= "

<= font color=3D"#0000ff">I will place a bet it is not your v6b idea...=C2=A0 = (which was basically V6 plus Ken's patch tape - although as Noel and I = have decoded some of PWB 1.0 - which was based on V6 too -- made it into th= e wild in a couple of places).=C2=A0 Anyway, I think you are seeing code ou= tput from what was called the 'Typesetter C" compiler release whic= h came out before V7 and was needed to compile troff et al.=C2=A0 wh= ich=C2=A0actually what conforms with the original K&R.=C2=A0 =C2=A0Inde= ed, that compiler used libS as the library.

<= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ">The other thing, many v6 imp= lementations (like CMU's and I think MIT) had a preprocessor (it was ca= lled /lib/cpp ) before we got Typesetter C.=C2=A0 i.e. a version of cpp tha= t predated the Riesner cpp rewrite that was in Typesetter C and later V7.= =C2=A0 Steve Johnson probably knows the history of the preprocessor better = than I.=C2=A0 =C2=A0I know when we went through the V5 to V6 upgrade we som= ehow had a preprocessor.=C2=A0 =C2=A0I remember being curious about it and = then being disappointed it was not as good as the BLISS macro facility.

=
= But ... neither the binary nor the sources for that cpp are in Warner's= Archives for V6 when I just looked.=C2=A0=C2=A0
=

The Interdata 7/32 stuf= f Warren has is a V6 port, and has a version of cpp, but a note in the sour= ce says it is based on what looks like the Typesetter C compiler - which wa= s sometimes called the Level 7 compiler because Dennis had told us all it w= as the=C2=A0new compiler for the next releases (TS and V7).

PWB 1.0 has = a copy of cpp in the sources, but a quick look its not clear how close the = V7 version it is.

So, unless anyone else can illuminate, I'm not sur= e where the first cpp that some of us using v6 had originated.

On Tue, Jan 7, 2020 at 3:14 PM Sean Dwyer via TUHS <tuhs@minnie.tuhs.org<= /a>> wrote:
O= n Mon, Jan 06, 2020 at 11:48:02AM -0700, Warner Losh wrote:
> On Mon, Jan 6, 2020 at 11:38 AM Will Senn <
will.senn@gmail.com> wrote:
>
> > On 1/6/20 12:29 PM, Warner Losh wrote:
> >
> > The good news is that disassembly will tell you right away if it = was
> > written in C or not.
> >
> >
> > OK. I give up. How?
> >
>
> Generally, the C compiler generates code that's quite distinctive = (at least
> PCC does, not sure about Dennis' compiler). People writing free as= sembler
> tend to do really weird things for function entry / return.
>
> And it will likely tell you if it's some weird wrapper around anot= her
> binary, though that wasn't too common at bell labs.
>
> Warner

A while back I did some analysis (https://ewe2.ninja/computers/cno/= ) of
another source-less v6 binary, cno. Fortunately, it hadn't been strippe= d but I
still did some disasembly because of the interesting differences. v6 binari= es
have a different crt0 preamble and simpler subroutine setup, and I narrowed=
dowh the library code to an intermediate stage of iolib (which IIRC still exists in the UNSW archive on TUHS). There's a few cribs in that essay = to help
you figure out some basic things, pdp11 assembly isn't hard to decode.<= br>
--
I love deadlines. I love the whooshing noise as they fly by.
--000000000000cd4630059b932dac--