Following the Claude Shannon discussion:
http://www.jaycar.com.au/useless-box/p/GT3706
I tried to explain to the Young Thing (tm) behind the shop counter that it
was invented several decades ago etc, but I suspect it was beyond her
ken...
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
> [Bob Fano} still has a reverential photograph of Shannpn
> hanging in his office.
Alas, no, Fano died in 2016 at age 98.
More memories: Fano was among the grad students who came to
ice-skating parties at our house in the mid-40s--the house near
Shannon's later abode. I did not really get to know him until
Multics days. His gravelly mafioso voice would scare you off--until
you saw the irrepressible twinkle in his eye. A beloved and
inspiring leader, worthy of Dave Horsfall's calendar.
Doug
>From a piece of code I have in some SCO UNIX 3.2V4.2 source. SCO
doesn't have pipes, but you can simulate them.
int fd[2]
int rc;
struct strfdinsert ins;
queue_t *pointer = (queue_t *)NULL;
rc = -1;
/*
* First open the stream clone device "/dev/spx" twice,
* obtaining the two file descriptors.
*/
if ( (fd[0] = open(SPX_DEVICE, O_RDWR)) < 0)
{
gen_trace(gtr_flag, "-gen_pipe(): -open(fd[0]): %s\n", strerror(errno));
break;
}
if ( (fd[1] = open(SPX_DEVICE, O_RDWR)) < 0)
{
gen_trace(gtr_flag, ">gen_pipe(): -open(fd[1]): %s\n", strerror(errno));
close(fd[0]);
break;
}
/*
* Now link these two streams together with an
* I_FDINSERT ioctl.
*/
ins.ctlbuf.buf = (char *) &pointer; /* no ctl info, just the ptr */
ins.ctlbuf.maxlen = sizeof(queue_t *);
ins.ctlbuf.len = sizeof(queue_t *);
ins.databuf.buf = (char *) 0; /* no data to send */
ins.databuf.len = -1; /* magic: must be -1, not 0, for stream pipe */
ins.databuf.maxlen = 0;
ins.fildes = fd[1]; /* the fd to connect with fd[0] */
ins.flags = 0; /* nonpriority message */
ins.offset = 0; /* offset of pointer in control buffer */
if (ioctl(fd[0], I_FDINSERT, (char * ) &ins) < 0)
{
gen_trace(gtr_flag, ">gen_pipe(): -ioctl(I_FDINSERT): %s\n", strerror(errno));
close(fd[0]);
close(fd[1]);
break;
}
If I'm remembering correctly, miniunix didn't have pipes. The shell faked
it by taking the output of the first program into a file and then using it
as the input for the second.
Didn't really multitask anyhow, so it was pretty much fine.
-----Original Message-----
From: TUHS [mailto:tuhs-bounces@minnie.tuhs.org] On Behalf Of Ian Zimmerman
Sent: Monday, February 26, 2018 11:58 AM
To: tuhs(a)minnie.tuhs.org
Subject: Re: [TUHS] EOF on pipes?
On 2018-02-26 23:03, Rudi Blom wrote:
> From a piece of code I have in some SCO UNIX 3.2V4.2 source. SCO
> doesn't have pipes, but you can simulate them.
Is this a SCO speciality, or are there other UNIXes like that?
Does it not even have pipe() in its libc?
Many years ago (when the dinosaurs were using V6), I had a crazy idea[*]
that a write(fd, 0, NULL) would somehow signal EOF to the reader i.e. a
subsequent read would wait for further data instead of ENOTOBACCO.
Did any *nix ever implement that? I have no idea how it would be done.
Have an ENOGORILLA.
To answer the real question: stream pipes, which became the only
sort of pipe in the Research stream (sic) sometime between the
8/e and 9/e manuals.
The implementation was trivial, because from the beginning the
metadata within a stream admitted delimiters: markers that meant
`when this object reaches read(2) at the head end, return from
read with whatever has already been delivered.' Empty messages
(two consecutive delimiters) were explicitly allowed.
If a stream was marked as using delimeters (and pipes always
were), a delimeter was inserted after every write(2). So
write(2) generated an empty message, and read(2) returned it.
Norman Wilson
Toronto ON
We lost Claude Shannon on this day in 2001. He was a mathematician,
electrical engineer, and cryptographer; he is regarded as the "father" of
information theory, and he pioneered digital circuit design. Amongst
other things he built a barbed-wire telegraph, the "Ultimate Machine" (it
reached up and switched itself off), a Roman numeral computer ("THROBAC"),
the Minivac 601 (a digital trainer), a Rubik's Cube solver, a mechanical
mouse that learned how to solve mazes, and outlined a chess program
(pre-Belle). He formulated the security mantra "The enemy knows the
system", and did top-secret work in WW-2 on crypto and fire-control
systems.
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
Re: RIP Claude Shannon
> Never heard of Claude Shannon. So a good opportunity to do some
> searching reading to 'catch up'.
Shannon did some amazing work. My field is Information science and without Shannon, it would be a dull field indeed. His masters thesis laid out an elegant use of digital logic for switching systems that we take for granted today, his mathematical theory of communication, while dense, is foundational - ever heard of a bit?, and he actually loved juggling so much he created a juggling machine - what’s not to love? :) All that said, he was also in the right place at the right time and was surrounded by genius.
Will
> But a note on Dijkstra's algorithm: Moore and Dijsktra both published
> in 1959.
I was off by one on the year, but the sign of the error is debatable.
Moore's paper was presented in a conference held in early April, 1957,
proceedings from which were not issued until 1959. I learned about it
from Moore when I first I met him, in 1958. Then, he described the
algorithm in vivid, instantly understandable terms: imagine a flood
spreading at uniform speed through the network and record the
distance to nodes in order of wetting.
> But it is documented Dijkstra's algorithm has been invented and used
> by him in 1956.
Taking into account the lead time for conference submissions, one
can confidently say that Moore devised the algorithm before 1957.
I do not know, though, when it first ran on a Bell Labs computer.
That said, Moore's paper, which presented the algorithm essentially
by example, was not nearly as clear as the capsule summary he gave
me. It seems amateurish by comparison with Dijkstra's elegant treatment.
Dijkstra's name has been attached to the method with good reason.
Doug
>> pipe, ch(e)root.... Any more unix connections to smoking?
I have a slide that's a quadralingual pun (French, English, Art, shell)
in which Magritte's painting of a pipe with the words "Ceci n'est pas
une pipe" has been altered to read "Ceci n'est pas une |". The
altered phrase was borrowed from Jay Misra et al, who used it as
an example of a message in a paper on communicating processes.
Many years ago (when the dinosaurs were using V6), I had a crazy idea[*]
that a write(fd, 0, NULL) would somehow signal EOF to the reader i.e. a
subsequent read would wait for further data instead of ENOTOBACCO.
Did any *nix ever implement that? I have no idea how it would be done.
[*]
I was full of crazy ideas then, such as extending stty() to an arbitrary
device and was told by the anti-CSU mob that it was a stupid idea...
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."