Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: paramucho@hotmail.com (paramucho)
Subject: Re: PDP11 Values from MFPT
Date: Sat, 21 Jan 2012 13:16:47 GMT	[thread overview]
Message-ID: <4f1cbaba.24725004@nntp.aioe.org> (raw)
In-Reply-To: jfc67p$54q$1@Iltempo.Update.UU.SE

  On Fri, 20 Jan 2012 17:54:16 +0100, Johnny Billquist
<bqt@softjar.se> wrote:

<snip>
>>>>   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	#<LIGHT$>,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	#<FJOBS!200>,-(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	#<FJOBS!200>,INTACT ;Do a complete scan
	BR	EXUSLK		;Back into LOOKFOR loop
	............

	.DSABL	LSB
\f

>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


  reply	other threads:[~2012-01-21 13:16 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 [this message]
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
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