A belated rejoinder to:
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.
You're welcome. I can't remember, though, whether I fixed it on
purpose or as part of the many general cleanups and restructurings
I did at that point. And I didn't do enough of it; recently I
discovered a dumb problem that I probably introduced in the same
cleanups, wherein the i-node allocated for a file that couldn't be
created because the file system was full and the directory entry
couldn't be written was left allocated but nameless ...
Norman Wilson
Toronto ON
On Jan 6, 19:01, Wolfgang Helbig wrote:
> Richard L. Hamilton searches:
> >The files
> >
> >http://minnie.tuhs.org/UnixTree/V7/usr/sys/dev/rl.c
> >http://minnie.tuhs.org/UnixTree/V7/usr/sys/conf/mkconf.c
> >
> >don't seem to match - mkconf.c wants to generate references to
> >rlopen() and rlclose(), which don't exist in that version of rl.
> >What I'm really looking for is the right version of driver(s) etc.
>
> It seems that a version of the rl driver that matches
> mkconf, was never supplied by the bell labs.
>
> As a workaround delete the rl entry in cdevsw and the line
> "int rlopen,..." from c.c. This will give you a block device of the rl
disk,
> but no raw device.
Hmm... my 7th Edition distribution /usr/sys/dev/rl.c certainly *does*
have rlopen() and rlclose(). If you want them, I can send rl.c and the
matching mkconf.c to you, or to Warren, along with the rl1conf and rl2conf
(for RL01 and RL02 disks) from /usr/sys/conf/ and any other files needed
(if someone can tell me what might be required -- it's a long long time
since I looked at any of this. The distribution came for an 11/23 with 2
x RL02, and it also has some special source files for 11/23, 11/34, etc
("small machines") including tests for recovery from segmentation traps in
floating point (which isn't the same on all PDP-11 models), and an RK
driver from the Boston Children's Museum which handles overlapped seeks on
multiple drives.
I'll be away for a couple of days so don't expect a prompt reply, but the
source is online here so I can easily copy a few files when I get back.
--
Pete Peter Turnbull
Network Manager
University of York
Richard L. Hamilton searches:
>The files
>
>http://minnie.tuhs.org/UnixTree/V7/usr/sys/dev/rl.c
>http://minnie.tuhs.org/UnixTree/V7/usr/sys/conf/mkconf.c
>
>don't seem to match - mkconf.c wants to generate references to
>rlopen() and rlclose(), which don't exist in that version of rl.
>What I'm really looking for is the right version of driver(s) etc.
It seems that a version of the rl driver that matches
mkconf, was never supplied by the bell labs.
As a workaround delete the rl entry in cdevsw and the line
"int rlopen,..." from c.c. This will give you a block device of the rl disk,
but no raw device.
Greetings,
Wolfgang
The files
http://minnie.tuhs.org/UnixTree/V7/usr/sys/dev/rl.chttp://minnie.tuhs.org/UnixTree/V7/usr/sys/conf/mkconf.c
don't seem to match - mkconf.c wants to generate references to
rlopen() and rlclose(), which don't exist in that version of rl.c.
What I'm really looking for is the right version of driver(s) etc.
so that I can regenerate the rl2unix kernel in the V7 image
available for use with simh, so that I can add or tweak drivers, eventually
adding the dz driver so I can run multiple "terminals" with telnet access.
--
mailto:rlhamil@mindwarp.smart.net http://www.smart.net/~rlhamil
Hi,
tinkering at V6--now I need db(I). It works fine, but three features
that are described in its manual page seem to be missing:
- The names of the general registers (r0, ...) are not build in, at least
db only responds with `?' to `r0'. I can examine the registers
via the `$' command though.
- The '*' feature doesn't work, i.e. `*_main' gives me a `?'.
- I can't specify a number being relocatable, i.e. '10r' gives me a `?'.
Is this an exercise to the user? Did anyone solve the exercise. Or did I
just not understand the manual page?
Greetings,
Wolfgang
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
>>When a process terminates (in sys1.c/exit()), it explicitly wakes up
>>the init process. In light of the fact, that every process has a parent,
>>this extra wakeup(&proc[1]) seems unnecessary.
>
>I believe this is meant to handle the case where a process exits
>without having called wait() on its children.
>
>Imagine two processes, A and B, where A is B's parent and A's parent
>is some process other than init. B calls exit(), becomes a zombie,
>and awakens A. Some time later, A calls exit() without ever having
>called wait(). This will cause B to become a child of init, and as B
>is a zombie, init should awaken so that B can die. However, A might
>have any number of zombie children, and it would be redundant to call
>wakeup(&proc[1]) for each one. Therefore, the wakeup call to init is
>done up front, whether it is needed or not. This does result in some
>unnecessary wakeup calls but on the whole it seems a good tradeoff for
>code simplicity.
Oh, I see! So the condition to wakeup init would be
"Do I have any zombie children"?
The code as it is is simpler. But harder to understand.
Thank you very much for your help!
Greetings
Wolfgang Helbig
Hi,
encouraged by the profound answers I thankfully recieved to my previous
question about the Unix V6 kernel, here is another one:
When a process terminates (in sys1.c/exit()), it explicitly wakes up
the init process. In light of the fact, that every process has a parent,
this extra wakeup(&proc[1]) seems unnecessary. Furthermore, the "goto loop:"
at the end of exit() will never be executed.
So is this just defensive programming, or did I miss something?
Greetings,
Wolfgang Helbig
Dear All,
There is a complete 11/34 for sale on EBay (1 day to go). It comes with
a complete V6 with source.
Somebody buy it please. This is nothing to do with me, I just saw it
tonight. It's in Pontypridd South Wales
Cheers
Robin
--
Robin Birch
Yes, I have v6 running on an 11/34; it's amazing how easy it is to
corrupt the filesystem. :-) One of these days, I need to dd another
fresh system disk (RK05) off my "sacred copy" of a PUPS image (tediously
transferred via 9600 baud serial using Warren's excellent vtserver
tools). In any case, why do you ask? - Ian
-----Original Message-----
From: Wolfgang Helbig [mailto:helbig@Informatik.BA-Stuttgart.DE]
Sent: Saturday, December 14, 2002 12:48 AM
To: tuhs(a)minnie.tuhs.org
Subject: Re: [TUHS] re: Raise of interrupt level necessary
[snip]
I also removed IPL protection from the return sequence of the trap
routine, still works. Testing was done on Bob Supnik's SIMH PDP-11
simulator with only one terminal. By the way, is anyone running V6 on a
real PDP-11? [snip]
>Date: Sat, 14 Dec 2002 15:27:40 -0800
Michael Davidson wrote:
>If you think that the "rule" is "no ISR can touch user space while
>interrupting a kernel process", then it is display() that breaks
>the rule.
The point is, that this rule leads to somewhat simpler and therefore
better code -- breaking the rule calls for some justification.
Calling display() from the clock-ISR is the only place where an ISR does
not conform to this rule.
Greetings
Wolfgang Helbig
Dennis, I greatly appreciate your reply. What amazes me most, is the fact
that after 20 odd years you still remember those tricky details:
>For example, the clock interrupt routine can inspect user
>space (for display(), for example, though this is inactive
>on the 11/40), and even change it (for profiling).
>It does appear that other things (checking for
>a direct-from user-mode interrupt) in the clock routine
>already guard against these particular problems.
To see what happens, I just removed those IPL raising instructions from gword,
pword,_savu, _aretu, _copyseg, and _clearseg in m40.s. In fact, it didn't crash
the system. At least on my configuration, ISRs don't touch user space while
interrupting a kernel process. This rule is broken by the clock ISR, which calls
display() unconditionally. Just curious: Is there any other reason beside
seeing blinking lights that justifies calling display() 60 times per second
and breaking the rule?
I also removed IPL protection from the return sequence of the trap routine,
still works. Testing was done on Bob Supnik's SIMH PDP-11 simulator with only
one terminal. By the way, is anyone running V6 on a real PDP-11? Here
is the diff of my modifications to m40.s:
# diff m40.s.6 m40.s
44d43
* bis $340,PS
455,456d453
* mov PS,-(sp)
* bis $340,PS
472,473d468
* mov PS,-(sp)
* bis $340,PS
480d474
* mov (sp)+,PS
485d478
* mov (sp)+,PS
539d531
* bis $340,PS
548d539
* bis $340,PS
594c585
* mov $30340,PS
---
. bis $30000,PS
621c612
* mov $30340,PS
---
. bis $30000,PS
Greetings,
Wolfgang Helbig
I know it causes one to salivate like Pavlov's
dogs, even thinking about them, but, anyone know
of any qbus scsi controllers that might someday
come available at anything like reasonable sorts
of guildern de realme?
(running and ducking for cover....(:+]].....)
Just thought I would check.
Thanks
Bob
The particular webster wqesd4 I have looks like
about an '86 or so board, from chip dates, and
the main chip that is socketed is marked with
"ENGR-SAMPLE"...doh.... Maybe I do have a very
early board that won't run with a faster cpu.
The rom is a part no. 080469-01 REV 01, if that
means anything to anyone, as marked on its paper
label. The later sigma board does not have the
problem. Oh, well, if I have to run it with a
KA630 at slo-poke gait, so be it....(:+\\...
There are two diodes, one looks like an ordinary
silicon rectifier and one looks like a zener of
some sort, possibly, off pin 19 of the 74ls240
at position V2 on the board. Those come off
the J6 pin 10 of 10, and are in parallel.
Thanks
Bob
Early ROM revisions on the Webster MSCP controllers were too slow for the
KA650 and would often loose interrupts (amoungst other things). Signals such
as NPR and BR grants were polled from a pseudo microcode loop which took too
long.
The RS232 interface doesn't use standard receivers. Check for a 5 volt zener on
the input of an 74LS240 (from the 10 pin i/o connector) and add a schottky
in parallel (a 1N5818 would do) if one isn't there
If you can read this, the 4-port Wombat (Webster/Sigma ESDI controller)
in the KA650 system through which this mail must pass on its way out
is working fine, as it has since I installed it in that system a year
and a half ago.
According to my notes, I had no trouble communicating with the onboard
diagnostic monitor (with the board in another KA650 reserved for system
testing). I used the monitor quite a bit, starting it many times,
first because it took me a long time to realize that the terminator
had been left installed backwards in one of the drives (so the drive
wasn't visible to the controller no matter what I did to the cables).
I don't think I tried the serial port on the back of the Wombat board;
instead I uttered the magic commands to load and run the Wombat communication
program on the VAX itself. I'd expect this to be more timing-sensitive
than the hardware port. In any case it worked fine.
Once the controller could see the disks (and I'd done some formatting
and some testing with the diagnostics), I tested the Wombat under my
oddball version of UNIX, and found what may be an MSCP implementation
botch. A UNIBUS/QBUS MSCP storage port gets only one interrupt vector;
it is supposed to set one of two flags to indicate whether it is interrupting
because there were no command slots and it freed one, or because there
were no messages waiting to be read and it supplied one. The Wombat
appeared often to be tardy in setting the `message waiting' flag; my
port driver often received an interrupt, checked the flags, found nothing
to do, and of course dismissed the interrupt without realizing that
the controller had in fact reported an I/O completion. (And of course
if I halted the system and took a crash dump I found the flag set.
It took some real-time tracing to uncover the problem.)
It is easy to work around this--instead of relying on the flag, one
can go look at the message descriptors to see if there's a new message--
so that is what my driver now does. I have a vague memory that the
original Ultrix MSCP driver, whence the current BSD one is probably
descended and the current Ultrix one more distantly, already did it
that way. Silly me, I programmed from the protocol spec rather than
just blindly copying someone else's unexplained code ...
None of this explains why Bob Keys is having trouble, but it does
suggest to me that the Wombat firmware might have other subtle bugs
that are tickled by particular systems, perhaps even timing-dependent
problems. (I haven't checked, but it could well be that the interrupt-
flag bug would be invisible to a KA630 because it took a little longer
to get to that part of the interrupt routine.)
I have two Wombat boards with slightly different firmware. (One is
labelled RQD11-EC and its diagnostic monitor calls itself WOMBAT;
the other is branded by SpectraLogic, I forget what model it calls
itself, but the monitor calls itself SLEUTH.) My notes don't say
whether they both displayed the interrupt botch. I do know that
communications with the diagnostic monitor worked fine with both.
The RQD11-EC claimed to have firmware (or perhaps diagnostic monitor)
version 2.38.
Norman Wilson
Toronto ON
> From: msokolov(a)ivan.Harhan.ORG (Michael Sokolov)
> To: tuhs(a)tuhs.org
> Subject: Re: [TUHS] flaky webster or sigma WQESD4 and RQD11 controllers on KA650???
> Date: Thu, 12 Dec 02 23:29:58 PST
>
> Robertdkeys(a)aol.com wrote:
>
> > Is there an endemic problem with this style 4
> > port controller running too fast with a KA650
> > compared to a KA630 cpu?
>
> I have no explanation for your problem, but it has nothing to do
> with speed. Q-bus is Q-bus, and it follows Q-bus timing, which is
> completely independent of the VAX CPU timing.
Yes but there might be CPU spin-loop timing to run the serial
maintenance port from the ROM bootstrap code of the controller.
Not considered good form -- but such things happen.
Some early version of the Sigma RQD11 would work in an 11/73 but not
a KA630. I no longer remember the exact symptoms, but I was glad that
at the time Sigma was only an 80-mile drive from here.
carl
--
carl lowenstein marine physical lab u.c. san diego
clowenst(a)ucsd.edu
I found out what the problem was.....(sheepishly
ducking...(:+\\...). At 3 in the morning I had
a typeo in the config file that the old eyeballs
did not catch. I had typed in the partitions
to allocate to root and swap, as opposed to just
the the disks. It compiled fine, but when run,
it paniced and dumped itself all over the floor.
So much for myopic eyes programming at 3 in the
morning.....
(:+{{.....
Bob