I've assembled some notes from old manuals and other sources
on the formats used for on-disk file systems through the
Seventh Edition:
http://www.cita.utoronto.ca/~norman/old-unix/old-fs.html
Additional notes, comments on style, and whatnot are welcome.
(It may be sensible to send anything in the last two categories
directly to me, rather than to the whole list.)
In article by Robertdkeys(a)aol.com:
> Warren... is there a non-broken 4.3BSD-Tahoe set somewhere?
> Bob
As in a bootable 4.3BSD-Tahoe kit? As far as I know, no. The Unix Archive
has a broken copy in 4BSD/Distributions/4.3BSD-Tahoe, indicating that
both usr.tar and src.tar are broken.
It might/should be possible to merge files from the CRSG CD set from Kirk
to recreate these tar files.
Anybody out there have an unbroken Tahoe release?
Warren
Michael Davidson distrusted:
>Note that this means that r4, r3 and r2 get restored to the values
>that they had at the time that the next stack frame was established
>(ie when the "next" function down was called from the original context)
>and that these are not necessarily the values that they had at the
>moment when the original call to setjnp returned. Hence the various
>caveats about not relying on the value of any register variables
>after returning via longjmp.
You can trust register variables when setjmp() returns the second time. Then
the registers are restored to the values they had when the "next" function was
called, that is the "values as of the time longjmp() was called" (quoted from
longjmp(3)'s man page. Thus any variable behaves the same, regardless of its
storage class.
By the way, this is not the case in V6. The register variables-- and only
the register variables-- are restored to the values as of the time setexit() was
called. (In V6 "setjmp()" is named "setexit()" and "longjmp()" is named "reset()").
Thus the value of a variable depends on its storage class. If it is register,
you get the value when setexit() was called, if it is not register, you get
the value when reset() was called. This might be considered a bug.
Greetings
Wolfgang
Looking thru the code for setjmp/longjmp (/usr/src/libc/gen/setjmp.s),
and have a question. Longjmp seems to make an attempt at restoring
register two through four, but setjmp doesn't save them. Where do
these register get saved from?
Brantley Coile
some hours ago I wrote:
>I ask this, because my system crashes ones in a while. But I changed it
>here and there, so it might be my fault.
It *was* my fault! So far, I have only found one bug in V6: The size
of swapmap and coremap are configured too small, so they might overflow.
The sizes don't take account of shared text segments, that produce
extra chunks of free memory. In V6 there are 19 pure executables, so their
minimal size should be (NPROC+19)*2, or better yet (NPROC+NTEXT)*2, where
NTEXT should be set to 20 instead of 40 as distributed in param.h .
I don't think this bug ever showed up. It is very unlikely. In V7 these
sizes are choosen to be even smaller than NPROC and even with its many pure
executables, I don't think V7 ever crashed because of this bug.
So, with the only exception reported by Brian S. Walden, there seem to be
no bugs in V6 that crash systems.
Greetings
Wolfgang
>
>In article by Mirian Crzig Lennox:
>> This reminds me that I fixed a couple of "bugs" (some outright bugs,
>> and some mere behaviours which I didn't quite like) in playing with my
>> V6/simh environment, and I'm wondering if there is a place I should
>> submit them in case others might be interested. [ .. ]
Mirian, I'd love to see your fixes! By the way, you might want to
look at
http://www.tuhs.org/Archive/PDP-11/Bug_Fixes/V6enb
for some changes I applied to V6.
Thanks to Warren and Mirian for helping me to undig the "50 bugs tape"!
But the "bugs fixes" look more like performance enhancements. Do you know
any real bugs in V6? By "real" I mean a bug, that might crash the system.
I ask this, because my system crashes ones in a while. But I changed it
here and there, so it might be my fault.
Greetings,
Wolfgang
>
>P.S Does anybody want to backport vi to 6th & 7th Edition?! :-)
Hmm. It's less work to learn ed, so I took that path :-).
In article by Warren Toomey:
> P.S. Does anybody want to backport vi to 6th and 7th Edition?! :-)
The 2BSD tape contains vi source code that can *definitely* be built
on 7th edition (I've done it, it was easy) and supposedly can also
be used to build a 6th-edition "native" vi if you're willing to
backport the V7 C compiler (I haven't done that yet).
Since many people in 2BSD's time frame would not have had access
to V7 systems or V7-ish C compilers, the 2BSD tape also contains a
vi binary for V6 systems.
I think 2BSD was released around the same time as V7, and had an
assumption that many people would not yet have access to V7, and
so would want to use 2BSD as an add-on to V6 systems.
Since 6th edition didn't have environment variables, the 2BSD/V6
version of vi would get the terminal type from a file that mapped
hardwired serial lines to terminal type names. I think it was
called /etc/htmp.
By the way, does anybody else think that vi should have been upgraded
to vii when V7 came out? :-)
Yes there are other bugs you will want to fix as well
if you are using v6 heavily and not on slow hardware
(e.g. a simulator). In the inode allocation route
(ialloc()) in /usr/sys/ken/alloc.c there is a bug in
the placement of the loop: tag. You just have to move
it up two line to above the while() loop. See the diff below.
This rare Ken Thompson bug was found in 1988 on an Amdahl UTS machine
that the hardware finally became fast enough that it caused us panics.
This bug existed from (at least) the Fifth up until the Eighth
editions from 1127 (BTL research). The Ninth edition had much
rewrites in the kernel and the algorthim was changed at that point.
Since it was in UTS, it must have been in the porting base of
System V Release 2. This code is the basis for the System V
filesystem, so it probably didn't exist in BSD releases
since they used their fast filesystem (cylinder groups, et al.)
which became UFS. It's amazing thet with the amount of eyes on it
(via Lions Commentary, etc.) it was not spotted earlier.
It would be good to get a collection of all "unreleased" bug fixes
that others may have.
*** alloc.c.orig Fri Dec 27 23:23:30 2002
--- alloc.c Fri Dec 27 23:23:30 2002
***************
*** 163,171 ****
int i, j, k, ino;
fp = getfs(dev);
while(fp->s_ilock)
sleep(&fp->s_ilock, PINOD);
- loop:
if(fp->s_ninode > 0) {
ino = fp->s_inode[--fp->s_ninode];
ip = iget(dev, ino);
--- 163,171 ----
int i, j, k, ino;
fp = getfs(dev);
+ loop:
while(fp->s_ilock)
sleep(&fp->s_ilock, PINOD);
if(fp->s_ninode > 0) {
ino = fp->s_inode[--fp->s_ninode];
ip = iget(dev, ino);
In article by Mirian Crzig Lennox:
> This reminds me that I fixed a couple of "bugs" (some outright bugs,
> and some mere behaviours which I didn't quite like) in playing with my
> V6/simh environment, and I'm wondering if there is a place I should
> submit them in case others might be interested.
> P.S Does anybody want to backport vi to 6th & 7th Edition?! :-)
'vi' definately works with I+D space under edition 7 (11/44/45/50/53/55/70/73)
There was also an overlayed version for I space only under BSD 2.?, but it was
sooooo slow as to be almost useless