Rob Pike:
I did the same to adb, which turned out to have a really good debugger
hidden under a few serious bugs of its own, which I fixed.
=====
Memories.
Was it you who replaced ptrace with /proc in adb, or did I do that?
I do remember I was the one who took ptrace out of sdb (which a
few 1127-ers, or perhaps 112-ers on alice and rabbit still used).
After which I removed ptrace from the kernel, and from the
copy of the V8 manual in the UNIX room. Conveniently ptrace
occupied two facing pages; I glued them together.
I also later did some work to try to isolate the target-dependent
parts of adb and to make them work in host-independent ways--e.g.
assembling ints byte-by-byte rather than assuming byte order--to
make it easier to make a cross adb, e.g. to examine PDP-11 or
68K core dumps on a VAX.
I miss adb; maybe it's time to revive it, though these days I'd
be tempted to rewrite it in Python so I could just load the right
module at runtime to pick the desired target.
Norman Wilson
Toronto ON
Second half of the 1980-tish when the computer division of Philips
Electronics started on their own Motorola M68010 / UNIX System V.3 (don't
remember for sure I'm afraid) they used a syntax.h with macros similar to
mac.h. Only I understand it's more Pascal like. Appended the 1987 version I
found in my archive.
Cheers,
rubl
--
The more I learn the better I understand I know nothing.
I have been poring through the v7 source code lately, and came across an
oddity I would like to know more about. Specifically, in sh. The code
for sh is c, but it makes *extensive* use of of macros, for example:
/usr/src/cmd/sh/word.c
...
WHILE (c=nextc(0), space(c)) DONE
...
The macros for sh are defined in mac.h:
/usr/src/cmd/sh/mac.h
...
#define BEGINÂ Â {
#define ENDÂ Â Â Â }
#define SWITCHÂ switch(
#define INÂ Â Â Â Â ){
#define ENDSWÂ Â }
#define FORÂ Â Â Â for(
#define WHILEÂ Â while(
#define DOÂ Â Â Â Â ){
#define ODÂ Â Â Â Â ;}
#define REPÂ Â Â Â do{
#define PERÂ Â Â Â }while(
#define DONEÂ Â Â );
...
I can read the resultant code through the lens of my experience coding
c, but I'm curious why the macros and how this came about? In v6, the sh
source is straight up c. Is there a story behind it worth knowing?
Thanks,
Will
I was just reminded of this and thought others might enjoy reading it...
Customer Review
https://www.amazon.com/gp/customer-reviews/R2VDKZ4X1F992Q/
> PING! The magic duck!
> Using deft allegory, the authors have provided an insightful and intuitive explanation of one of Unix's most venerable networking utilities. Even more stunning is that they were clearly working with a very early beta of the program, as their book first appeared in 1933, years (decades!) before the operating system and network infrastructure were finalized. ...
-r
Perhaps the best irrefutable source for Lorinda's contribution
to dc is that cited by https://en.wikipedia.org/wiki/Lorinda_Cherry?
It is, by the way, Doug's A Research UNIX Reader. Those who
subscribe to this list and haven't read it ought to do so; it's
full of tidbits of history.
Norman Wilson
Toronto ON
All,
1. I have a physical copy of the V7 UPM published by Holt, Rinehart and
Winston (HRW) from 1983 (2 volume phone book). In it, there is a C
Reference Manual (pp. 247-277, reprinted with minor changes from the
first C book by K&R and including a Recent Changes to C addendum). I
also have a PDF that was supposedly created from sources that has a C
Reference Manual in it, but, in /usr/doc/cman, there's an inscription
that reads, "Sorry, but for copyright reasons, the source for theÂ
C Reference Manual is not distributed." and the one in the pdf appears
to be identical to the one in the V6 UPM (which I have a print-on-demand
version of). Are the *roff sources (or a clean PDF) available for the
reprint? I have located a PDF copy of the HRW edition, but it's got the
usual deficiencies of being a scanned copy.
2. In same manual, there is an article entitled, UNIX Programming --
Second Edition by K&R. Where is the first edition located? It isn't in
the V6 UPM.
Regards,
Will
I got his from a friend today (15 February):
===========
I'm sorry to report that Lorinda passed away a few days ago. I got a call
from her sister today. Apparently the dog walker hadn't seen her for a few
days and called the police. The police entered the house and found her
there. Her sister says they are assuming either a heart attack or a stroke.
A week or so after spending an entire day meticulously mapping manpages
from version 0 to version 7, I came across Doug's combined table of
contents. I love recreating the wheel <<shakes head, ruefully>>, only
saving grace is that the geniuses who came before, in this case Doug,
had the same idea :). In it, he mentions an addendum for v7 that has
pages for unexported software for local use: apl, cflow, cpio, cref, and
a slew of other usefull commands get mentioned. By unexported, I'm
gathering this means not included on the distro tapes -- I certainly
don't see them in my installed system. Were they distributed at all, or
just used internally at Bell, or what? Are there extant copies around?
To be clear, I'm talking about the unexported versions, not later
versions that might be fitted onto v7. Oh, and a bonus question, why
weren't they exported.
Will
All,
I have been doing some language exploration in v7/4.3bsd and came across
Software Tools (not the pascal version). It's written using ratfor,
which I had seen in the v7 UPM. I fired up v7 and tried my hand at the
first example:
# copy - copy input characters to output
       integer getc
       integer c
       while(getc(c) != EOF)
               call putc(c)
       stop
       end
The first thing I noticed was that it read more like C than Fortran (I
know C quite well, Fortran just a smidge)... awesome, right? So I ran
the preprocessor on it and got the following f77 code:
c copy - copy input characters to output
     integer getc
     integer c
c    while
23000 if(.not.(getc(c) .ne. eof))goto 23001
        call putc(c)
        goto 23000
c    endwhile
23001 continue
     stop
     end
Cool. The way it translated the EOF test is weird, but ok. Trying to
compile it results in complaints about missing getc and putc:
$ f77 copy.f
copy.f:
  MAIN:
Undefined:
_getc_
_putc_
_end
Ah well, no worries. I know that they're in the c lib, but don't about
fortran libs... Meanwhile, over on 4.3BSD, it compiles without issue.
But running it is no joy:
$ ./a.out
This is a test
$
I remembered that the authors mentioned something about EOF, so I
tweaked the code (changed EOF to -1) and rebuilt/reran:
$ ./a.out
This is a test
This is a test
$
Fascinating. Dunno why no complaints from F77 about the undefined EOF
(or maybe mis-defined), but hey, it works and it's fun.
I'm curious how much ratfor was used in bell labs and other locations
running v6, v7, and the BSD's. When I first came across it, I was under
the impression that it was a wrapper to make f66 bearable, but the
manpage says it's best used with f77, so that's not quite right. As
someone coming from c, I totally appreciate what it does to make the
control structures I know and love available, but that wasn't the case
back then, was it? C was pretty new... Was it just a temporary fix to a
problem that just went away, or is there tons of ratfor out there in the
wild that I just haven't seen? I found ratfor77 and it runs just fine on
my mac with a few tweaks, so it's not dead:
ratfor77 -C copy.r | tee copy.f
C Output from Public domain Ratfor, version 1.0
C copy - copy input characters to output
     integer getc
     integer c
23000 if(getc(c) .ne. eof)then
     call putc(c)
     goto 23000
     endif
23001 continue
     stop
     end
What's the story? Oh, and in v6 it looks like it was rc - ratfor
compiler, which is not present in v7 or 4.3BSD - is there a backstory
there, too?
Will