Back when the dinosaurs were using card readers (and yes, I've used a card
reader on Unix; I think it was a desktop CDC model, and the driver would
handle two modes: strict 80-column i.e. one 12-bit column per 16-bit word
and you got 80 of 'em on a DMA channel, or ASCII NL-terminated after last
non-blank column, and no, I have no idea whether it handled EBCDIC or CDC
etc, but I digress as usual).
Where was I? Oh yes, sleeps...
Back when sleep(3) was sleep(2) (yes, Virginia, sleep() used to be a
system call, then it became alarm()/pause(), and now it seems to be
nanosleep(), and I'm wandering again), you never called sleep(1) because
its granularity was +/-1 second (and all the way up to +infinity,
actually, on a really busy machine), thus it could return right away, with
ensuing hilarity.
So, I'm curious:
When did sleep(2) become sleep(3)? Was it V7, or some BSD? Or Babbage
help me, SysVile?
When did the caveat about sleeping for 1 second become known? I don't
think that I ever saw it documented, but was one of those "lore" things
passed around at Unix conferences and the like.
And when did it start using nanosleep() instead of alarm()/pause()? I see
that my Penguin box has a bet both ways; it "may" use SIGALRM[a] (thus
"mixing calls to alarm(2) and sleep() is a bad idea" (well, I've used
both), and also refers to nanosleep().
[a]
Alpine's spell-checker suggested "SICKROOM" here; pretty close when
dealing with timed-out reads on a TTY connection[ii] :-)
[ii]
Have you tried this with Perl? You can't rely on EINTR[3], so you have to
use eval{} blocks instead, and it starts getting pretty fugly...
[3]
And here it suggested "ENTREE".
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
>Date: Wed, 7 Mar 2018 13:54:32 -0500
>From: Paul Winalski <paul.winalski(a)gmail.com>
>To: Clem Cole <clemc(a)ccc.com>
>Cc: The Eunuchs Hysterical Society <tuhs(a)tuhs.org>
>Subject: Re: [TUHS] Sleep()y musings
>Message-ID:
> <CABH=_VTO7sdgGypp3U7zQoWdJ3HsGUUjrk->6_Rf5VE5gyNGD7g(a)mail.gmail.com>
>Content-Type: text/plain; charset="UTF-8"
>
>...
>VAX also has a Time-of-Year Clock Register (colloquially called the
>TOY clock), a 32-bit unsigned value whose LSB represents a resolution
>of 10 milliseconds (0.01 second). All VAX models except the
>VAX-11/730 provided battery backup for the TOY clock so that it
>continued to operate even when the system was powered off. A VAX can
>thus be powered off for about 497 days and still remember the
>date/time.
Also in AlphaServers we still have this TOY, the clock and the battery that is.
>From a DS10 running Digital Unix 4.0G, /var/adm/messages file, I only
removed the BEL characters
Dec 12 03:01:27 br0011 vmunix: You must reset the system time manually
Dec 12 03:01:27 br0011 vmunix: Time of year (TOY) clock returned zero
as the current time
Dec 12 03:01:27 br0011 vmunix:
Dec 12 03:01:27 br0011 vmunix:
Dec 12 03:01:27 br0011 vmunix: WARNING: preposterous time in TOY clock
-- CHECK AND RESET THE DATE!!
Dec 12 03:01:27 br0011 vmunix:
Dec 12 03:01:27 br0011 vmunix: i2c: Server Management Hardware Present
Dec 12 03:01:27 br0011 vmunix: datalink: links=128, macs=6
Dec 12 03:01:27 br0011 vmunix: NOTE: dxb_configure: Configure values:
dxb, ffffffffffffff9d, ffffffff90bfbf80, ffffffff90bf9a20
Dec 12 03:01:27 br0011 vmunix: WARNING: dxb_configure:
configure_driver error = 22
Dec 12 03:01:28 br0011 vmunix: Node ID is 00-10-64-30-ae-38 (from device tu0)
Dec 12 03:01:28 br0011 vmunix: WARNING: Time of year (TOY) clock
battery is dead, time and NVR contents ignored
Dec 12 03:01:28 br0011 vmunix:
Dec 12 03:01:28 br0011 vmunix: You must reset the system time manually
Cheers,
uncle rubl
> From: Dave Horsfall
> When did sleep(2) become sleep(3)? Was it V7, or some BSD?
Before V7. The MIT system (~PWB1) says, on the man page for sleep (II), "As of
this writing the system call is still available although the C routine
implmeneting the function uses 'alarm' and 'pause' (II). It will be withdrawn
when convenient."
Probably left the system call there for compiled commands, etc which used it?
Noel
> > But the concept of email goes way back.
> Indeed, it does, but only on the same system.
Very far back. CTSS had a mail utility.
If communication within one system is not
recognized as email, then the exchange that
opened in Boston in 1877 was not a
telephone system.
Doug
We lost Ray Tomlinson on this day in 2016; known as the inventor of email,
he sent the first message between two hosts on the ARPAnet (prior to that
the users had to be on the same host), and pioneered the use of the "@"
sign.
In the meantime, some tosser (his name is not important) is claiming that
he invented email first; I recall that APL\360 had a "mailbox" facility,
but it certainly didn't use "@".
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
I hadn't realized that groff hyphenation had been taken from
Tex, not troff. Is that becuase Tex did a better job, or
because troff's was deemed proprietary?
A new paper comparing Unix kernel designs was published earlier today:
Stergios Papadimitriou and Lefteris Moussiades
Mac OS versus FreeBSD: A Comparative Evaluation
[IEEE] Computer 52(2), 44--53, February 2018
https://doi.org/10.1109/MC.2018.1451648
Despite the title, GNU/Linux also is included in the comparisons. The
abstract is:
>> ...
>> FreeBSD (an open source Unix-like OS) and Apple's Mac OS use similar
>> BSD functionality but take different approaches. FreeBSD implements a
>> traditional compact monolithic Unix kernel, whereas Mac OS builds the
>> BSD Unix functionality on top of the Mach microkernel. The authors
>> provide an in-depth technical investigation of both approaches.
>> ...
Our fellow list member Larry McVoy, and his lmbench suite, are
mentioned in the article, along with results of that suite.
There are about 200 numbers in the two large tables of performance
measurements, and while many are comparable across operating systems,
there are some benchmarks that show up to a 40x difference between
systems on the same hardware.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: beebe(a)math.utah.edu -
- 155 S 1400 E RM 233 beebe(a)acm.org beebe(a)computer.org -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------
pipes in SCO UNIX 3.2V4.2,
It's long, long ago, so excuses for vagueness. I think the issue was
not pipe() perse, but the difference in functionality between 'pipe
filesystem' and streams pipes.
By using pipe() you create a FIFO pipe with certain limitations
(including 5120 write limit). When you open the streams device twice
and ioctl() two file descriptors together you have more flexibility.
Excuses for the possible confusion.
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."
So many memories. The "ultimate machine" (which was brought out and
demonstrated from time to time while I was at the Labs) was built in
collaboration with Ed Moore (he of Moore-model automata, who published
"Dijkstra's algorithm" for shortest paths a year before Dijkstra) and
(I believe) Dave Hagelbarger. Moore endowed the machine with a longevity
property seldom remarked on: majority logic so that any electrical
component can be removed without harming its observable behavior.
Shannon moved to MIT from Bell Labs some weeks before I moved the
other way, so I only met him much later when he visited the Unix room
(an excuse, albeit weak, for this distant detour from TUHS). By that
time Shannon was descending into Alzheimer's fog, but his wife who
accompanied him was a memorably curious and perceptive visitor. I have
wondered what role she may have played as a sounding board or more in
Shannon's research.
As a child, I used to ski on the 50-foot hill that was the lawn of the
mansion that Shannon would buy when he moved to Massachusetts. We kids
would ski down and climb back up. Not Shannon. He installed a chairlift.
One house separated mine from the ski hill. It belonged to John Trump,
another MIT prof who engineered the Van de Graaff generator into a
commercial product for generating million-volt x-rays and, yes, was uncle
of the Donald. John, as kind as he was bright, fortunately did not live
to see the apotheosis of his wayward nephew.
Doug
> 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.
Never heard of Claude Shannon. So a good opportunity to do some
searching reading to 'catch up'.
Interesting person and this quota tends to make him my type of guy
"I just wondered how things were put together.
– C.E. Shannon"
http://themathpath.com/documents/ee376a_win0809_aboutClaudeShannon_willywu.…
Now wondering if I should register for this THORIAC project or just
read some more and do it. Not in the mood for learning Python I'd
probably do some fumbling in C.
https://www.engage-csedu.org/find-resources/shannons-throbac
Keeps me busy and amuzed,
uncle rubl
Just curious; am I the only who, back in the early days of V6, used pipes
as temporary files? I mean that after calling pipe(), instead of then
forking and playing "file-descriptor footsie" you just read and wrote
within the same process.
I seem to recall that it worked, as long as you avoided the 8-block limit
(or whatever it was then); I have no idea why I tried it, other than to
see if it worked i.e. avoid the creat() (without the "e") etc.
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
On 2/20/18, Donald ODona <mutiny.mutiny(a)india.com> wrote:
> since '86 he was working on an operating system, named Mica, which failed.
>
> At 19 Feb 2018 18:13:59 +0000 (+00:00) from Paul Winalski
> <paul.winalski(a)gmail.com>:
>> Dave Cutler was in the VMS group only for VMS version 1. He rarely
>> stayed on around for version 2 of anything. Hustvedt's and Lipman's
>> contributions for VMS were more extensive and longer-lasting than
>> Cutler's.
Cutler had already left the VMS OS group by the time I joined DEC in
February of 1980. After VMS he led the team developing PL/I and C
compilers for VMS. These shared a common back end called the VAX Code
Generator (VCG). The other VMS compilers at the time (Fortran,
Pascal, Cobol) had their own separate optimizers and code generators.
The VAX Ada compiler would also use VCG.
When version 1 of VAX PL/i and VAX C shipped, Cutler worked on
subsetting the VAX architecture so that a single chip implementation
could be done, and led the team that produced the MicroVAX I. The
MicroVAX architecture emulated expensive instructions such as packed
decimal. All of the later, single-chip VAXes used this architecture.
When the MicroVAX I shipped, Cutler devised a microkernel-based
real-time operating system for the VAX called VAXeln.
After VAXeln, Cutler led the team developing a RISC architecture
follow-on to the VAX called PRISM, and an operating system for it
called Mica. Mica had a VAXeln-like microkernel, and the plan was to
layer personality modules on top of that to implement VMS and
Unix-style ABIs and system calls.
Alpha was chosen instead of PRISM as the VAX successor, and that is
when Cutler left DEC for Microsoft. Windows NT has a lot of design
concepts and details previously seen in PRISM and VMS.
-Paul W.
At Rutgers Newark, we had VMS system that had Whitesmith's C on it. At one point, Whitesmiths decided to "fight piracy" by sending you a sticker you were supposed to stick on the front of your computer to show that you had a licensed copy. I suppose I might have been in trouble if the Whitesmiths police came to my machine room. I was a bit miffed when one of the other employees actually stuck the thing to the machine.
Years later I was loosely affiliated with Unipress. I did some consulting for them when I was between jobs. I went out to dinner with their principal, a man named Mark Krieger. After a bit of conversation it occurred to me. "Didn't you get booed off the stage at the University of Delaware UNIX users group meeting." He admitted he had, he was half of Whitesmiths with Paul Plauger. It then came back to me about Idris and the software stamps. I mentioned the stamps and he said he was gone by then but that was his sign that Plauger had gone over the edge. I carefully peeled our sticker off the Vax and gave it to him the next time I saw him.
Let's see how much thread-drift I can generate this time...
Dick Hustvedt was born on this day in 1946; an architect of RSX-11 and
VMS, he also had a weird sense of humour which he demonstrated by
enshrining the "microfortnight" into VMS.
Sadly, we lost him in a car accident in 2008.
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."