From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.135.231 with SMTP id pv7mr6537383pbb.8.1329482519229; Fri, 17 Feb 2012 04:41:59 -0800 (PST) Path: wr5ni35685pbc.0!nntp.google.com!news2.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: Fri, 17 Feb 2012 12:41:20 GMT Organization: Aioe.org NNTP Server Message-ID: <4f3f4ae9.40953632@nntp.aioe.org> References: <4f396a03.27713593@nntp.aioe.org> <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> 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 Thu, 16 Feb 2012 21:15:55 +0100, Johnny Billquist wrote: >> The RT-11 CSI (Command String Interpreter) was originally located in >> the USR. These days, in multi-tasking RT-11, initial CSI processing is >> handled outside the USR. Programs don't have to queue for command >> processing. > >Looking at the source, it would appear that anyone calling anything >related to USR will lock everything else out from calling USR. I can see >CSI in there, but it might be that some additional trickery is located >somewhere. 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). >But it's way more locking things out than RSX ever does. That's confusing the "ACP" with the system. > Not to mention >that a process doing a call to open or create a file actually is not >blocked in RSX. It can continue running happily on for ever before that >call completes. I don't recall anyone *ever* requesting an asynchronous USR under RT-11. It's just not functionality which is needed most of the time. When I have needed it, there have been workarounds. In one instance I was able to keep the continuous activity going in chained ASTs. In another case I used two tasks. That was a long time ago. The RT-11 approach to ACP operations is more like VMS or Windows. 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. >> RT-11 uses IPL for hardware synchonisation in just the same way that >> RSX does. The fork routine is a good example. Here's the RSX code. >> >> $FORK0::MOV (SP)+,-(R4) ;SET FORK PC >> CLR -(R4) ;CLEAR LINK TO NEXT FORK BLOCK >> MFPS -(SP) ;SAVE CURRENT PROCESSOR PRIORITY >> MTPS #PR7 ;;;LOCK OUT INTERRUPTS >> MOV R4,@$FRKHD+2 ;;;LINK NEW ENTRY TO OLD LAST >> MOV R4,$FRKHD+2 ;;;SET ADDRESS OF NEW LAST >> MTPS (SP)+ ;;;RESTORE PROCESSOR PRIORITY > >The fork routine does not run with raised IPL. It's only the >enquing/dequeing of the fork block that is protected by the IPL, just >like I said. 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. > And that is also the part that have to have even more >protection if you have an MP system, since even IPL will not protect you >enough. I suspect you looked at 11M and not MP again here, right? >(Or else a rather old version of RSX.) I have the sources off an 3.x distribution of RSX-11M that I found on the web. I guess they were provided for SYSGEN. They're incomplete. In particular, I don't have the FCS code. >> And RT-11 implements some queue operations by blocking IPL briefly: >> >> MARKTM::TST (R5)+ ;Point to avail header >> SPL 7 ;Get element at PRIO 7 >> MOV @R5,R3 ;;; Get element >> BEQ 60$ ;;; None there, error >> MOV @R3,@R5 ;;; Link avail queue forward >> SPL 0 ;;; > >Yes. Exactly. And all of that kind of operations are in RSX done at the >fork level, without IPL protection, because it is not needed. It could also be handled in RT-11 by entering and then leaving system state. But, practically speaking, there is no advantage in entering system state to protect a mere three instructions since even more instructions execute at IPL 7 by entering and leaving system state. >That's what the forks are for. If RT-11 don't use forks for this, what >do RT-11 use forks for? Fork is used by drivers. ENSYS performs the same functionality for the monitor code. There are about twenty tasks performed by ENSYS in the RT-11 monitor. A later section of the MARKTM code uses ENSYS to switch to system state to insert the mark time request in the queue. The other system calls involving the timer queue switch to system state at the appropriate time. I/O code switches to system state to insert I/O elements into I/O queues and to call drivers. Extended memory is allocated and deallocated in system state. But on the matter of IPL and RSX, I note that RSX also raises IPL to complete certain tasks, in the system and in drivers. Indeed, I count about 5000! occurrences of raised IPL in the RSX sources (by searching for ";;;"). >> However, the primary tool that RT-11 uses for system (scheduler) >> synchronisation is ENSYS, which switches to system state (fork state). >> There are about twenty calls to $ENSYS in the resident monitor. > >Yes, I can see a bunch of calls to ENSYS. And as far as I can tell, >ENSYS raises the SPL to 7, before coming back to where it was invoked. >Locking out all interrupts every time. Each routine can then, when it >suitable, drop the IPL. Incorrect. ENSYS raises IPL for exactly four instructions (in the mapped monitor) and then lowers it back to zero. The mask in the final instruction (BIC (R4)+,@R4) is always "PR7" for ENSYS. ENSYS code do not choose when to drop IPL, as it has already been returned to zero. IPL is not used for the purposes you indicate. SPL 7 ;Enter here to switch into System State $INTEN::MOV R4,-(SP) ;;; Save R4 INC (PC)+ ;;; Bump level pointer INTLVL:: .WORD -1 ;;; Interrupt level MOV #,R4 ;;; R4 -> PS BIC (R5)+,@R4 ;;; Down to handler priority (In fact, if you examine the routine above, the raised IPL is completely redundant. ENSYS raises IPL to imitate the environment of a driver ISR. $INTEN is the code which lowers priority for a driver. In the case of a driver the (R5)+ mask can be used to lower IPL to device IPL). >There is also this FRK routine, which I assumed >was how you created a fork in RT-11, but I might have missed something. >The only thing calling FRK is SP.MAC, that I can see. Drivers use the driver macro .FORK to fork. It usually comes within a few instructions of .DRAST, which is the driver ISR entry point. >> The idea that RT-11 manages system synchronisation via IPL is simply >> wrong. System state and queues are used to manage synchronisation. > >I obviously find it different when looking. ENSYS uses the IPL (always >raising it to 7). Various functions like the mark time uses the IPL to >protect structures. I didn't say "synchronization", but "protection". >You can find it in lots of places, like I said. ENSYS is exactly the same as DIRSV in this regard. So, if you want to argue that ENSYS's brief use of IPL means that ENSYS is using IPL to protect structures then you have to accept that DIRSV's brief use of IPL implies that DIRSV is also using IPL to protect structures. I think that's silly. IPL is being used for a short act of hardware protection so that a process may enter system state. It is then system state which provides the protection, not IPL. Indeed, I quote from an earlier statement by yourself above: The fork routine does not run with raised IPL. It's only the enquing/dequeing of the fork block that is protected by the IPL, just like I said. Likewise, ENSYS code does not run with raised IPL. It's only the entry and exit code which is protected by IPL--the exit code has to check for pending fork routines and the like. >>> VMS is basically working the same way as RSX in most places, but adapted >>> to the different memory subsystem of the VAX. Which means you don't have >>> different address spaces for different modes. And of course, you have >>> paging, and there are some rather more synchronous services in there in >>> some places. >> >> When talking about system calls, I don't know how you can say that VMS >> works basically like RSX unless you can assert that VMS executes >> system calls, from start to finish, in system state (i.e. at fork >> level), and that's just not the case. Scheduling is not blocked for >> the duration of a VMS system calls as it is for an RSX system call. >> That's a fundamental difference. > >What system calls does not complete immediately in VMS? "I didn't say" "complete immediately" but rather "blocked for the duration." Again, "Scheduling is not blocked for the duration of a VMS system calls as it is for an RSX system call. That's a fundamental difference." >Honestly asking >since I don't know the answer myself, and cannot think of any straight >off my head. I suggest you go through the list in the on-line documentation: http://h71000.www7.hp.com/doc/73final/4527/4527pro_contents.html $CREPRC, $MOUNT and $RMSRUNDWN are candidates--but it's been a long time since I examined VMS system service sources. Some of the requests for system information could take a long time to process. >> VMS and RT-11 take the same approach. Processing of a aystem service >> does not initially alter the process scheduling state. System state is >> used selectively, usually for short periods, when synchronisation is >> required. Further, both systems are reentrant: RT-11 and VMS system >> call code can issue system calls. RSX system call code cannot. > >Are you sure you are not mixing up the kernel with DCL, RMS and >libraries in VMS here? Are you saying that VMS system services cannot themselves issue system service calls? That was my point. Regarding DCL, RMS etc, I think a case could be made for considering RMS operations such as $OPEN, $CLOSE etc for being system calls under VMS since they are the typical method by which files are opened and closed. This functionality is certainly considered to be system functionality under RT-11 and Windows. However, the point is not necessary for my argument. >> The architecture of the RUST/XM kernel was based on a mixture of VMS >> and RT-11. There were few problems harmonising the two systems because >> they are fundamentally similar. Indeed, the system dynamics of RT-11, >> RUST/XM, RSX and VMS are constructed using the same building blocks. >> The principal difference is that RSX puts a system state wrapper >> around its system calls where the other systems do not. > >VMS is very closely engineered like RSX in so many ways that I would >find it odd if you could substantiate that it works more like RT-11. But >I have been surprised before, and am ready for it again. I'm not saying that in general terms VMS is *more* like RSX than RT-11. That's simply not the case. The roots of VMS are found in RSX. I'm pointing to a particular set of behaviors where VMS dropped some the RSX behavior and did things in a way which was more like RT-11. I'm not saying that they were influenced by RT-11 either. I think they did what anyone does when they write a new system: keep the good bits and get rid of the weak points of the previous system. Ian