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 nq4mr1429692pbc.2.1327151815634; Sat, 21 Jan 2012 05:16:55 -0800 (PST) Path: lh20ni207402pbb.0!nntp.google.com!news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!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: Sat, 21 Jan 2012 13:16:47 GMT Organization: Aioe.org NNTP Server Message-ID: <4f1cbaba.24725004@nntp.aioe.org> References: <4f12e49d$0$295$14726298@news.sunsite.dk> <4f175c07.15409279@nntp.aioe.org> <4f17edcc.11901487@nntp.aioe.org> <4f19229f.41848032@nntp.aioe.org> <4f2121a1.31333128@nntp.aioe.org> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: yPe0Vz9rK3epnEf2vEo6yg.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 Fri, 20 Jan 2012 17:54:16 +0100, Johnny Billquist wrote: >>>> From what I can see the SET CPU IDLE code was added in 2006. It >>>> applies to RSX and RSTS, but not RT-11 or Unix because they, like >>>> RUST, don't use the WAIT instruction. >>> >>> Eh... Unix definitely use WAIT. >> >> From what you write, 2.11 BSD Unix definitely uses WAIT. > >Right. > >>> Or, what version of Unix are you referring to? I'm looking at (and >>> using) 2.11BSD. I haven't really checked older versions. >> >> I'm quoting from the SimH documentation (that I've very recently found >> a reason to reread :-) where Bob Supnik says that the use SET CPU >> IDLE "will work for RSTS/E and RSX-11M+ [sic], but not for RT-11 or >> UNIX." I assume that that translates to the (correct) use of WAIT >> since SET CPU IDLE is hooked to the WAIT instruction. >> >> The sources for the earlier versions of Unix are available on the web >> if you want to find more detail about their usage, but I'm sure you >> know that :-) > >Yes. And I decided to do just that, and V7 also uses WAIT. I do not know >why Bob wrote what he did in the documentation. >I figured out the command in Simh because of just the cpu hogging when I >booted 2.11BSD, which is why I knew a little about it already. More >digging have not changed anything so far. >The most interesting tidbit so far have been your information that RT-11 >don't use WAIT, and I haven't been able to find any use of WAIT after >searching through RT-11 after you wrote that. Which in turn led me to my >curious question of what RT-11 do to display some idle pattern on the >front panel of machines that have such a thing. Still curious about that >one, and my first searching through the sources didn't find me any idle >pattern display in RT-11 at all. Here's the routine you were looking for, preceded by the quotes AntonC added when he wrote the FB monitor. Effectively it uses a counter. Below the lights routine is the patch point (..NULKJ:) where a WAIT could be patched in. However, as stated variously, the patch point was never used by the standard distributions or described. The patch point is used by a performance monitor. The alternate code is for the RT-11 emulator running under RSX, RTEM. ;+ ; "A source of innocent merriment!" ; - W.S. Gilbert, "Mikado" ; "Did nothing in particular, and did it very well" ; - W.S. Gilbert, "Iolanthe" ; "To be idle is the ultimate purpose of the busy" ; - Samuel Johnson, "The Idler" ; "I got plenty of nothin', and nothin's plenty fo' me!" ; - George and Ira Gershwin, "Porgy and Bess" ;- 30$: .IF NE LIGH$T DEC (PC)+ ;The RT-11 lights routine! LITECT: .WORD 1 BNE ..NULJ ;Not too often ADD #<512.>,LITECT ;Reset count, clear carry 40$: ROL 70$ ;Juggle the lights BNE 50$ ;Not clear yet COM 70$ ;Turn on lights, set Carry 50$: BCC 60$ ;Nothing fell off, keep moving ADD #<100>,40$ ;Reverse direction BIC #<200>,40$ ;ROL/ROR flip 60$: BIT #,CONFG2 ;Does CPU have a light register? BEQ ..NULJ ;No MOV (PC)+,@(PC)+ ;Put in lights (for 11/45) 70$: .WORD 0, SR .ENDC ;NE LIGH$T ..NULJ:: .IF EQ RTE$M ;;; WAIT ;Nothin' to do, so don't NOP ;Nothin' to do, so don't .IFF ;EQ RTE$M NOP ;Let the host do the waiting .ENDC ;EQ RTE$M NOP ;Second pad instruction .BR SCNALL ;Drop into ready job scan loop setup ............ ;+ ; SCNALL (*** RTEM-11 HOOK ***) ; The RTEM-11 bootstrap hooks this location as: ; ; MOVB #,-(SP) ; Job number on top of stack ; CALLR $IDLP ; Enter the RTEM idle loop ; ; The $IDLP routine is located in the RTEM-11 linkage ; routines. This hook allows RTEM-11 to correctly ; become idle, by waiting on the idle loop event flag. ;- SCNALL:: ;(*** RTEM-11 HOOK ***) MOVB #,INTACT ;Do a complete scan BR EXUSLK ;Back into LOOKFOR loop ............ .DSABL LSB >But on a different take - why don't you patch RT-11 to use WAIT, and >then have RUST use that to release the CPU instead of implementing a >whole new API for this? You still need to patch RT-11 to use that API, >and by using WAIT instead, you also gain the potential of all other >PDP-11 OSes also getting the benefit, without even having to modify the >OSes? There's a fundamental misunderstanding here. The two RUST operating systems I work on these days do not include any RT-11 source code. The RUST distribution kits do not include or require any RT-11 binaries. They are completely separate source and binary systems. Effectively, they are stand-alone operating systems which happen to support RT-11 programs with compatible environments, EMTs, disk structures and the like. The RUST/SJ monitor and RUST/XM kernel themselves are completely separate source streams as well, so I've implemented most of the things we've been talking about (interrupt entry, fork, idle, etc, etc) two or more times. Now, back in the eighties, when I had a company, the systems we supplied did rely on RT-11 device drivers and utilities, but even then they ran with completely separate operating system sources and kernels. About a decade ago I began the slow process of reimplementing the drivers and utilities to remove all reliance on RT-11. Most of the major utilities and drivers have been completed. The significant exceptions are MACRO, LINK, LIBR, SYSMAC.SML so it's necessary to copy those components to a RUST system if you want to do development. I've been planning to do MACRO, LINK and LIBR for years, but other stuff keeps happening. In fact, the one thing I really don't want to reimplement is SYSMAC.SML. It's a can of worms inside a can of worms. Some of the reimplemented utilities are missing this or that function or need a bit more work. Most of them also have additional functionality, and there are additional utilities and drivers. My KED implementation is a bit weak in the I/O department. I haven't done any of the magtape drivers ('cos I don't have physical magtapes). When I talk about DEC RT-11 in these threads I'm in fact going back to my very early days when I lived and breathed RT-11. But I haven't been a daily RT-11 user since the early eighties because all my development etc took place on my own systems (with our own network software etc). But for over a decade then my daily task consisted of reimplementing or extending the RT-11 architecture, or, in the case of RUST/XM, reimplementing RT-11 on a PDP-11 with an kernel architecture based (loosely) on VMS. Some of the RT-11 architecture is shared with RSX, such interrupts and forks, and some of it simply copies RSX, such as the PLAS API. Now to the actual point you raise. The little API I mentioned does quite a few other tasks as well. It was a matter of minutes adding the CPU idle code, and that was the primary reason I chose to use the API for that task one evening when I got sick of the CPU hogging behavior. RT-11 programs have an unfortunate habit of sitting in .TTYIN loops where they just loop looking to see if a character has been typed. So, in many cases an RT-11 system is simply never idle. This problem can't be solved for RUST/SJ, the single-user system, because of space, and in fact the idle routine is called from the terminal input path on RUST/SJ. It's a hack. On RUST/XM it's a different story. To obtain effective multi-user performance RUST/XM examines the .TTYIN behavior of processes, detects looping apps, and puts them in an event-wait state when detected (users and programs can override the behavior). It would be quite possible to add WAIT to RUST/XM as the default NULL process (so to speak) and I'll put it on my TODO list. I'll probably only switch that code on if I detected an emulator--and someone else's emulator at that since my V11 emulator ignores WAIT instructions and I have no plans to improve it (indeed, I'm thinking about replacing the guts of my emulator with SimH--it's got so much more functionality and it's fast enough these days). Ian