[TUHS] History of top

Clem Cole clemc at ccc.com
Fri May 25 00:09:43 AEST 2018


On Thu, May 24, 2018 at 5:20 AM, Noel Chiappa <jnc at mercury.lcs.mit.edu>
wrote:

>     > From: Lars Brinkhoff
>
>     > I'm surprised it appeared that late. Were there any other versions or
>     > similar Unix programs before that?
>
> The MIT ~PWB1 system had a thing called 'dpy', I think written at MIT
> based on
> 'ps' (and no doubt inspired by ITS' PEEK), which had similar functionality.
> Seems like it never escaped, though. Man page and source here:
>
>   http://ana-3.lcs.mit.edu/~jnc/tech/unix/man1/dpy.1
>   http://ana-3.lcs.mit.edu/~jnc/tech/unix/s1/dpy.c
>
> The top of my hard-copy man page says 'November 1977', but I suspect it
> dates
> back further than that.
>
>      Noel
>
> There were a bunch of these​ - originally mods off of ps(1) that kicked
around at different UNIX sites.   CMU's locally hacked ps was similar to
dpy and BSD's *stat programs (systatm vmstat, ...). The problem all of
these had was getting the data out of the OS.   The original scheme used by
ps being it ran setuid/gid, and then was able to opening /dev/kmem and
reading interesting data structures the kernel.  A big problem was that ps
and the OS had to be compiled with exactly the same headers and you really
had to know the layout and the obvious security concerns of using
setuid/gid to control things.

FreeBSD's sysctl and V8's /proc would finally clean that up by making a
formal interface to the OS and controlling what was available in a more
granular manner both from a data structure as well as security path.
 Although before /proc came to being (/proc was a UNIX innovation), the
sysctl(2) like interface was reinvented a few times, as it really was not
new with UNIX.   It's very much like a similar scheme that came from TOPS,
RSX and VMS (which the Masscomp system parroted being ex-DECies almost
exactly the same as VMS).  I believe that Sun had something also, but  I've
forgotten its name, Larry might remember.   But so did  DG-OS and many of
the other commercial UNIXs snd I would not be surprised if many University
hacks did it also.

My favorite of all of these was the one that George Gobble at Purdue built
when he did the Dual VAX.   He also spliced an PDP-11 on the UBA on the
their Dual Vax System and wrote a program that like top(1) refreshed itself
(at least as fast as once a sec IIRC).  It would read the VAX memory and
then display what the OS was doing in real time.   He did a neat talk in a
mid-1980's USENIX with a movie from it.   They found an interesting bug in
the BSD scheduler which had been there since 6th edition, which had never
really been noticed until people could visually watch what as happening and
actually get enough information about how processes were being handled.
[This was also around the time one of the first '0-day' issues with UNIX
was found by ghg and team which is now a cute story but at the time was
quite worrisome].


​The best I remember, the popularity of top(1) started because it was first
released as USENET came of age; and thus it got wide distribution.  By that
point, ​ *BSD was the 'standard' in most places, and this the *stat
commands were pretty well known. The top(1) program consolidated these into
a single one, plus it used the curses library so it could be left running
on a glass TTY.   As Vaxen were being used as large timesharing systems for
Universities to teach with, such a program was handy for the sys admins to
keep an eye on what was happening.

Clem

ᐧ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20180524/59f9e2a6/attachment.html>


More information about the TUHS mailing list