So, while bringing up V6 on a hardware PDP-11/23 with an RK11 emulator using
an SD card for storage which Dave Bridgham and I are doing, I found this piece
of code in main() on V6 Unix:
rootdir = iget(rootdev, ROOTINO);
rootdir->i_flag =& ~ILOCK;
u.u_cdir = iget(rootdev, ROOTINO);
u.u_cdir->i_flag =& ~ILOCK;
I don't get why two separate calls to iget(), with the same arguments;
why not replace the second pair of lines with:
u.u_cdir = rootdir;
rootdir->i_count++;
What am I missing?
Noel
>>> LSX has a maximum of three processes that are swapped in and out in a
>>> stack-like fashion. Only one process is ever in core.
>
> I'm having a hard time working out how this works. If process A is swapped
> out, and then B, B has to be swapped in before A can be? But only one process
> is ever in core at a time? To get A in, B has to be moved out? But then B
> would be the last one out, and would have to come in before A?
>
> Anyway, I don't understand why the OS could/would care which order processes
> we swapped in - unless it's something like the 'onion skin' memory allocation
> algorithm of CTSS (which also had only a single process resident at a time,
> IIRC), where, when a small process had to be swapped in, and a large one was
> already in, it only swapped out enough of the large one to make room for the
> small one. The process could recurse, hence the name.
The LSI-11 had 40KB of core. The lower 16KB held the LSX kernel, the upper 24K was
for the active process.
LSX has 3 process slots and 2 swap slots (on floppy!). Optionally, LSX could
be built with an additional background process ("BGOPTION"), but this does
not work very well. Process numbers and swap slots have a 1:1 relationship.
There is a global variable, cpid, with the process number of the current
process, initially zero. Upon boot, LSX will load a shell as process 0.
(There is no swapper process and no init in LSX).
The original LSI-11 kernel code is here:
http://minnie.tuhs.org/cgi-bin/utree.pl?file=LSX/sys
I can refer to source lines in the repository for my TI990 port of it:
https://1587660.websites.xs4all.nl/cgi-bin/9995/artifact/b6ec9496e23efe8c
When a process forks, it writes the current core image out to the
corresponding swap slot (this swaps out the parent) and the core image
is repurposed as the new process (i.e. cpid is incremented and the
proc table filled in):
https://1587660.websites.xs4all.nl/cgi-bin/9995/artifact/3617ec3245c40a69?l…
The child now runs and the parent remains suspended until the child completes.
Yes, this implies no pipes. The shell is modified to emulate pipes with files.
When the child completes, it stores its u area / exit code in its swap slot
(as it is running, the swap slot must be empty. Process 3 has a small swap slot
just for this). Next LSX decreases cpid and the parent process is reloaded from
its swap slot:
https://1587660.websites.xs4all.nl/cgi-bin/9995/artifact/b9c07dfc5add9fc5?l…
The actual swapping happens here:
https://1587660.websites.xs4all.nl/cgi-bin/9995/artifact/b6ec9496e23efe8c?l…
The original PDP11 source has code to compress the empty space between _end and the
stack pointer, which I did not get to work properly.
LSX works well enough to run the standard V6 binaries unmodified. Some need to be
tweaked (e.g. table space in cpp) and the shell needed the pipe change. It can run
the V6 c compiler, but not with a wild card argument: that requires 4 stacked processes
(sh, glob, cc and cpp/c0/..) and LSX allows only 3.
Hope the above makes it a bit more clear.
We lost AI pioneer Marvin Minsky on this day in 2016 from a cerebral
haemorrhage, aged 88. Amongst other things, along with John McCarthy he
co-founded the MIT AI Lab, co-invented the Logo "turtle", was mentioned in
Arthur C. Clarke's novel "2001: A Space Odyssey", and built the first
randomly wired neural network learning machine, SNARC, in 1951.
He is now thought to be cryogenically preserved as "Patient 144" at Alcor
(he started cooling on 27/1/2016).
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
> From: Doug McIlroy
>> From: Paul Ruizendaal
>> LSX has a maximum of three processes that are swapped in and out in a
>> stack-like fashion. Only one process is ever in core.
I'm having a hard time working out how this works. If process A is swapped
out, and then B, B has to be swapped in before A can be? But only one process
is ever in core at a time? To get A in, B has to be moved out? But then B
would be the last one out, and would have to come in before A?
Anyway, I don't understand why the OS could/would care which order processes
we swapped in - unless it's something like the 'onion skin' memory allocation
algorithm of CTSS (which also had only a single process resident at a time,
IIRC), where, when a small process had to be swapped in, and a large one was
already in, it only swapped out enough of the large one to make room for the
small one. The process could recurse, hence the name.
> V1 was a time-sharing system; for which LIFO swapping is
> inappropriate.
And I don't follow that either...
V1 ran on the 11/20 without memory management hardware, though, right?
(Although there's that cryptic reference to the KS11 in "Odd Comments and
Strange Doings in Unix", although I've never been able to find out anything
else about the KS11.) So presumably one would not have wanted more than one
process resident at a time, as that decreases the odds of a buggy program
trashing another process?
Noel
Hi
I've just had an interesting experience, explaining C header files to
a nephew programmer who didn't understand them. I pointed him in the
direction of Minix as an example of a small well-engineered system
which would display their use.
Which raised the question: when did header files come into use? Who
was the first to use header files to store common system-wide or
application-wide data definitions? Was it used in any languages prior
to C?
Thanks
Wesley Parish
Hi.
Can a modern BSD guru please contact me off-list? I have a set of related
tests in the gawk test suite that consistently fail on just about every
*BSD system. It has me stumped, and I'd like to see these tests working
if possible.
(They've been not working for quite a while. That I get no complaints
from BSD users tells me that gawk isn't popular in that world, but that's
another story. :-)
Thanks,
Arnold
Re: [TUHS] Kernel Sizes
> I've often thought that LSX was V5 'regressed' to the concepts of
> V1, which was facing similar hardware constraints. Is that a
> reasonable view?
> LSX has a maximum of three processes that are swapped
> in and out in a stack-like fashion. Only one process is ever in core.
> Is that how V1 was organized?
The rocess limit was higher in V1. And V1 was a time-sharing
system; for which LIFO swapping is inappropriate. So LSX
seems to have "regressed" to some pre-Unix state.
doug
16K kernels?
Well, I came late to the UNIX world. I only remember getting a SCO
UNIX 3.2V4.2 kernel onto a single 3-1/2" diskette and still have all I
wanted including (with scripts on a second diskette of course :-) ).
That was 25 years ago.
Mind you, from there I moved to Digital UNIX /vmunix 9,613.712, Tru64
17.930.976 to HP-UX 11iv2 66.161.464 and HP-UX 11iv3 127.929.032
Of course, I also got lots more functionality I'm supposed to want and need :-)
Cheers,
rudi
For a presentation I'm doing this summer on FreeBSD, I thought it would be
cool to get the kernel sizes for various old flavors of Unix. I see numbers
for v5, v6 and v7 in the tuhs tree view, and it appears these versions are
complete enough for me to extract the kernels themselves. However, I see
nothing prior to that. The archives seem to be somewhat incomplete, but I'm
wondering if people have sizes for earlier versions. Later versions are
more problematic because they move to new hardware, instruction sets, etc.
For this graph to be meaningful, it would need to be pdp-11 only, though
I'm of the opinion more data is better than less. I'll also be extracting
the different V7 commercial kernels: V7M, Ultrix and Venix and the BSD 2.x
releases, but those appear to be intact enough in the archives to extract
data on my own. I've heard rumors there's a SysV for the pdp-11, but I've
not been able to locate images for that. I don't need the actual images,
just sizes with some reference for the source of the data. It's just for
one slide in the talk, so I don't want to burn a ton of time on it...
The larger picture is that I've written what's effectively modprobe for
FreeBSD and will be talking about it in detail. How it's like modprobe, how
it's different, how all the pieces fit together, history of similar
efforts, etc. Part of the driving force here is the bloated FreeBSD GENERIC
kernel.
Of course, I'll share the final report I'm planning on sizes with the group.
Thanks for any data you can provide.
Warner
> A self-imposed limit of 16K held in v1, and was quite fully utilized.
> When the iernel was rewritten in C, the limit (perhaps larger by then)
> influenced the C compiler. More than one optimization was stimulated
> by the need to keep the kernel in bounds.
>
> Doug
The LSX kernel was kept within a self-imposed limit of 16KB as well.
I've often thought that LSX was V5 'regressed' to the concepts of
V1, which was facing similar hardware constraints. Is that a
reasonable view?
For example, LSX has a maximum of three processes that are swapped
in and out in a stack-like fashion. Only one process is ever in core.
Is that how V1 was organized?
I realize that LSX was API compatible with V5/V6 and I don't mean
'regressed' in that sense.
Paul
> I seem to remember that at some point early on, we spent some of our
> capital budget on buying another 16K bytes for the PDP-11. As I
> recall, the deal was that the OS got 8K and users got 8K. I also
> recall that that purchase was 20% of our capital budget for the
> year...
> Doug, did I remember this correctly?
> Steve
Things did happen that way. I don't specifically remember the
numbers, but those you state have the ring of truth.
Memory came in (expensive) 4K increments. When the keepers of
Unix in the Charlotte wire center wanted to add 4K, their
management consented only on the condition that the wizards
in Research would confirm that roposed new functionality
really required it.
doug
A self-imposed limit of 16K held in v1, and was quite fully utilized.
When the iernel was rewritten in C, the limit (perhaps larger by then)
influenced the C compiler. More than one optimization was stimulated
by the need to keep the kernel in bounds.
Doug
Sorry for the off topic post.
I'm hoping that someone here might have seen a (what I consider to be) a
computer lore type story about a contractor that was brought in part way
through a project to consolidate three DCs into one. - In the end he
managed to do it early and under budget. The kicker is that they quite
literally physically moved and re-connected everything the way that it
was. Meaning that there were still WAN circuits (local only of course)
between equipment that was previously in different DCs.
I would like to find a copy of this story and save it in my archive. But
I've not been able to do so. Thus I'm asking a wider audience to see if
anyone might be able to give me a pointer.
--
Grant. . . .
unix || die
We lost Ed Yourdon on this day in 2016; a computer pioneer, he helped to
design the underpinnings of relational databases, and pretty much wrote
the book.
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
Dr. Prof. John Lions was born on this day in 1937; I had the pleasure of
having him as one of my Computer Science lecturers in the early 70s, and
he drilled into us the Principle of Least Astonishment (or POLA), better
known as "why the fsck did it do that?" (but he was far too genteel to
express it that way). And yes, that's my name in the credits; I helped
with the proof-reading and provided the use of the high-quality printer in
the CSU.
You are not expected to understand this.
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
Scot Hacker has re-published his BeOS columns for Byte. BeOS was an interesting operating system with a clear Unix inheritance built for a dual-PowerPC system, similar to the Macs of that era.
http://birdhouse.org/beos/byte/
Its inheritance can be found in Haiku (https://www.haiku-os.org)
Arrigo
All,
While it's fresh, I thought I'd share some resources I've found helpful
in learning about the venerable v6 as a relative newb...
Learning Unix V6 in the modern era is an interesting and enormously
educational experience. In the process of using it I have had to learn
how to host it in a simulator (SimH in my case, but there are others),
install it, communicate with it, configure it, build special files for
it, attach devices to it, communicate with the devices attached to it
and to SimH, build a kernel, install the kernel, boot the kernel, work
with a variety of media intended to work with it, extend it, and so on.
In addition, I have had to learn a bit about the PDP-11 (as arguably the
most convenient architecture for learning about V6), about its
architecture, its instruction set, its devices, its memory structure,
and so on.
None of this exploration would have been possible without the excellent
work of Bob Supnik, Mark Pizzolato, and co. on the SimH pdp-11
simulator, the Simh mailing list, Warren Toomey and TUHS for making the
bits available, the TUHS mailing list, PUPS, Bitsavers, and a slew of
readily available documentation and texts including these notables:
Setting Up Unix 6th Edition from the V6 Programmer's Manual
The Unix V6 Programmer's Manual in its entirety
The SimH and SimH PDP-11 Manuals
A large number of blogs with SimH specific V6 installation logs
The V6 Source Code and man pages (don't forget to install man - the 1bsd
version works, and is superior)!
The DEC PDP-11/05-10-35-40 1973 Handbook (the 11/40 handbook is not as
detailed with respect to memory management)
Lions's Commentary on the Sixth Edition source code
Now that I'm over the beginner's hump, so to speak, I'm exploring things
differently and I thought I'd share some resources that I am currently
finding useful and interesting in my explorations...
To bone up on assembly language, Lions's commentary is exceptionally
helpful in explaining assembly as it is implemented in V6. The manual
itself is really thin, and the source is a bit cryptic, for the
newcomer. Lions explains the idioms used in the main source of V6.
However, without a background in assembly language, Lions is pretty
meaningless, so I went looking for something that was PDP specific that
would bridge the gap and help me understand Lions's words. I found a
number of texts that were really good. Most require a working RT11
instance to actually try out the coding examples and do the exercises
(SimH and Bitsavers to the rescue):
Arthur Gill - Machine and Assembly Language Programming of the Pdp-11
Charles A. Kapps and Robert L. Stafford - Assembly Language for the PDP-11
Glenn H. MacEwan - Introduction to Computer Systems: Using the PDP-11
and Pascal
James F. Peters - The Digital Way: Macro-11 Assembler Programming (PDP-11)
Michael G. Schneider - The Principles of Computer Organization: With
Assembly Language Programming for the PDP-11
PDP-11 Processor Handbook (pretty much any edition)
Thomas A. Frank - Introduction to the PDP-11 and its Assembly Language
All of these are useable with a running RT11 instance. But, I think the
Peters and Frank books are the standouts. Peters because all of the
exercises that I have tried (dozens) have worked as printed and Frank
because he is rigorous in his treatment of the subject and builds up
from digital logic all the way through program execution. Frank is an
excellent complement to Lions work because he explains the details that
Lions assumes.
To learn about digital logic, and a special thanks to Warren for his
work on Crazy Small CPU, I have been introduced to logisim. It is a
great playground for exploring digital logic. I had no idea that a
sketchpad for digital logic simulation was available and accessible to
the layperson. Logisim development stopped around 2014 and while there
are a number of successors out there, I am using logisim-evolution:
https://github.com/reds-heig/logisim-evolution
The rabbit trails never seem to end... in order to learn how to use
logisim, I went through the excellent tutorial and then went looking for
a book of experiments in digital logic and found:
digital computer lab workbook from 1969
http://bitsavers.trailing-edge.com/pdf/dec/handbooks/Digital_Computer_Lab_W…
digital equipment corporation computer lab teacher's guide from 1968
http://www.so-much-stuff.com/pdp8/pdf/ComputerLabTeachersGuide.pdf
These two are useable with very little modification as a source of
digital logic exercises that work great with logisim and are related to
the architectural lineage of the PDP-11.
These resources fit together nicely in my pursuit to better understand
digital logic, the pdp-11, assembly language, and unix v6. In sum:
Source code for v6 for what really is supposed to happen in v6 operation
Lions for understanding Unix V6 sources and for unix assembly language
information
PDP-11 Hanbook for quick reference on PDP-11 assembly language
instruction set
Frank for assembly language details and for details on digital logic and
its relationship to the PDP-11 architecture.
Logisim to test logic constructs
The digital lab workbook for practice with digital logic
Later,
Will
--
GPG Fingerprint: 68F4 B3BD 1730 555A 4462 7D45 3EAA 5B6D A982 BAAF
Hi all, Happy New Year. As it's now only eighteen months to the Unix 50th
Anniversary, I thought I'd poll you all to get an update of what is being
done to celebrate the anniversary, and/or what could we organise that has
not yet been organised.
Cheers, Warren
Sir Charles Antony Richard Hoare FRS FREng was born on this day in 1934; a
computer pioneer (one of the greats) he gave us things like the quicksort
algorithm and ALGOLW (a neat language).
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
Computer pioneer Donald Knuth was born on this day in 1938; amongst other
things he gave us the TeX typesetting language, and he's still working on
"The Art Of Computer Programming" fascicles (I only got as far as the
first two volumes).
I really must have a look at his new MMIX, too; I love learning new
programming languages (I've used about 50 the last time I looked, and I'm
happy to post a list for my coterie of disbelievers).
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
> I will be happy to forward pertinent suggestions.
Here's one. If Bell Labs holds some kind of symposium on
the lines of the dmr memorial, how about a plenary
session with TV participation from remote venues (think
Berkeley/Silicon Valley and Wollongong/Sydney--a nine-hour
span of time zones).
Any thoughts about this or other possibilities?
Doug
I don't think I'm violating anyone's confidentiality by revealing that
Marcus Weldon, current president of the Labs, at the suggestion of
Martin Carroll, expects the Labs to embark soon on plans to mark
the occasion. I, and no doubt Martin, will keep you posted. Meanwhile
I will be happy to forward pertinent suggestions.
Doug