Live data from Hacker News

Restoration of First Edition Unix Kernel Sources

github.com

11–13 of 13 posts

Re: Restoration of First Edition Unix Kernel Sources

#11
post #9
post #7

Earlier quoted context omitted.

So it is a kind of "overlay" where the data buffer overlaps the piece of the code. I find the explanation of jhallenworld is correct.

In a sense, but ‘overlay’ generally means more than just re-using memory — it's reading in different sections of (usually) code in place of others; in modern terms, it's sort of like paging, but structured explicitly and (usually) manually at build/link time. PDP-11 Unix did eventually support overlays, but I don't think they were widely used. The ‘Unix way’ would be to have (as this C compiler does) separate program…

> it's sort of like paging, but structured explicitly and (usually) manually at build/link time.

And this is "a poor man's" overlay of the data buffer over the piece of the code, specified explicitly and manually at the time of writing the program (the "bigger" overlay mechanisms I know of are also specified at the time of writing the program, not at the time of build or link). As the "scratch" area was overlaid, nothing has to be loaded, that's the only difference to the typical overlay where more often some code would also be overwritten over some other code. The other difference to the "classical," "bigger" overlay is that this was done exactly once over the life of the program.

Re: Restoration of First Edition Unix Kernel Sources

#12
post #10
post #8

My eyes! https://github.com/c3x04/Unix-1st-Edition-jun72/blob/master/...

Have a look at v7 sh(1) and you'll feel better. e.g. http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/...

For those who don't know C, what Bourne did here was to define some macros that allowed him to get rid of C's curly brackets. E.g.,

    IF ...
    THEN
       ...
    FI
translates to

    if ( ...
    ) {
       ...
    }
I remember last seeing this code around 1980-82 when I was working with 7th Edition Unix and wondering why someone would want to do that, since it would have made the program hard for another C programmer to read and maintain. (If I remember correctly, this programming style is unique to the shell code.)

Re: Restoration of First Edition Unix Kernel Sources

#13
Boy, that brings back real memories!

Harvard got the first Unix v7 outside of Bell Labs in, I think, '75, and my office mate in the old Harvard graduate computing center (a medieval beast compared to the new Gates/Ballmer cheese wedge building), Geoff Steckel, had some kernel listings on his desk which I of course devoured without really understanding their provenance.

Being teethed on (post-IBM mainframes systems hacking) PDP-10 assembler, TOPS-10, TENEX and Lisp (Harvard's ECL was a Dylan-like algebraic syntax on top of a Lisp internally), reading the C kernel listings was like a revelation: here was an operating system written in a high-level language!

The line printer listings were printed on an upper-case-only printer (not many lower-case-capable printers existed in the DEC world at the time) with strike-throughs (overprinted) used for upper-case letters.

In any case, it was immediately clear that this was something special. I didn't actually get involved with Unix until a few years later in grad school at Columbia, and then ending up as a Unix (BSD) kernel hacker at Multiflow, a Yale spin-off, some years later.

(Sorry for waxing "old duffer...")

Post reply on HN