From: Johnny Billquist <bqt@softjar.se>
Subject: Re: PDP11 Values from MFPT
Date: Wed, 22 Feb 2012 22:17:23 +0100 [thread overview]
Message-ID: <ji3m13$nit$1@Iltempo.Update.UU.SE> (raw)
In-Reply-To: <4f45130f.54341325@nntp.aioe.org>
On 2012-02-22 17.48, paramucho wrote:
> On Wed, 22 Feb 2012 16:53:33 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
>>> 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.
>
> Yes, they block asts, and that's quite horrid.
Indeed. Not fun.
> But it's not similar to what happens in RT-11 and RUST. Resource waits
> (such as getting an I/O queue element) do not block asts. The code
> example I had in the previous post was an example of that. It's quite
> different to VMS.
Yeah. VMS works a lot like RSX (have I said that before?), except that
RSX don't have resource waits. Instead you always get back to the user
program in the similar situations, and then you have a "wait for
significant event" system call that you can use to wait for a suitable
time to try again. And of course, that system call is just like all the
others - it waits in a state that is not sitting in the kernel.
> And "once again", (1) the USR is the ACP, not the system, (2) it does
> not block asts at all, (3) it doesn't wait for commands. The only
> "blocks" it has are when it's performing directory operations, but
> that's what an ACP does. Where else do you think it blocks?
Really my mistake here. Of course calls to the USR don't block ASTs. I
knew that. I don't know what I was thinking.
While I don't totally agree with the comparison with an ACP, I guess it
is a fair comparison in some ways.
> And the other main case I didn't mention are page fault waits, but
> these just repeat the page fault etc. That's logical.
Yeah. Page faults are naturally blocky. Can't really help that.
>> 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.)
>
> VMS has HIBER and SUSPEND.
Ah. I had forgotten about SUSPEND. Guess that means VMS and RSX maps
pretty much 1:1.
>> You seem to have a very good grasp of RT-11, it seems to me.
>
> It is burned into my brain...
:-)
How long have you played with it?
>>> 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.
>
> The REI instruction (Return from Exception or Interrupt) recognises a
> deliverable ast state by comparing the target PSL with a
> process-specific AST level register. It issues an ast interrupt when
> there's a deliverable ast condition. The software then sets up the ast
> environment according to the mode.
Ah. You are talking about the AST mechanism on the VAX hardware.
I should read up on it, since it's a long time since I studied it.
However, I'm surprised if the whole AST handling in VMS uses that fully.
I would expect that VMS implements ASTs the same way as in RSX, since
there is so much more information and surrounding stuff that needs to
kept track of that I can't see it being done in hardware. However, I bet
it use the hardware AST to just get the kernel to the AST handling parts
in the kernel.
(Hmm, actually, that might be what you are saying.)
I wonder exactly how the code path for an AST exit works in VMS. There
is nothing corresponding to the ASTX$ call in RSX. Instead, an AST
routine in VMS just do a RET (not even a REI). VMS obviously sets up a
call frame before getting to the AST routine, and gets back to some
common piece of code to finish the AST afterwards.
Need to think, look and read some more here. Could it be that AST exit
in VMS is really handled fully in hardware without the kernel being
involved? It might possibly be doable, but I'm not sure.
> In RT and RUST there's only one ast in progress. In VMS an inner mode
> ast can interrupt an outer mode ast. That means that a kernel mode ast
> can interrupt a user mode ast.
Yeah. Just saw that, which is nice.
> In general terms the process of delivering an ast and catching the ast
> exit are the same in RT, RUST, RSX and VMS.
I would expect so, yes.
>> 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?
>
> Only for the three system calls I mentioned: $hiber, $waitxx. It's
> actually just a subtraction of 4 back to the start of the change mode
> instruction. No other system calls are restarted--that's what I saw.
> There is no "restart system call" routine.
Right. I don't think an explicit "restart system call" routine would
make any sense. Backing up the PC is the "restart system call".
Why make it any more complicated than that?
And other type of waits might not allow ASTs while waiting.
>>>> 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.
>
> It's multi-tasking that counts. RUST is multi-user and has most of the
> protection system of VMS/RSX (UIC/SOGW, system privileges etc).
I'm thinking of things like the ability of the user program to access
kernel information, structures and flow of execution.
If normal programs in RUST are totally prevented from doing anything
malicious, even if they try, then we're talking about the same thing.
>> 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.
>
> I try to avoid the microfiche reader 'cos it just takes so long to
> find stuff. The index fiche is starting to get very blurry.
>
> I spent a lot of time reading the fiches back in the 80s. I started
> writing a VAX O/S once. I managed to boot it , but then my real life
> took over... After I closed my software company I worked as a VMS
> consultant for a while (until I got sucked into management), but I had
> a little desktop VMS system at home for many years.
>
> And this used to be my favorite reading (I found it here today):
>
> http://bitsavers.org/pdf/dec/vax/vms/training/
> EY-00014-DP_VMS_Internals_and_Data_Structures_1984.pdf
>
> There are later versions there as well.
I think I have that one as a hardcopy somewhere back in Sweden. Not with
me where I reside right now. :-(
>> 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. :-)
>
> The first RT-11 developers were ex-OS8. The V1 RT-11 sources had
> macros which mimicked PDP-8 code. The OS8 heritage has been both good
> and bad.
Like I said, I can sometimes really see similarities. But OS/8 is much
simpler in lots of ways.
OS/8 in combination with RTS-8 might be a bit like RT-11 FB, I think,
but I have not explored that much...
Johnny
next prev parent reply other threads:[~2012-02-22 21:17 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
2012-02-22 16:48 ` paramucho
2012-02-22 21:17 ` Johnny Billquist [this message]
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