From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: ffc31,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidf4c4f7386e,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.213.68 with SMTP id nq4mr1141925pbc.2.1330000945594; Thu, 23 Feb 2012 04:42:25 -0800 (PST) Path: wr5ni59163pbc.0!nntp.google.com!news1.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: paramucho@hotmail.com (paramucho) Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Thu, 23 Feb 2012 12:42:09 GMT Organization: Aioe.org NNTP Server Message-ID: <4f462890.125101585@nntp.aioe.org> References: <4f41dd56.1857737@nntp.aioe.org> <4f4434a7.18816544@nntp.aioe.org> <4f43806e.38215767@nntp.aioe.org> <4f45b539.51730368@nntp.aioe.org> <4f44f914.47689786@nntp.aioe.org> <4f45130f.54341325@nntp.aioe.org> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: CmgvwL3sOlojnxUjt8znzA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 1.5/32.451 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Wed, 22 Feb 2012 22:17:23 +0100, Johnny Billquist wrote: >>> 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. On the other hand, a user mode ast could take forever to complete. In some cases that could paralyse a system. The systematic solution to the issues we've been discussing would seem to be threads. Threads provide a place to store the kernel/user context that you have been concerned about (I still don't see a theoretical problem). With threads you should be able to replace most ASTs with (asynchronous) threads which wait on events. (That's how I tend to things in Windows) Of course, the devil would be in the detail: which bits of behavior would be thread-specific and which bits would be process-wide. Under what conditions are all threads blocked (e.g. mutexes)? The answer depends on just how independent a thread is of the parent process context. There are interesting descriptions here: http://h71000.www7.hp.com/doc/72final/6493/6101pro_030.html#ast_delivery http://h71000.www7.hp.com/doc/72final/6493/6101pro_031.html#event_flags http://www.openvms.compaq.com/wizard/wiz_2637.html Which basically tells us that (1) adding something complicated to something which is already really complicated can get really, er, complicated, and, (2) to do this kind of thing properly you need to build in to the base design of a system, not try to layer it on afterwards. I wonder if the AST level hardware register is a process-wide or thread-specific value... The last internals manual available is 1991 which might be just a wee bit early for DECthreads. >>> 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? Since pretty close to the beginning. My first machine, one of the very first PDP-11/20s, had only papertape software and no documentation beyond the handbook. I mostly programmed using the switch register. It took over my life back then and that's when I got to know the PDP-11. Then I wrote a system so that I could work from the DECtapes. Later I started usng RT-11. For the next 15 to 20 years my life revolved around RT-11 and writing RT-11-compatible operating systems. You get to know a system pretty well when you reimplement it. >> 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. It may have been over-engineering. For REI the hardware just compares a bit-field in the PSL with a hardware register and triggers an interrupt when the condition holds. You're really only saving about three VMS instructions and you probably shouldn't have a large number of instances of REI in a system. Whatever. I don't know whether it was available in the other hardware implementations... >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.) Yes. >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. It goes back to the kernel (to ASTDEL.MAR I guess). It's pretty well covered by the on-line Internals document. The code has a few more sanity tests including detecting hanging asts from deleted processes. >> 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. The kernel is fully protected, except for one gaping hole that I still haven't fully fixed. It's been bugging me for thirty years. As I said, I pretty much used VMS as a design guide for RUST/XM in terms of login, accounting, protection and the privileges etc. It was a (mini) clone, as a (slightly compressed) SHOW SYSTEM shows: RUST/XM V3.5 Share on 23-Feb-2012 15:33:18.22 Uptime 0 00:00:10.16 Pid Process User Image UIC State Pri Dir. I/O CPU Mem 000000 NULL SYSTEM SHARE 000,000 COM 0 0 00:00:08.40 0 000001 KERNEL SYSTEM RUSTX 001,004 HIB 4 20 00:00:00.00 16 000002 SYSTEM SYSTEM DCL 001,004 COM 5 332 00:00:01.82 128 000003 LOGIN DCL 001,004 HIB 7 3 00:00:00.02 128 000004 TPPACP SYSTEM TPPAVM 001,004 HIB 4 8 00:00:00.00 20 000005 IAN SYSTEM (DCL) 001,004 INP 8 7 00:00:00.02 16 Ian