The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* Re: [TUHS] Article on the history of cat(1)
@ 2018-11-13 23:27 Norman Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Norman Wilson @ 2018-11-13 23:27 UTC (permalink / raw)
  To: tuhs

Rob:

  I rewrote cat to use just read and write, as
  nature intended. I don't recall if my version is in any of v8 v9 v10 ...

====

It is.  It was /bin/cat when I arrived at Murray Hill in 1984.
I remember being delighted with the elegant way to get rid of
a flag I had never really liked either.

I never knew Dennis had dragged his heels at it.  It was (to me)
so obviously the right answer that I never asked!

Norman Wilson
Toronto ON

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [TUHS] Article on the history of cat(1)
       [not found]       ` <20181114004018.GA23816@minnie.tuhs.org>
@ 2018-11-14  2:51         ` Dave Horsfall
  0 siblings, 0 replies; 8+ messages in thread
From: Dave Horsfall @ 2018-11-14  2:51 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

On Wed, 14 Nov 2018, Warren Toomey wrote:

>> Hell, I wish I still had that "CSU Tape"; it was Edition 6 with as much 
>> of Edition 7 (and AUSAM) that I could shoe-horn in, such as XON/XOFF 
>> for the TTY driver.  I was known as "Mr Unix 6-1/2" at the time...
>
> Definitely look at the UNSW tapes I have:
> https://minnie.tuhs.org/cgi-bin/utree.pl?file=AUSAM
> and https://www.tuhs.org/Archive/Distributions/UNSW/
> in case any of these are what you are looking for.

I think I did before, but I confess I didn't spend much time on it.  My 
pride and joy was certainly the rewritten ei.c driver (implementing the 
200-UT batch protocol), and the clever workaround to an egregious KRONOS 
bug where it would get stuck in a POLL/REJECT loop (I merely sent a dummy 
command viz "Q,I" -- discarding the response -- because KRONOS was 
expecting a command instead of the correct REJECT being nothing to send 
from the batch emulator).

At the time, Unix got blamed because the smaller non-Unix /40s (running a 
standalone program) worked fine for some reason; my guess is that it 
implemented the broken protocol somehow.

-- Dave

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [TUHS] Article on the history of cat(1)
  2018-11-13 23:14     ` Dave Horsfall
@ 2018-11-13 23:21       ` Rob Pike
       [not found]       ` <20181114004018.GA23816@minnie.tuhs.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Rob Pike @ 2018-11-13 23:21 UTC (permalink / raw)
  To: dave; +Cc: tuhs

[-- Attachment #1: Type: text/plain, Size: 2381 bytes --]

I was offended by the -u flag in v7 cat, which was a necessary but
unfortunate consequence of preserving the original's semantics while
converting it to use the new standard I/O library. Dennis felt it was
important as a proof of the value of stdio; to me it was an indication that
stdio couldn't do everything. I rewrote cat to use just read and write, as
nature intended. I don't recall if my version is in any of v8 v9 v10 but
it, or something very like it, is in Plan 9:

% cat cat.c

#include <u.h>

#include <libc.h>


void

cat(int f, char *s)

{

char buf[8192];

long n;


while((n=read(f, buf, (long)sizeof buf))>0)

if(write(1, buf, n)!=n)

sysfatal("write error copying %s: %r", s);

if(n < 0)

sysfatal("error reading %s: %r", s);

}


void

main(int argc, char *argv[])

{

int f, i;


argv0 = "cat";

if(argc == 1)

cat(0, "<stdin>");

else for(i=1; i<argc; i++){

f = open(argv[i], OREAD);

if(f < 0)

sysfatal("can't open %s: %r", argv[i]);

else{

cat(f, argv[i]);

close(f);

}

}

exits(0);

}


%

-rob

P.S. I learned today that cat.c has a spurious trailing newline.

On Wed, Nov 14, 2018 at 10:15 AM Dave Horsfall <dave@horsfall.org> wrote:

> On Wed, 14 Nov 2018, Warren Toomey wrote:
>
> >> Didn't know that cat(1) was still written in assembly on Edition 6...
> >
> > https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s1/cat.s
>
> Thanks; then again, I never had a reason to poke around cat(1) (but I do
> remember adding a "-h" flag to pr(1) for a sub-header or something).
>
> In fact, the only assembler stuff I remember modifying was deep in the
> kernel, to take advantage of Unibus timing (on the /40 at least), where
> the "obvious" code was sub-optimal; can't remember the details, but it
> saved a bus cycle or two.
>
> Hell, I wish I still had that "CSU Tape"; it was Edition 6 with as much of
> Edition 7 (and AUSAM) that I could shoe-horn in, such as XON/XOFF for the
> TTY driver.  I was known as "Mr Unix 6-1/2" at the time...
>
> Completely rewrote the 200-UT driver so that it actually worked (IanJ's
> driver was a horrible mess) and worked around an egregious bug on the
> Kronos side which they said was baked-in so deep that it couldn't be
> fixed.
>
> Rewrote the plotter driver and Versatec LV-11 driver to use the buffer
> pool instead of the character queues, so they went like a bat out of hell.
>
> Etc.
>
> -- Dave
>

[-- Attachment #2: Type: text/html, Size: 16991 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [TUHS] Article on the history of cat(1)
  2018-11-13 22:49   ` Warren Toomey
  2018-11-13 23:10     ` Arthur Krewat
@ 2018-11-13 23:14     ` Dave Horsfall
  2018-11-13 23:21       ` Rob Pike
       [not found]       ` <20181114004018.GA23816@minnie.tuhs.org>
  1 sibling, 2 replies; 8+ messages in thread
From: Dave Horsfall @ 2018-11-13 23:14 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

On Wed, 14 Nov 2018, Warren Toomey wrote:

>> Didn't know that cat(1) was still written in assembly on Edition 6...
>
> https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s1/cat.s

Thanks; then again, I never had a reason to poke around cat(1) (but I do 
remember adding a "-h" flag to pr(1) for a sub-header or something).

In fact, the only assembler stuff I remember modifying was deep in the 
kernel, to take advantage of Unibus timing (on the /40 at least), where 
the "obvious" code was sub-optimal; can't remember the details, but it 
saved a bus cycle or two.

Hell, I wish I still had that "CSU Tape"; it was Edition 6 with as much of 
Edition 7 (and AUSAM) that I could shoe-horn in, such as XON/XOFF for the 
TTY driver.  I was known as "Mr Unix 6-1/2" at the time...

Completely rewrote the 200-UT driver so that it actually worked (IanJ's 
driver was a horrible mess) and worked around an egregious bug on the 
Kronos side which they said was baked-in so deep that it couldn't be 
fixed.

Rewrote the plotter driver and Versatec LV-11 driver to use the buffer 
pool instead of the character queues, so they went like a bat out of hell.

Etc.

-- Dave

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [TUHS] Article on the history of cat(1)
  2018-11-13 22:49   ` Warren Toomey
@ 2018-11-13 23:10     ` Arthur Krewat
  2018-11-13 23:14     ` Dave Horsfall
  1 sibling, 0 replies; 8+ messages in thread
From: Arthur Krewat @ 2018-11-13 23:10 UTC (permalink / raw)
  To: tuhs

On 11/13/2018 5:49 PM, Warren Toomey wrote:
> On Wed, Nov 14, 2018 at 09:44:50AM +1100, Dave Horsfall wrote:
>> Didn't know that cat(1) was still written in assembly on Edition 6...
> https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s1/cat.s
>
>

The very definition of simplicity and elegance.

I pine for those days. Or at least, what I used to do in MACRO-10 in 
high school ;)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [TUHS] Article on the history of cat(1)
  2018-11-13 22:44 ` Dave Horsfall
@ 2018-11-13 22:49   ` Warren Toomey
  2018-11-13 23:10     ` Arthur Krewat
  2018-11-13 23:14     ` Dave Horsfall
  0 siblings, 2 replies; 8+ messages in thread
From: Warren Toomey @ 2018-11-13 22:49 UTC (permalink / raw)
  To: Dave Horsfall; +Cc: The Eunuchs Hysterical Society

On Wed, Nov 14, 2018 at 09:44:50AM +1100, Dave Horsfall wrote:
> Didn't know that cat(1) was still written in assembly on Edition 6... 

https://minnie.tuhs.org/cgi-bin/utree.pl?file=V6/usr/source/s1/cat.s

Cheers, Warren

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [TUHS] Article on the history of cat(1)
  2018-11-13 21:55 Warren Toomey
@ 2018-11-13 22:44 ` Dave Horsfall
  2018-11-13 22:49   ` Warren Toomey
  0 siblings, 1 reply; 8+ messages in thread
From: Dave Horsfall @ 2018-11-13 22:44 UTC (permalink / raw)
  To: The Eunuchs Hysterical Society

On Wed, 14 Nov 2018, Warren Toomey wrote:

> All, I just saw this link to an article on the history of cat(1):
>
> https://twobithistory.org/2018/11/12/cat.html

Didn't know that cat(1) was still written in assemblee on Edition 6... 
My memory must be getting hazy (but yes, I did mount a mag tape as a file 
system, just to see if it would work).

-- Dave

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [TUHS] Article on the history of cat(1)
@ 2018-11-13 21:55 Warren Toomey
  2018-11-13 22:44 ` Dave Horsfall
  0 siblings, 1 reply; 8+ messages in thread
From: Warren Toomey @ 2018-11-13 21:55 UTC (permalink / raw)
  To: tuhs

All, I just saw this link to an article on the history of cat(1):

https://twobithistory.org/2018/11/12/cat.html

Cheers, Warren

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-11-14  2:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-13 23:27 [TUHS] Article on the history of cat(1) Norman Wilson
  -- strict thread matches above, loose matches on Subject: below --
2018-11-13 21:55 Warren Toomey
2018-11-13 22:44 ` Dave Horsfall
2018-11-13 22:49   ` Warren Toomey
2018-11-13 23:10     ` Arthur Krewat
2018-11-13 23:14     ` Dave Horsfall
2018-11-13 23:21       ` Rob Pike
     [not found]       ` <20181114004018.GA23816@minnie.tuhs.org>
2018-11-14  2:51         ` Dave Horsfall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).