From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: d180ab3bd8,5cdb0c1dbaceb85b X-Google-Attributes: gidd180ab3bd8,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.204.156.135 with SMTP id x7mr1069081bkw.2.1329598785187; Sat, 18 Feb 2012 12:59:45 -0800 (PST) Path: t13ni43173bkb.0!nntp.google.com!news1.google.com!eweka.nl!lightspeed.eweka.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.stack.nl!newsfeed.Update.UU.SE!news.Update.UU.SE!not-for-mail From: Johnny Billquist Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Sat, 18 Feb 2012 21:58:28 +0100 Organization: Update Computer Club Message-ID: References: <4f37ec05.63303162@nntp.aioe.org> <4f3a87d9.14307647@nntp.aioe.org> <4f3ca414.21534066@nntp.aioe.org> <4f3dab02.35785786@nntp.aioe.org> <4f3d06f0.6951576@nntp.aioe.org> <4f3f4ae9.40953632@nntp.aioe.org> <4f3f6194.19510701@nntp.aioe.org> NNTP-Posting-Host: 178-83-31-172.dynamic.hispeed.ch Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1329598708 28414 178.83.31.172 (18 Feb 2012 20:58:28 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Sat, 18 Feb 2012 20:58:28 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 In-Reply-To: <4f3f6194.19510701@nntp.aioe.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-02-18 12:55, paramucho wrote: > On Fri, 17 Feb 2012 18:13:44 +0100, Johnny Billquist > wrote: > > >>> The opening section of code is more or less duplicated in RMONFB.MAC >>> (later RMON.MAC). Look for the "C$SIGN:". The code in the USR is only >>> used for the single-threaded single-user RT-11/SJ (and later for >>> RT-11/SB). >> >> I was looking in RMONFB.MAC. >> C$SIGN almost immediately do an EMT 374, which ends up in USR. >> What am I missing? > > .CSIGEN (C$SIGN:) purges all channels before prompting for a new > command and opening files. Thus, it begins with a loop to purge > channels. Control is passed to the USR only if a *new* file is open on > a "special device", such as magtape or cassette. (In fact, "special > devices" have their own built-in ACPs and can be called without using > the USR, but that's a complication I've been avoiding introducing > here.) > > Note, .CSISPC (C$SISP:) does not purge or open files. Must be looking at different versions of something, this is C$SIGN: from RMONFB: .SBTTL .CSIGEN AND .CSISPC - CSI CALL EMTS .ENABL LSB C$SIGN: CLR R4 MOV (PC)+,R0 .BYTE 8.,3 10$: EMT 374 DECB R0 BGE 10$ BR 11$ C$SISP: MOV #100000,R4 11$: BIS #CSIRN$,@R5 MOV #CSI.$,R2 MOVB JOBNUM,R3 BEQ 15$ BIS #GTLIN$,@#JSW 15$: TST @R1 BEQ 20$ JMP EMTUSR 20$: INCB R4 CMPB USROWN,R3 BNE 30$ INCB USRLVL CSIERR::CLRB R4 BISB USRLVL,R4 CALL RIDUSR 30$: If I remember right, this is from RT-11 V5.5, so it might be that things got changed after that? > > >> I think we should split things up if we are to continue this discussion. >> RSX and RT-11 works very differently, so it don't help if you try using >> RSX concepts and terms to describe RT-11 behavior. >> RT-11 have file operations as a part of USR. There is only one USR, and >> all processes wanting to do any file operations have to go through USR, >> which is protected so that only a single process can enter it at a time. >> Correct me if I'm wrong here. > > The USR is only responsible for directory-oriented operations. Read > and Write operations happen outside the USR. Ok. Gotcha. Same in RSX actually. Once the file have been opened, the ACP does not necessarily need to be invoked for reads/writes. >> RSX is doing things in a very different way. We can talk about the RSX >> way as well, separately, if you want to. > > Except for the asynchronous opportunities, an RSX system with a single > F11ACP is pretty much equivalent to RT-11 with its single USR is it > not? No, since even a single F11ACP can service several disks, and does not block access to one disk just because an operation is currently under way on another disk. >>> The RT-11 approach to ACP operations is more like VMS or Windows. >> >> Nonsense. VMS works exactly the same way as RSX in this aspect. You have >> one or more ACPs in VMS, just like RSX. And you queue I/O operations to >> it, and your program can continue doing whatever while the I/O operation >> is being completed. This I *know*. > > And I know you know. I didn't say that VMS had done away with the QIO > interface to the ACPs--that would be ridiculous. What I meant was that > most VMS programmers use the $OPEN, %CLOSE interface. Many wouldn't > have any knowledge of the ACP QIO interface. Right. Almost all use the RMS calls, which in turn do the QIOs for them. Exactly like in RSX. The main difference being that RMS is always present in a separate part of memory, and don't need to be linked in as in RSX. But you can actually use the interface all the way through RMS asynchronously. RMS do not need to do things in a synchronous way. It's just the default. You set a bit in the FAB to make your calls asynchronous instead. >>> The need to open files asynchronously occurs fairly rarely. All >>> systems have their little advantages here and there. In RUST/XM each >>> process effectively has it's own private generic ACP. Multiple >>> processes can perform overlapping file opens on the same volume. >>> Processes only queue when they want to modify the directory structure >>> of the same volume. Now, that's probably something you can't do on >>> RSX, but I wouldn't use the difference to characterize RSX as doing >>> "way more locking than" RUST/XM does. It's a nice feature. I seem to >>> recall that later versions of VMS did something similar. >> >> For pure read-only operations it is an optimization you might want to >> do, but it is not possible in either VMS or RSX. >> When you open a file in those operating systems, you can specify if >> others are allowed to open the file or not, and thus you must have a >> clear concept of one process opening the file completely before another >> can, so you can enforce protections like that. >> So it is doing more locking that RUST/XM does. And it provides more >> services, by doing this. > > I could extend the functionality to handle access control fairly > easily. It would just be a matter of having a queue for open > operations with potential sharing conflicts. Right. But then you need to figure out if an open request is for a file that is already open or not, and then do two different paths, depending on that. And the paths are pretty much the same, except without the shared access checks on one of them. And if you have lots of open files, then the checking can become a noticeable part of the operation. But yes, there are possibly some optimization that could be done here. I have not looked deep enough at it to tell for sure if they would be enough to be worth the code. >>> That's clear--I quote from above: >>> >>> By "system state" I mean basically the same state as "fork state"... >>> System state runs at IPL 0. $DIRSV switches to system state. >> >> Curious question: what do you call the state an interrupt handler gets >> in to? > > Interrupt State kernel > Fork state/System state kernel > AST state kernel user > Process state kernel user Ok. Good to know so that I can (hopefully) adapt my terminology here. >> And please note that nothing after this point in RSX ever needs to raise >> the IPL. > > But that's a bad thing because it's put everything into fork/system > and that increases AST and scheduling latencies. RT-11 and VMS can > perform most of their system call tasks with no impact at all on AST > delivery or scheduling latencies. That's the real issue we're talking > about. Instead potentially affecting interrupt latencies... :-) As you are not expected to spend large amounts of time in forks in RSX, this is not really a big issue. But yes, forks do affect AST delivery and task execution (let's take the big picture here, scheduling is just a subset of task execution, which is really what is being delayed by forks). But since you only have one CPU, it can either be running a user process, or run the fork. The fork needs to be completed sooner or later, especially since the device related to the fork cannot issue another fork until the previous is completed. Is there a point in delaying the fork? > (And, of course, the system/fork state exit path must also raise IPL, > but you know that.) Yes. Since at the completion of a fork process you need to check if there are any more fork processes to be run, and that means checking the structure that must be protected. >> FCS is not a part of the kernel. It's a user level library. >> The FCS sources are in [50,10], but I'm not sure how interesting you'll >> find them. But they should be there unless your distribution was mangled. > > Well, I just take what I can find on-line. I don't recall [50,10], and > I went through what I have a couple of times. > I would find FCS interesting. I've always wanted to do something to > FCS so that I could process stream_xx files and not have to convert > everything to RSX text format. In particular, I'd like to patch the > RSX Pro MACRO app. Ah. Yes, that would probably not be too hard. However, unless the MACRO app is linked with a shared library, you then need to relink it again, with your fixed FCS library. Do the PRO software comes with the object files? I've once or twice thought about stream format files in RSX as well. RMS supports them, but FCS does not. >> RT-11 is (in my eyes) to convoluted and tricky to follow. You have to >> read the code many times, and go back and forth, and trying to remember >> exactly what state you are in at every point, to understand what it is >> doing. > > It's like a jigsaw puzzle. Space was always tight--programmers would > be given the job of "saving two more words". RMONFB.MAC and RMON.MAC > received a lot of dedicated attention--nothing was ever easy. Indeed. RSX-11M was also designed for a minimal footprint, but done with another approach. However, I usually prefer fooling around in M+, where space is generous in comparison. 11M can live in pretty small machines, however. And without an MMU. >> Hmm, if I read things right, RT-11 work the same way as Unix, in that >> you are running with the user context, while in the kernel, part of the >> time. > > And like VMS. I had not realized that VMS had strayed like that. If it really do have user processes running in their own context while in kernel mode. Which is not where RMS and DCL routines live... >> So, sometimes you protect shared data through raising the IPL, sometimes >> through mutexes > > My original list had RT-11, RUST/XM and VMS. It's RUST/XM and VMS > which use mutexes. I seem to remember seeing something that looked like mutexes in RT-11 as well, but I might have been confused. Hmm, I think I was thinking of the "blocking conditions" bits you have for jobs in RT-11. They smelled somewhat like mutexes in RT-11, but I bet I read them wrong. >> and sometimes through going through ENSYS. ENSYS will >> protect your code from interrupt handles which create forks to do work. >> IPL (obviously) protects you from even getting interrupts (and thus also >> protects you against interrupt handlers), while mutexes basically >> protect you against other processes. >> >> But I'm not trying to argue that SPL would be more expensive than >> creating a fork. But I am arguing that having your priority changed all >> over the place makes it harder if you write code to make sure it is >> properly protected, since you need to know where and how you come into >> that piece of code so you can protect it right, and also not >> accidentally drop the IPL at the wrong place. > > I was looking at the VMS fiches tonight and noticed that VMS uses > SETIPL all over the place, using all the different IPL levels. > > RT-11 shares the the ";;;" convention with RSX, but also has a ";;" > convention for code in system state. In fact, RT-11 often raises IPL > to protect a queue header or whatever even though it's in system state > and not, theoretically, necessary. I can only guess at the rationale, > but my own experience with RT-11 uses was pretty extensive. New users > would often start writing RT-11 realtime code within a day or so of > reading the manuals. They'd forget to save registers and do all kinds > of horrible things, so system code tended to get a bit paranoid. :-) RSX also use the ;; convention for code running in system state. It's even suggested in appendix E of the Macro-11 Language reference manual. > But regarding the management issue, it's remarkable that over it's > long development period the RT-11 monitor was built from only a half > dozen source modules with almost all the critical code concentrated > into two or three modules. Accidents were rare. Impressive. But I guess discipline was necessary, or else it would never have survived. Just like all OSes. >> DCL and RMS are not on the same level as the kernel. However, it is >> sometimes hard to tell the difference when looking in from the outside. >> A service like $QIO cannot make another system call, that is my claim. > > These are some of the calls I looked at tonight. > > SYSASSIGN: $ASSIGN, $QIO, $DEASSIGN > SYSSETTIM: $ASSIGN, $QIO, $DEASSIGN > SYSSNDJBC: $PARSE, $SEARCH, > $ASSIGN, $QIO, $DEASSIGN > SYSSNDMSG: $ASSIGN, $QIO, $DEASSIGN > > (but it's still a separate issue) Yeah, drifting into VMS questions. How did we get that low? :-) (I can't find anything about any SYSASSIGN, by the way. SYS$ASSIGN is the $ASSIGN you have, which is the same as ALUN$ in RSX, but I'm not clear what SYSASSIGN is.) Johnny -- Johnny Billquist || "I'm on a bus || on a psychedelic trip email: bqt@softjar.se || Reading murder books pdp is alive! || tryin' to stay hip" - B. Idol