On 2/25/23, Brian Walden <tuhs(a)cuzuco.com> wrote:
> It was originaly 205. See A.OUT(V) (the first page) at
> https://www.bell-labs.com/usr/dmr/www/man51.pdf it was documented as to
> why.
>
>
> The header always contains 6 words:
> 1 "br .+14" instruction (205(8))
> 2 The size of the program text
> 3 The size of the symbol table
> 4 The size of the relocation bits area
> 5 The size of a data area
> 6 A zero word (unused at present)
>
> I always found this so elegant in it's simplicity. Just load and start
> execution at the start (simplifies exec(2) in the kernel) I always wondered
> if this has done anywhere else before, or invenetd first in unix.
IBM's Basic Program Support (BPS) for System/360 was a set of
stand-alone utilities for developing and running stand-alone programs.
BPS/360 wasn't really an operating system because there wasn't any
resident kernel. You just IPLed (Initial Program Load; IBM-speak for
"boot") your application directly. So the executable format for BPS
had a bootstrap loader as the "program header". Not quite the same
thing as a.out's 205(8) magic number, but similar in concept.
I don't know of any other OS ABI that uses this trick to transfer
control to application programs.
Microsoft uses something similar in PECOFF. A PECOFF executable for
x86 or X86-64 starts with a bit of code in MS-DOS MZ executable format
that prints the message "This program cannot be run in DOS mode".
-Paul W.
It was originaly 205. See A.OUT(V) (the first page) at https://www.bell-labs.com/usr/dmr/www/man51.pdf it was documented as to why.
The header always contains 6 words:
1 "br .+14" instruction (205(8))
2 The size of the program text
3 The size of the symbol table
4 The size of the relocation bits area
5 The size of a data area
6 A zero word (unused at present)
I always found this so elegant in it's simplicity. Just load and start
execution at the start (simplifies exec(2) in the kernel) I always wondered
if this has done anywhere else before, or invenetd first in unix.
Theres was also a recent discussion of ar(1). That pdf also explains its magic
number a few pages later. It was simply choosen because it seemed unique.
A file produced by ar has a "magic number" at the start,
followed by the constituent files, each preceded by a file
header. The magic number is -147(10), or 177555(8) (it was
chosen to be unlikely to occur anywhere else).
-Brian
On Sat, 25 Feb 2023, Dave Horsfall wrote:
> On Thu, 23 Feb 2023, Paul Winalski wrote:
>
> > a.out was, as object file formats go, a throwback to the stone age from
> > the get-go. Even the most primitive of IBM's link editors for
> > System/360 supported arbitrary naming of object file sections and the
> > ability for the programmer to arrange them in whatever order they
> > wished. a.out's restriction to three sections (.text, .data, .bss) did
> > manage to get the job done, and even (with ZMAGIC) could support
> > demand-paged virtual memory, but only just.
>
> That may be so, but those guys didn't exactly have the resources of
> IBM behind them...
>
> And I wonder how many people here know the significance of the "407" magic
> number?
>
> -- Dave
Good day all, figured I'd start a thread on this matter as I'm starting to piece enough together to articulate the questions arising in my research.
So based on my analysis of the 3B20S UNIX 4.1 manual I've been working through, all evidence points to the formalized SGS package and COFF originating tightly coupled to the 3B-20 line, then growing legs to support VAX, but never quite absorbing PDP-11 in entirety. That said, there are bits and pieces of the manual pages for the object format libraries that suggest there was some providence for PDP-11 in the development of COFF as well.
Where this has landed though is a growing curiosity regarding:
- Whether SGS and COFF were tightly coupled to one another from the outset, with SGS being supported by the general library routines being developed for the COFF format
- Whether COFF was envisioned as a one-size-fits-all object format from its inception or started as an experiment in 3B-20 development that wound up being general enough for other platforms
- If, prior to this format, there were any other efforts to produce a unifying binary format and set of development tools, or if COFF was a happy accident from what were a myriad of different architectural toolset streams
One of the curious things is how VAX for a brief moment did have its own set of tools and a.out particulars before SGS/COFF. For instance, many of the VAX-targeted utilities in 3.0/System III bear little in common option/manual-wise with the general common SGS utilities in System V. The "not on PDP-11" pages for various SGS components in System V much more closely resemble the 3B-20 utilities in 4.1 than any of the non PDP-11/VAX-only bits in System III.
Some examples:
- The VAX assembler in System III contains a -dN option indicating the number of bytes to set aside for forward/external references for the linker to fill in.
- The VAX assembler in System V contains among others the -n and -m options from 4.1 which indicate to disable address optimization and use m4 respectively
- The System V assembler goes on to also include -R (remove input file after completion) -r (VAX only, add .data contents to .text instead) and options -b, -w, and -l to replace the -d1, -d2, and -d4 options indicated in the previous VAX assembler
- System V further adds a -V to all the SGS software indicating the version of the software. This is new circa 5.0, absent from the 4.1 manual like the R, r, b, w, and l options
- The 4.1 manual's singular ar(1) entry still agrees with the System III version. No arcv(1) is listed, implying the old ar format never made it to 3B-20
- The System V manual has both this ar(1) version as well as the new COFF-supporting version. Not sure if this implies the VAX ar format was expanded to support the COFF stuff for a little while until they decided on a new one or what.
- The System III ld (which is implied to support PDP and VAX) survives in System V, but is cut down to supporting PDP-11 only
- The COFF-ish ld shows up in 4.1, is then extended to VAX presumably in the same breath as the other COFF-supporting bits by Sys V, leading to two copies like many others, PDP-11-specific stuff and then COFF-specific stuff
The picture that starts to form in the context of all of this is, for a little while in the late 70s/early 80s, the software development environments for PDP-11, VAX-11, and 3B-20 were interplaying with each other in often times inconsistent ways. Taking a peek at the 32V manuals, the VAX tools in System III appear to originate with that project, which makes sense. If I'm understanding the timeline, COFF starts to emerge from the 3B-20 project and USG probably decides that's the way to go, a unified format, but with PDP-11 pretty much out the door support wise already, there was little reason to apply that to PDP-11 as well, so the PDP-11 tools get their swan song in System V, original VAX-11 tools from 32V are likely killed off in 4.x, and the stuff that started with the 3B-20 group goes on to dominate the object file format and development software stuff until ELF comes along some time later.
I guess other questions this raises are:
- Were the original VAX tools built with any attention to compatibility with the PDP-11 bits Ken and Dennis wrote many years prior (based on some option discrepancies, possibly not?)
- Do the VAX utilities derive from the Interdata 8/32 work or if there was actually another stream of tools as part of that project?
- Was there any interplay between the existing tool streams (original PDP-11, 32V's VAX utilities, possibly Interdata 8/32) and the eventual COFF/SGS stuff, or was the latter pretty well siloed in 3B-20 land until deployment with 4.1?
- Matt G.
I found this 1984 video about MIT's Project Athena. A few VAXstation
100 are visible running some demos in a windowing system. Nothing
exciting unfortunately, just a few seconds and no details visible.
Since X was started in 1984, it could be a very early version we see
here. I asked Jim Gettys, and he suggested it could also be W since it
was apparently used before X in Project Athena.
https://youtu.be/tG7i7HCD9g0?t=28
I checked the xdemo director in X10R3 (earliest available so far) for a
match against the circle demo, but all samples are written in CLU...
> Date: Thu, 23 Feb 2023 18:38:25 +0000
> Subject: [TUHS] Re: Origins of the SGS (System Generation Software)
> and COFF (Common Object File Format)
>
> For the sake of timelines:
>
> June 1980 - Publication date on the front page of the 3.0 manual in which the utilities are still very much research for PDP-11 and 32V-ish for VAX where distinctions matter.
>
> June 1981 - Publication date on the front page of the 4.1 manual in which the man-pages very much refer to all of this as the "3B-20 object format"
>
> June 1982 - Publication date on the front page of the 5.0 manual by which point these same pages had been edited and extended to describe the "common object file format"
>
> Additions at the 1981 release include dump(1), list(1), and the ld-prefixed library routines for managing these object files. These likewise persist in 5.0, SysV, and beyond as COFF-related tools.
>
> So this puts the backstop of what would become COFF at at least '81.
>
> - Matt G.
The surviving source code for SysV R2 supports this timeline:
- The header files (start from https://github.com/ryanwoodsmall/oldsysv/blob/master/sysvr2-vax/src/head/a.…) have dates of late ’82, early ’83.
- The source for exec() has a comment that refers to the 4xx magic formats as “pre 5.0 stuff”.
- The COFF format headers are #ifdef’ed for the 3B series.
Interestingly, the lowest magic numbers in the 5xx series are not for the 3B, but for the “Basic-16” and for the “x86”. That led me to this paper:
https://www.bell-labs.com/usr/dmr/www/otherports/newp.pdf
It seems that the roots of COFF go back to the initial portability effort for V7 and in particular the 8086 port (which was done in 1978 according to the paper).
> From: Clem Cole
> MIT had a modified a.out format for the NU machine ports - that might
> have been called b.out.
Yes. Here's the man page output:
http://ana-3.lcs.mit.edu/~jnc/tech/unix/help/b.out.lpt
(I don't have the source for that, alas.) It's basically just a.out with
32-bit fields instead of 16-bit. I have a .h file for the format too, if
anyone has any interest in it. It's all part of the MIT 68K workbench that
used PCC (the source for all of which I do have).
Noel
COFF transfer, TUHS Bcc'd to know where this thread went.
Between the two if you're not doing UNIX-specific things but just trying to resurrect/restore these, COFF will probably be the better place for further discussion. @OP if you're not a member of COFF already, you should be able to reach out to Warren Toomey regarding subscription.
If you're feeling particularly adventurous, NetBSD still supports VAX in some manner: http://wiki.netbsd.org/ports/vax/
YMMV, but I've had some success with NetBSD on some pretty oddball stuff. As the old saying goes, "Of course it runs NetBSD". You might be able to find some old VMS stuff for them as well, but I wouldn't know where to point you other than bitsavers. There's some other archival site out there with a bunch of old DEC stuff but I can never seem to find it when I search for it, only by accident. Best of luck!
- Matt G.
------- Original Message -------
On Wednesday, February 22nd, 2023 at 10:08 AM, jnc(a)mercury.lcs.mit.edu <jnc(a)mercury.lcs.mit.edu> wrote:
> > From: Maciej Jan Broniarz
>
>
> > Our local Hackroom acquired some VAX Station machines.
>
>
> Exactly what sort of VAXstations? There are several different kinds; one:
>
> http://gunkies.org/wiki/VAXstation_100
>
> doesn't even include a VAX; it's just a branding deal from DEC Marketing.
> Start with finding out exactly which kind(s) of VAXstation you have.
>
> Noel
Has anyone tried talking to anyone at Oracle about possibly getting
the SunOS code released under an open source license? There can't be
any commercial value left in it.
- Dan C.