[TUHS] S2-bits V2 Source Code Restoration

segaloco via TUHS tuhs at tuhs.org
Mon Apr 24 03:45:48 AEST 2023


Hi folks, sharing another project that I've been tinkering on for a little bit since I like having a lot of irons in the fire: https://gitlab.com/segaloco/v2src

After the link is a repository which over time will be accumulating the results of disassembly and analysis of files found in the s2-bits.tar.gz file in the archive.  Details of my process are contained in the repository's readme.  The short of it is I'm disassembling the binaries one by one, and where possible am comparing them with known sources to massage these into a pretty close restoration of the original sources.

A few discoveries I've made in the process thus far:

    - These binaries appear to represent a version between the first and second editions.  The binaries themselves are a mix of "naked" binaries as well as V1 and V2 a.out formats.  Where it matters, things are much closer in character to V2 than V1.

    - All section 1 content that would be gone by V2 is removed here.  Curiously, mount(1), type(1), and umount(1) which are in both V1 and V2 are absent from the s2-bits.

    - The sources marked "V2" in the UNIX source tree may be a bit closer in character to V3.  Notable examples are that, while string references to /etc/uids remain, all data references have been updated to /etc/passwd, and several mathematical operations in the disassembled binaries map to KE-11 Extended Arithemtic Element registers where in the sources labeled "V2" in the tree have instead shifted to doing these calculations differently, presumably as these sources target the 11/45, not the 11/20.  Additionally, the cat.s in "V2" on the tree contains the '-' stdin option, which was first documented in V3.  The most likely story is that they're somewhere between, just like the s2-bits are between V1 and V2, but all of these observed differences thus far have aligned the sources with their descriptions in the third edition manual.

Anywho, as usual, if anyone spots anything amiss or that could be done better, happy to accept contributions, or fork it and tinker away.  Also, if anyone has already done this, speak up and tell me now so I don't double up on something so involved =P

- Matt G.


More information about the TUHS mailing list