The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: segaloco via TUHS <tuhs@tuhs.org>
To: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Re: Software written in B
Date: Thu, 08 Jun 2023 02:10:08 +0000	[thread overview]
Message-ID: <I_q24DGoCcxqXBOm0bf0XCCXM77jn9grTan1ZiU6BebeJ08b9YJA_-hjd78d4pUEbYiBxqgKxDApytka_HQQfLJvHSoTd00EebtRzxJ5z7M=@protonmail.com> (raw)
In-Reply-To: <EB675D9F-B739-4542-A981-6E594327EA38@humeweb.com>

> Of course, B was a "transition" language, that did not have a continued
use as soon as it evolved into C. so if any software remains, it will be
quite hard to find.

There is a bit of binary code from that transition period that may hold some answers.  In my disassembly of the s2-bits binaries (V2-ish), I've come across the following that bear a particular signature I can't identify otherwise:

echo, exit, glob, goto, if, mail, skip, stty, su

This "signature" I refer to being a few properties of the a.out files and initial flow of the entry compared with other binaries of known source code origin.  First, these are all magic number 405(8) binaries, so V1 era a.out.  Second, in each case, the initial branch is to a jump vector which then performs a r5-relative subroutine call followed by a halt in the case of fallthrough.  In other words:

    br  _start  / 405(8)
    ...
_start:
    jmp innerstart    / some faraway place
    ...
innerstart:
    jsr r5,main    / always 004567 000042
    halt
    ...
main:
    inc somevalue   / always 005267 000136 or 005267 000140
    ...

Finally, these all appear to have the four characters "Init" strewn in there with a bunch of binary data.  It is consistently in all of the above binaries exhibiting these other two patterns.  I don't have any confirmed B code/binaries to compare against, so I can't say that this is a signature of B, but it is a signature of *something*.  Whatever it is these all share it.

This can be compared with disassembly of programs like:

    - ln, a "naked" binary in that it has no a.out header that immediately calls break
    - chown, a V1 a.out (magic number 405(8)) that jumps immediately into the assembly routine
    - find, a V2 a.out (magic number 407(8)) that does the same
    - fc, a V2 a.out compiled from C that branches into a crt0 startup that then jumps to main, this crt0 startup matches the crt0.o file in s2-bits

Something of note too with the above programs is that the earliest preserved versions of each are all in C.  That being exit, glob, goto, and if from the s1-bits tape (V3-ish) as well as echo, mail, stty, and su in V5 (not sure what skip is/was).  This is all pretty compelling, but conjecture nonetheless.  Perhaps it will draw hard proof closer.

- Matt G.

P.S., these are the other s2-bits binaries by "signature":

    - naked - cal, chmod, dsw, ln, rm
    - V1 asm - :, ar, bas, cat, chball, check, chown, cmp, cp, date, db, dc, df, du, ed, form, getty, init, login, ls, mesg, mkdir, msh, mv, od, pr, rew, rmdir, roff, sh, sort, stat, sum, tap, tm, tty, wc, who, write
    - V2 asm - as, as2, ds, find, ld, maki, nm, strip, un
    - V2 C - cc, fc, size

  reply	other threads:[~2023-06-08  2:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 10:14 [TUHS] " Sebastien F4GRX
2023-06-07 10:38 ` [TUHS] " Lars Brinkhoff
2023-06-07 15:05 ` Angelo Papenhoff
2023-06-07 15:57 ` Clem Cole
2023-06-07 16:21   ` Lars Brinkhoff
2023-06-07 17:26 ` Bakul Shah
2023-06-07 18:16 ` Phil Budne
2023-06-07 23:49 ` Andrew Hume
2023-06-08  2:10   ` segaloco via TUHS [this message]
2023-06-08  3:31     ` Phil Budne
2023-06-08 15:05       ` segaloco via TUHS
2023-06-14 11:51         ` Angelo Papenhoff
2023-06-14 20:03           ` Angelo Papenhoff
2023-06-14 21:53             ` segaloco via TUHS
2023-06-14 22:05               ` Angelo Papenhoff
2023-06-15  8:00             ` Sebastien F4GRX
2023-06-15  8:21               ` Angelo Papenhoff
2023-06-15  8:33                 ` Sebastien F4GRX
2023-06-17  8:19             ` Angelo Papenhoff
2023-06-19  9:52               ` Sebastien F4GRX
2023-06-19 10:18                 ` Sebastien F4GRX
2023-06-19 10:48                   ` Lars Brinkhoff
2023-06-19 10:55                     ` G. Branden Robinson
2023-06-19 11:07                       ` Sebastien F4GRX
2023-06-19 18:44                         ` segaloco via TUHS
2023-06-23 10:59               ` Angelo Papenhoff
2023-06-23 13:32                 ` Sebastien F4GRX
2023-06-23 14:01                   ` Angelo Papenhoff
2023-06-23 14:14                     ` Sebastien F4GRX
2023-06-23 14:39                       ` Angelo Papenhoff
2023-06-23 14:10                 ` Sebastien F4GRX
2023-06-23 14:49                   ` Angelo Papenhoff
2023-06-23 15:31                     ` Sebastien F4GRX
2023-06-23 15:36                       ` Angelo Papenhoff
2023-06-23 15:53                         ` Sebastien F4GRX
2023-06-08 14:41   ` arnold
2023-06-09  8:56 ` Sebastien F4GRX
2023-06-09  9:57   ` Lars Brinkhoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='I_q24DGoCcxqXBOm0bf0XCCXM77jn9grTan1ZiU6BebeJ08b9YJA_-hjd78d4pUEbYiBxqgKxDApytka_HQQfLJvHSoTd00EebtRzxJ5z7M=@protonmail.com' \
    --to=tuhs@tuhs.org \
    --cc=segaloco@protonmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).