From: Johnny Billquist <bqt@softjar.se>
Subject: Re: PDP11 Values from MFPT
Date: Wed, 22 Feb 2012 16:53:33 +0100 [thread overview]
Message-ID: <ji331u$fr2$1@Iltempo.Update.UU.SE> (raw)
In-Reply-To: <4f44f914.47689786@nntp.aioe.org>
On 2012-02-22 15.33, paramucho wrote:
> On Tue, 21 Feb 2012 20:43:34 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> http://bitsavers.org/pdf/dec/vax/vms/training/
> EY-00014-DP_VMS_Internals_and_Data_Structures_1984.pdf
>
>>> System waits ("blocks") may terminate prematurely because of various
>>> conditions, including stuff that ASTs do. So, when a system wait
>>> returns, the routine has to make sure that it's actual condition has
>>> been satisfied, and if it hasn't then it reissues the system wait. The
>>> stack is not a problem.
>>
>> So you need to restart the system call. What if it is a system call that
>> have been partially completed? The wait does not happen as a unique part
>> of the call.
>
> The previous response was written before I actually checked the
> documentation. I pressed [SEND] by mistake.
Ah. I made some comments that you might want to read and comment on
anyway...
> In fact, there are only three "regular" VMS system calls which issue
> "system waits": hibernate, wait-for-event-flag and wait-for-
> event-group (or something like that). The entire system call is
> nothing more than a "wait" (so partial completion does not occur).
No. You are forgetting all the resource waits. These are the true
"waiting in kernel until can continue" which is different than RSX.
The hibernate and wait-for conditions exist just like in RSX. These are
system calls that restarted whenever interrupted. They have just about
no context, and thus can very easily be restarted automatically, which
is what is done.
The resource waits are something else. These are the ones where the
system really do a wait for the process, while in the kernel (as opposed
to the wait-for state, which essentially does not sit inside the
kernel). And for the resource waits in VMS, the system totally blocks
all ASTs. This is the kind of waits that I'm objecting to, and which are
similar to the USR lock in RT-11.
Like I said - the wait-for state, as well as the hibernating, are just
like in RSX. Although it's not called hibernate in RSX. It's probably
most equal to the BLOCKED state, although it could also be the STOPPED
state. (Why RSX have both is fun. They have different effects for the
purpose of swapping, but are otherwise equal, where STOPPED means the
swapping priority drops to 0, so that it is very eligible to be swapped
out, while BLOCKED retain the normal swap priority. There are system
calls to do both.)
> In VMS, the wait does take place in the mode that the system service
> was executed with the PC/PSL backed-up to reissue the Change-mode
> instruction for the system call. The main reason for this has more to
> do with the orderly handling of processor modes than it has to do with
> kernel context.
No. It is exactly like in RSX. If you get to the end of the AST routine,
the wait will be re-executed for you. There is no magic inside the
kernel that resumes the wait. Simple and efficient. Re-execute the wait
if interrupted. Since the wait-for calls have no context, there is
nothing to back out, nothing that hurts from being redone, and it also
automatically handles any changed conditions that might have happened as
a part of the AST execution itself.
>> Oh, wait, I bet you are thinking in terms of RT-11 here, where the
>> distinction between user mode and kernel mode is rather blurry.
>
> I've used VMS more in the last twenty years than I have RT-11. If my
> thinking is blurry it's because of my hippie memory.
:-)
You seem to have a very good grasp of RT-11, it seems to me.
>> In Unix, as an example, there is no context around to restart in the
>> middle of a system call. What you have left is the context at user mode,
>> which is then the start of the system call again.
>> And this is because a signal is delivered in user mode, so the process
>> gets out of the kernel, in order to run the signal handler. There is no
>> way you can keep the kernel context for the user process around at that
>> point. It can not live on the kernel stack, since you exited from the
>> kernel. It can not live on the user stack, since that would allow you to
>> break the security of the kernel.
>
> This is a separate issue to the system waits above.
Not entirely. The are related.
> Ast delivery is (hardware) controlled by the REI instruction which
> compares the mode of pending asts against the destination mode of the
> REI. For example, user mode asts are note delivered when the REI
> destination mode is kernel. Essentially, from what I can see, asts
> just have to wait. So, effectively, VMS is just as bad as RSX in this
> regard.
Yes, VMS works like RSX. :-)
Not sure what you mean by the REI comment. Maybe the code looks
different in VMS than RSX here, but in RSX, an AST is delivered by the
kernel pushing the AST dependent parameters along with some context on
the user stack, and then exit the kernel (using the REI as usual for any
kernel operation) to get back to user state. The new PC, however, is
then the AST address. At that point, ASTs are blocked by a piece of
information in the process structure saying that an AST is in progress.
When your user program have finished the AST, it will do a new system
call, the EXIT AST (ASTX$ in RSX) system call. This system call will
pick up the context on the user stack, and will then resume by a REI
back to user mode to continue where it was before the AST. The (old) PC
is one of the things that were sitting on the user stack, being pushed
there at AST entry, and popped by the AST EXIT. As a part of the AST
EXIT, ASTs are also enabled for the process again, and before the
process is resumed, a check is made if any ASTs have been queued. If
they have, the first one will be processed instead of the process
resuming at the normal context.
There are also system calls to enable and disable AST recognition. If it
is disabled, ASTs are queued up. (ENAR$ and DSAR$ in RSX.) This is
essentially the same state that you are in if you are currently
processing an AST.
> So, I was right when I remembered that system calls are not restarted
> (involuntarily), but I completely forgot about the hardware mechanism.
System calls are restarted. You noted as much yourself, when you
commented that the PC is backed up. That means that the system call will
be re-executed. How can you not have seen that?
> I'll have another look at this stuff on the weekend. VMS is not always
> obvious.
True. :-)
Johnny
>> RT-11 can, however, get away with some things that you cannot do in
>> systems where user mode and kernel mode are totally separate and
>> isolated from each other.
>
> RT-11/XM and RUST/XM are memory mapped PDP-11 systems where user mode
> and kernel mode are separate. I'm not sure what your point is.
My point was/is that RT-11 is a single user system, where protection and
isolation between user mode programs and the kernel is not an essential
part.
>> Assuming I'm right, I can see why a lot of discussion and confusion
>> comes up between us. The conditions in RT-11 are rather different than
>> other systems, meaning you can do stuff that is totally impossible in
>> other OSes.
>
> I think the confusion comes more because I use VMS examples and you
> use Unix examples. I know nothing about the Unix kernel and you don't
> seem have looked VMS a lot.
I don't think so. Although I must admit that I sometimes makes comment
about VMS based on my knowledge about RSX instead of looking up details.
Almost always it turns out that the knowledge is applicable, but
occasionally I totally mess up. I have used VMS a lot, but admittedly
much less so in the last 20 years.
It happens that I do the same thing with RT-11, based on my knowledge of
OS-8, which I have used a lot as well. But there, the similarities are
less accurate, so it's more dangerous to make the comparison. So I
mostly use it as a help to try figure out how to do things myself, and
where to start looking, instead of making assumptions about the internals.
> I don't think the techniques used in RUST or RT-11 are impossible in
> other OSes. In fact, I'm curious where the RT-11 techniques came from.
> The V2.0 team leader who implemented this stuff had previously worked
> on both RSTS and TOPS-something I think.
I really don't know much about the RT-11 history, apart from the basic
design being uncannily similar to OS/8. :-)
RSTS/E is rather messy and incapable in this respect (asynchronous
things in RSTS/E, you must be kidding... :-) ). TOPS-10 I know little
of. TOPS-20 I know a little more, but still far from enough.
Johnny
next prev parent reply other threads:[~2012-02-22 15:53 UTC|newest]
Thread overview: 222+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-15 14:37 PDP11 Values from MFPT Jerome H. Fine
2012-01-18 6:03 ` paramucho
2012-01-18 11:28 ` Johnny Billquist
2012-01-18 13:05 ` glen herrmannsfeldt
2012-01-18 13:26 ` Johnny Billquist
2012-01-26 3:24 ` Jerome H. Fine
2012-01-26 13:38 ` Johnny Billquist
2012-01-29 1:32 ` Jerome H. Fine
2012-01-29 1:43 ` Johnny Billquist
2012-01-26 3:23 ` Jerome H. Fine
2012-01-18 16:02 ` paramucho
2012-01-18 18:12 ` Johnny Billquist
2012-01-19 14:30 ` paramucho
2012-01-19 16:42 ` Johnny Billquist
2012-01-19 20:32 ` glen herrmannsfeldt
2012-01-20 13:32 ` paramucho
2012-01-20 13:29 ` paramucho
2012-01-20 16:48 ` Johnny Billquist
2012-01-21 12:25 ` paramucho
2012-01-21 20:15 ` Johnny Billquist
2012-01-26 3:25 ` Jerome H. Fine
2012-01-26 6:09 ` paramucho
2012-01-26 6:30 ` paramucho
2012-01-26 13:50 ` Johnny Billquist
2012-01-29 1:52 ` Jerome H. Fine
2012-01-29 2:08 ` Johnny Billquist
2012-01-26 13:48 ` Johnny Billquist
2012-01-26 13:46 ` Johnny Billquist
2012-01-29 1:35 ` Jerome H. Fine
2012-01-18 12:41 ` glen herrmannsfeldt
2012-01-18 13:18 ` Johnny Billquist
2012-01-18 14:28 ` glen herrmannsfeldt
2012-01-18 15:14 ` Johnny Billquist
2012-01-18 21:54 ` glen herrmannsfeldt
2012-01-18 22:32 ` Al Kossow
2012-01-19 0:22 ` Johnny Billquist
2012-01-19 1:30 ` glen herrmannsfeldt
2012-01-19 14:32 ` Bob Koehler
2012-01-19 16:45 ` Johnny Billquist
2012-01-20 17:55 ` Bob Koehler
2012-01-20 18:38 ` Bill Gunshannon
2012-01-18 16:25 ` paramucho
2012-01-18 18:00 ` Johnny Billquist
2012-01-19 14:25 ` paramucho
2012-01-19 16:50 ` Johnny Billquist
2012-01-20 13:32 ` paramucho
2012-01-20 16:54 ` Johnny Billquist
2012-01-21 13:16 ` paramucho
2012-01-21 13:58 ` Bob Eager
2012-01-21 20:02 ` Johnny Billquist
2012-01-22 11:59 ` Johnny Billquist
2012-01-22 14:03 ` paramucho
2012-01-22 16:15 ` Johnny Billquist
2012-01-23 4:14 ` paramucho
2012-01-18 13:20 ` Bob Eager
2012-01-19 14:29 ` Bob Koehler
2012-01-21 12:44 ` Tim Shoppa
2012-01-21 13:50 ` paramucho
2012-01-22 16:56 ` Tim Shoppa
2012-01-22 18:11 ` glen herrmannsfeldt
2012-01-23 3:52 ` paramucho
2012-01-21 14:25 ` glen herrmannsfeldt
2012-01-21 16:46 ` Bob Eager
2012-01-25 22:12 ` Tim Shoppa
2012-01-26 3:22 ` Jerome H. Fine
2012-01-26 13:46 ` paramucho
2012-01-29 1:34 ` Jerome H. Fine
2012-01-29 15:46 ` paramucho
2012-02-01 3:53 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
2012-02-01 11:48 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
2012-02-01 14:43 ` stan
2012-02-01 16:37 ` paramucho
2012-02-01 18:05 ` stan
2012-02-02 2:24 ` Jerome H. Fine
2012-02-02 0:14 ` Johnny Billquist
2012-02-02 2:25 ` Jerome H. Fine
2012-02-02 9:29 ` Johnny Billquist
2012-02-02 18:52 ` glen herrmannsfeldt
2012-02-03 0:12 ` Johnny Billquist
2012-02-03 4:07 ` Jerome H. Fine
2012-02-03 14:15 ` Johnny Billquist
2012-02-03 15:00 ` paramucho
2012-02-02 13:31 ` paramucho
2012-02-02 19:07 ` glen herrmannsfeldt
2012-02-03 0:16 ` Johnny Billquist
2012-02-03 4:23 ` glen herrmannsfeldt
2012-02-03 12:01 ` Johnny Billquist
2012-02-03 15:36 ` Joe Oswald
2012-02-07 10:46 ` Johnny Billquist
2012-02-03 4:29 ` Jerome H. Fine
2012-02-03 12:50 ` Bill Gunshannon
2012-02-04 8:42 ` Charles Richmond
2012-02-04 13:38 ` paramucho
2012-02-04 16:03 ` Bill Gunshannon
2012-02-04 16:39 ` paramucho
2012-02-03 10:48 ` paramucho
2012-02-03 11:24 ` Johnny Billquist
2012-02-04 17:06 ` paramucho
2012-02-04 18:22 ` paramucho
2012-02-04 18:55 ` Johnny Billquist
2012-02-04 19:13 ` Bill Gunshannon
2012-02-05 13:28 ` Johnny Billquist
2012-02-05 18:15 ` glen herrmannsfeldt
2012-02-04 18:51 ` Johnny Billquist
2012-02-04 23:09 ` glen herrmannsfeldt
2012-02-05 14:01 ` paramucho
2012-02-05 15:31 ` Johnny Billquist
2012-02-06 13:50 ` paramucho
2012-02-06 14:45 ` Johnny Billquist
2012-02-06 14:58 ` paramucho
2012-02-06 16:25 ` Johnny Billquist
2012-02-05 14:27 ` Johnny Billquist
2012-02-05 13:57 ` paramucho
2012-02-05 15:44 ` Johnny Billquist
2012-02-06 13:51 ` paramucho
2012-02-06 14:56 ` Johnny Billquist
2012-02-06 16:40 ` Johnny Billquist
2012-02-07 14:50 ` paramucho
2012-02-07 16:20 ` Johnny Billquist
2012-02-08 13:34 ` paramucho
2012-02-08 16:03 ` Johnny Billquist
2012-02-08 16:58 ` paramucho
2012-02-08 22:29 ` Johnny Billquist
2012-02-10 13:12 ` paramucho
2012-02-10 19:20 ` glen herrmannsfeldt
2012-02-11 13:12 ` paramucho
2012-02-11 20:06 ` glen herrmannsfeldt
2012-02-11 20:23 ` Johnny Billquist
2012-02-10 19:29 ` Johnny Billquist
2012-02-11 13:15 ` paramucho
2012-02-11 21:09 ` Johnny Billquist
2012-02-12 17:23 ` paramucho
2012-02-12 18:35 ` paramucho
2012-02-13 17:30 ` paramucho
2012-02-14 13:14 ` Johnny Billquist
2012-02-14 16:20 ` paramucho
2012-02-14 17:30 ` Johnny Billquist
2012-02-13 23:18 ` Johnny Billquist
2012-02-14 16:20 ` paramucho
2012-02-14 17:47 ` Johnny Billquist
2012-02-14 18:17 ` paramucho
2012-02-14 19:54 ` Johnny Billquist
2012-02-15 12:58 ` paramucho
2012-02-15 17:12 ` Johnny Billquist
2012-02-16 13:54 ` paramucho
2012-02-16 20:15 ` Johnny Billquist
2012-02-17 12:41 ` paramucho
2012-02-17 17:13 ` Johnny Billquist
2012-02-18 11:24 ` Johnny Billquist
2012-02-18 14:28 ` paramucho
2012-02-18 20:07 ` Johnny Billquist
2012-02-18 11:55 ` paramucho
2012-02-18 20:58 ` Johnny Billquist
2012-02-20 2:29 ` Jerome H. Fine
2012-02-20 5:54 ` paramucho
2012-02-20 17:14 ` Jerome H. Fine
2012-02-20 18:05 ` Johnny Billquist
2012-02-21 6:16 ` paramucho
2012-02-21 17:38 ` Jerome H. Fine
2012-02-21 19:31 ` Johnny Billquist
2012-02-20 5:53 ` paramucho
2012-02-20 10:28 ` Johnny Billquist
2012-02-21 3:33 ` Jerome H. Fine
2012-02-21 6:17 ` paramucho
2012-02-21 10:23 ` Johnny Billquist
2012-02-21 11:37 ` paramucho
2012-02-21 14:16 ` Johnny Billquist
2012-02-21 16:42 ` paramucho
2012-02-21 19:43 ` Johnny Billquist
2012-02-22 12:21 ` paramucho
2012-02-22 14:12 ` paramucho
2012-02-22 15:26 ` Johnny Billquist
2012-02-22 14:33 ` paramucho
2012-02-22 15:53 ` Johnny Billquist [this message]
2012-02-22 16:48 ` paramucho
2012-02-22 21:17 ` Johnny Billquist
2012-02-23 12:42 ` paramucho
2012-02-23 13:51 ` paramucho
2012-02-23 15:17 ` Johnny Billquist
2012-02-20 2:22 ` Jerome H. Fine
2012-02-20 6:07 ` paramucho
2012-02-21 3:29 ` Jerome H. Fine
2012-02-21 8:06 ` paramucho
2012-02-21 10:38 ` Johnny Billquist
2012-02-21 11:54 ` paramucho
2012-02-21 14:20 ` Johnny Billquist
2012-02-21 15:13 ` paramucho
2012-02-21 15:20 ` Johnny Billquist
2012-02-22 2:51 ` Jerome H. Fine
2012-02-22 6:37 ` paramucho
2012-01-18 11:20 ` Johnny Billquist
2012-01-26 3:21 ` Jerome H. Fine
2012-01-26 14:12 ` Johnny Billquist
2012-01-26 15:26 ` paramucho
2012-01-29 1:41 ` Jerome H. Fine
2012-01-29 2:04 ` Johnny Billquist
2012-01-29 2:31 ` Johnny Billquist
2012-01-29 1:39 ` Jerome H. Fine
2012-01-29 1:45 ` Johnny Billquist
2012-01-30 2:21 ` Bob Supnik
2012-01-31 7:14 ` paramucho
2012-01-31 9:42 ` Johnny Billquist
2012-01-31 14:24 ` Bill Gunshannon
2012-01-31 20:17 ` Johnny Billquist
2012-01-31 21:39 ` Bill Gunshannon
2012-01-31 23:43 ` glen herrmannsfeldt
2012-02-01 3:56 ` Jerome H. Fine
2012-02-01 11:53 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
2012-02-02 0:20 ` Johnny Billquist
2012-02-02 2:22 ` Jerome H. Fine
2012-02-01 12:14 ` Johnny Billquist
2012-02-01 16:27 ` glen herrmannsfeldt
2012-02-01 5:28 ` Charles Richmond
2012-02-01 11:54 ` Johnny Billquist
2012-02-01 3:55 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
2012-02-01 12:03 ` Johnny Billquist
2012-02-01 3:54 ` Jerome H. Fine
2012-02-01 12:09 ` Johnny Billquist
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox