Tim Newsham:
I'm not sure what fd 3 is intended to be, but its the telnet socket in p9p.
====
By the 10/e days, file descriptor 3 was /dev/tty. There was
no more magic driver for /dev/tty; the special file still
existed, but it was a link to /dev/fd/3.
Similarly /dev/stdin stdout stderr were links to /dev/fd/0 1 2.
(I mean real links, not mere symbolic ones.)
I have a vague recollection that early on /dev/tty was fd/127
instead, but that changed somewhere in the middle 8/e era.
None of which says what Plan 9 did with that file descriptor,
though I suppose it could possibly have copied the /dev/tty
use.
And none of that excuses the hard-coded magic number file
descriptor, but hackers will be hackers.
Norman Wilson
Toronto ON
Here are my notes to run 8th Edition Research Unix on SIMH.
http://9legacy.org/9legacy/doc/simh/v8
These notes are quite raw and unpolished, but should be
sufficient to get Unix running on SIMH.
Fell free to use, improve and share.
--
David du Colombier
Many years ago I was at Burroughs and they wanted to do Unix (4.1c) on a new machine. Fine. We all started on the project porting from a Vax. So far so good. Then a new PM came in and said that intel was the future and we needed to use their machines for the host of the port. And an intel rep brought in their little x86 box running some version of Unix (Xenix?, I didn’t go anywhere near the thing). My boss, who was running the Unix port project did the following:
Every Friday evening he would log into the intel box as root and run “/bin/rm -rf /“ from the console. Then turn off the console and walk away.
Monday morning found the box dead and the intel rep would be called to come and ‘fix’ his box.
This went on for about 4 weeks, and finally my boss asked the intel rep what was wrong with his machine.
The rep replied that this was ‘normal’ for the hardware/software and we would just have to “get used to it”.
The PM removed the intel box a couple of days later.
David
> On Apr 25, 2017, at 7:19 AM, tuhs-request(a)minnie.tuhs.org wrote:
>
> From: Larry McVoy <lm(a)mcvoy.com>
> To: Clem Cole <clemc(a)ccc.com>
> Cc: Larry McVoy <lm(a)mcvoy.com>, TUHS main list <tuhs(a)minnie.tuhs.org>
> Subject: Re: [TUHS] was turmoil, moving to rm -rf /
> Message-ID: <20170425140853.GD24499(a)mcvoy.com>
> Content-Type: text/plain; charset=us-ascii
>
> Whoever was the genuis that put mknod in /etc has my gratitude.
> We had other working Masscomp boxen but after I screwed up that
> badly nobody would let me near them until I fixed mine :)
>
> And you have to share who it was, I admitted I did it, I think
> it's just a thing many people do..... Once :)
I don't know if this is of any interest to anyone here, but 1999 is 18 years
ago, so maybe it counts as old?
Over on nextcomputers.org various users had found a backup of next68k.org
which included a wget of the old source
http://nextftp.onionmixer.net/next.68k.org/otto/html/pub/Darwin/PublicSource
/Darwin/index.html
So I found a copy of Rhapsody DR-2, the last binary version of this Mach
2.5+4.4BSD and after a day got a kernel to build. Another day and I had it
interfacing to the driverkit to load drivers.
After a post on reddit someone gave me a link to some kdx p2p network, where
they had a Darwin 0.3 toast image.
using what I learned with Darwin 0.1 I got the 0.3 to build as well.
I uploaded a bunch of stuff here:
https://sourceforge.net/projects/aapl-darwin/
although it seems to not let me upload the toast images themselves.
I did slam together a minimal Darwin 0.3 qemu image that can sort-of boot to
single user mode. It's not even slightly useful, but it does show that it
works.
https://sourceforge.net/projects/aapl-darwin/files/qemu-images/Darwin03_qemu
090_24_4_2017.7z/download
> From: Kurt H Maier
> /etc/glob, which appears to report no-match if the first character is .
So I couldn't be bothered to work out how 'glob' worked exactly, so I just did
an experiment: I created a hacked version of 'rm' that had the directory
handling call to glob call 'echo' instead of 'rm'; it also printed 'tried'
instead of the actual unlink call, and printed 'cd' when it changed
directories.
I then set up two subsidiary directors, foo and .bar, with one containing
'.foo0 foo1' and the other '.bar0 bar1'.
Saying 'xrm -r -f .*' produced this:
cd: .
-r -f foo xrm xrm.c
cd: ..
-r -f foo xrm xrm.c
cd: .bar
-r -f bar1
(This system has /tmp on a mounted file system, which is why the 'cd ..' was a
NOP. And a very good thing, too; at one point the phone rang, and it
distracted me, and I automatically typed 'rm', not 'xrm'... see below for what
happened. No biggie, there were only my test files there. The output lines
are "-r -f foo xrm xrm.c" because that's what 'glob' passed to 'echo'.)
Saying 'xrm -r -f *' produced this:
cd: foo
-r -f foo1
xrm: tried
xrm.c: tried
So apparently 'glob', when presented with '*' , ignores entries starting with
'.', but '.*' does not.
When I stupidly typed 'rm -r -f .*', it did more or les what I originally
thought it would: deleted all the files in all the directories (but only on
the /tmp device, because .. linked to the itself in /tmp, so it didn't escape
from that volume); leaving all the directories, but empty, except for the
files .foo0 and .bar0. So files and inferior directories with names starting
with '.' would have escaped, but nothing else.
Noel
> From: "Ron Natalie"
> Actually, it's the shell that calls glob.
Yes, in the initial expansion of the command line, but V6 'rm' also uses
'glob' internally; if the '-r' flag is given, and the current name in the
command argument list is a directory, viz.:
if ((buf->mode & 060000) == 040000) {
if (rflg) {
...
execl("/etc/glob", "glob", "rm", "-r",
fflg? "-f": "*", fflg? "*": p, 0);
printf("%s: no glob\n", arg);
exit();
}
(where 'p' is 0 - no idea why the writer didn't just say '"*": 0, 0').
So "rm -f foo*", where the current directory contains file 'foo0 foo1 foo2'
and directoty 'foobar', and directory 'foobar' contains 'bar0 bar1 bar2', the
first instance of 'glob' (run by the shell) expands the 'foo0 foo1 foo2 foobar'
and the second instance (run by 'rm') expands the 'bar0 bar1 bar2'.
> Glob then invokes the command (in this case rm).
I don't totally grok 'glob', but it is prepared to exec() either the command
name, /bin/{command} or /usr/bin/{command}; but if that file is not executable
it tries feeding it to the shell, on the assumption it must be a shell command
list:
execv(file, arg);
if (errno==ENOEXEC) {
arg[0] = file;
*--arg = "/bin/sh";
execv(*arg, arg);
}
I guess (too lazy to look) that the execv() must return a different error
number if the file doesn't exist at all, so it only tries the shell if the
file existed, but wasn't executable.
Noel
There was an incident at Pixar that a runaway rm ate most of the Toy Story 2
movie. The only thing that saved them was an employee had their own copy
on a machine at home.
We never lost the whole disk through one of these, but we did have a guy
wipe out /etc/passwd one day. Our password fields had an rfc-822ish user
name in the gcos field, so it looked
something like:
ron::51:50:Ronald Natalie <ron>:/sys1/ron:
Well, one of our users decided to grep for a user (alas while root) with the
command
grep <howard> /etc/passwd
Hello all.
It's off-topic for this list, but there is turmoil in Linux-land. A bug
was discovered in systemd, whereby systemd re-implemented "rm"
functionality without following POSIX "rm" behaviour. This could kill a
system, as explained here: https://github.com/systemd/systemd/issues/5644
The reference POSIX "rm" behaviour is that "rm -rf .*" should NOT delete
the current and parent directories, as stated here:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html#tag_20_11…
So, to get on-topic, I have a question for UNIX historians: when was it
first defined in the UNIX realm that "rm -r .*" should NOT delete the
current and parent directories? Would the command "cd /tmp ; rm -rf .*"
be able to kill a V6 or V7 UNIX system?
Regards,
--
Josh Good
I have a memory of having seen a Zilog Z-80 (not Z8002 like the Onyx) based Unix, possibly v6, at a vendor show or conference - perhaps the West Coast Computer Faire (WCCF) in the late 1970s or early 1980s.
I recall asking the people in the booth how they managed without an MMU, and don't recall their answer. I do remember thinking that since Unix had "grown up" with MMUs to stomp on obvious pointer mistakes, the software ought to be relatively well-behaved ... you know: not trying to play "core war" with itself?
I searched the TUHS archives cursorily with Google to see if this has been previously mentioned, but pretty much all Z80 CPU references have for its use in "smart" I/O devices back in the day.
Does anyone else remember this Z80 Unix and who did it? Or maybe that it was a clone of some kind ... ?
looking for a little history,
Erik Fair
I was trying to configure C news on 2.9BSD today and I found that its
Bourne shell doesn't grok # comments. The Bourne shell in 2.11BSD does.
So I thought: when did the Bourne (and other) shells first grok # as
indicating a comment? Was this in response to #! being added to the
kernel, or was it the other way around? And was the choice of #!
arbitrary, or was it borrowed from somewhere else?
Datum point: 2.9BSD's kernel can recognise #!, but the sh can't recognise #.
Cheers, Warren