* PDP11 Values from MFPT
@ 2012-01-15 14:37 Jerome H. Fine
2012-01-18 6:03 ` paramucho
` (2 more replies)
0 siblings, 3 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-15 14:37 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 2397 bytes --]
I have an interesting hardware question.
I have been looking at the results for the program RESORC.SAV in RT-11
with respect the MFPT instruction. When the J11 chip is used, the value
is 5 and the Maintenance Register at 177750 seems to determine what the
rest of the actual hardware supports.
I thought it would also be helpful for the user to know if an emulator
is being
used, either software or hardware, or if perhaps some other 3rd party
hardware
CPU. I would probably target the various 3rd party boards as far as
hardware
is concerned (such as QED and Mentec). For software emulators, I would
suggest that only the high end PDP-11 processors be supported (the DEC
CPUs which support the MFPT instruction) in order to keep things simple,
at least initially.
An incomplete list of software emulators is:
SIMH
Ersatz-11
An incomplete list of hardware boards is:
QED - more than 1?
Mentec - at least 3
and I can remember at least 2 others, but not the company names.
Right now the Logical Co. has a combined emulator called a
PDQ-1000 board which actually plugs into a Qbus which takes
only 4 slots, but includes CPU, memory and many controllers.
Thus far, the high order byte of the MFPT instruction always seems
to be zero and is currently ignored by the RESORC.SAV program.
Under SIMH and Ersatz-11, it would be trivial to use the high order
byte of the MFPT instruction to signify which software emulator is
being used.
Can anyone who has a DEC (or non-DEC) PDP-11 system easily
available determine the actual value returned by the MFPT instruction?
As far as I know:
MFPT Value Hardware
1 PDP-11/44
3 PDP-11/24 (should be 2)
3 PDP-11/23
4 SBC-11/21
5 All J11 chips including 11/73, 11/83, 11/93
I assume that it would be extremely difficult, probably not worth the
effort, to modify the high order byte of the MFPT instruction at this
point for the 3rd party PDP-11 CPU boards, such as from Mentec.
Can anyone comment on this assumption? Might there be another
way for hardware to the tell a user which 3rd party board is being
used as a PDP-11?
The other possibility is to use the Maintenance Register at 177750,
although I suspect that there might not be any more bit available.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 3569 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
` (3 more replies)
2012-01-18 11:20 ` Johnny Billquist
2012-01-30 2:21 ` Bob Supnik
2 siblings, 4 replies; 222+ messages in thread
From: paramucho @ 2012-01-18 6:03 UTC (permalink / raw)
On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
> I have an interesting hardware question.
>
>I have been looking at the results for the program RESORC.SAV in RT-11
>with respect the MFPT instruction. When the J11 chip is used, the value
>is 5 and the Maintenance Register at 177750 seems to determine what the
>rest of the actual hardware supports.
>
>I thought it would also be helpful for the user to know if an emulator
>is being
>used, either software or hardware, or if perhaps some other 3rd party
>hardware
>CPU. I would probably target the various 3rd party boards as far as
>hardware
>is concerned (such as QED and Mentec). For software emulators, I would
>suggest that only the high end PDP-11 processors be supported (the DEC
>CPUs which support the MFPT instruction) in order to keep things simple,
>at least initially.
<snip>
Modifying the MFPT instruction is not the right way to go. CPU
software detection is a delicate business and that process should not
be interfered with directly.
In any case, an emulator is not equivalent to a processor type since
SimH and E11 support a range of PDP-11 CPUs.
Some CPU software detection is handled by examining CPU behavior. The
same process can be used to detect an emulator and to determine which
emulator is being used.
I currently use some of the behavior of the MMU SR0 and SR1 to detect
emulators in RUST. Clearly, these tests only work when E11 and SIMH
are emulating a machine with MMU, but that's their default state and
there's not much point running RUST in other configurations. Here's
some of the code:
bt$emu: call tr$cat ; capture traps
... ; skip V11 checks
mov #m$msr0,r0 ; emulator check
mov #m$msr1,r1 ;
tst (r1) ; got MMU with SR1 etc?
bcs 40$ ; nope
clr (r0)+ ; clear SR0 with increment
bis #160000,-(r0) ; overwrite and freeze
cmpb (r1),#27 ; SIMH magic number
bne 10$ ; not SIMH
btwar$ <Emulator detected: SIMH>;
br 20$ ;
;
10$: mov #340,(r0) ; SR0 = 340
cmpb (r0),#140 ; E11 magic number
bne 30$ ; not E11
btwar$ <Emulator detected: E11>; (misses some read-only bits)
;
20$: inc b$temu ; is emulator
;
30$: clr (r0) ; make them all clean again
clr (r1) ;
40$: call tr$res ; restore traps
return
There is more code which checks for my V11 emulator. That check is
done with a hacked IOT instruction.
The reason I need detection is because emulators lack standard
terminal output behavior which I use during startup to detect the
clock rate of a PDP-11 (I count the number of null characters output
to the console terminal per clock tick and use a table to determine
both the clock rate and the terminal rate). The test doesn't work on
E11, SIMH or V11.
In fact, the V11 emulator has a little API which is used to pass
information between the emulator and the system. It's used to
relinquish control so that the emulator doesn't hog all the CPU time
and for various other functions. It would be great if there was a
common API for PDP-11 emulators for this kind of thing, but I'm not
sure the motivation is there for the effort involved.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-15 14:37 PDP11 Values from MFPT Jerome H. Fine
2012-01-18 6:03 ` paramucho
@ 2012-01-18 11:20 ` Johnny Billquist
2012-01-26 3:21 ` Jerome H. Fine
2012-01-30 2:21 ` Bob Supnik
2 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-18 11:20 UTC (permalink / raw)
I'm not entirely sure what your question is, Jerome...
But I'll make some comments anyway.
On 2012-01-15 15:37, Jerome H. Fine wrote:
> I have an interesting hardware question.
>
> I have been looking at the results for the program RESORC.SAV in RT-11
> with respect the MFPT instruction. When the J11 chip is used, the value
> is 5 and the Maintenance Register at 177750 seems to determine what the
> rest of the actual hardware supports.
Correct.
> I thought it would also be helpful for the user to know if an emulator
> is being
> used, either software or hardware, or if perhaps some other 3rd party
> hardware
> CPU. I would probably target the various 3rd party boards as far as hardware
> is concerned (such as QED and Mentec). For software emulators, I would
> suggest that only the high end PDP-11 processors be supported (the DEC
> CPUs which support the MFPT instruction) in order to keep things simple,
> at least initially.
If an emulator wants to truly emulate a specific CPU, then you cannot
just go and change the behavior of the emulator, since you will break
the basic idea behind it.
As far as different implementations goes, what is the difference between
an emulator and a "real" CPU? Both are running code to implement the
PDP-11 architecture. It's just that if the emulator is running on an x86
(for example), the microcode happens to be identical to x86 assembler,
whilst the J11 (for example) have a microcode CPU which we don't know
much about, but it still executes the microcode instructions...
> An incomplete list of software emulators is:
> SIMH
> Ersatz-11
>
> An incomplete list of hardware boards is:
> QED - more than 1?
> Mentec - at least 3
> and I can remember at least 2 others, but not the company names.
You have Strobe Data, which I'm sure you'll remember now that I mention
them.
> Right now the Logical Co. has a combined emulator called a
> PDQ-1000 board which actually plugs into a Qbus which takes
> only 4 slots, but includes CPU, memory and many controllers.
Yes... And...?
> Thus far, the high order byte of the MFPT instruction always seems
> to be zero and is currently ignored by the RESORC.SAV program.
> Under SIMH and Ersatz-11, it would be trivial to use the high order
> byte of the MFPT instruction to signify which software emulator is
> being used.
Right, except then they wouldn't truthfully emulate a J11.
And basing your design on how one application in RT-11 works seems like
an extremely bad idea.
> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
> available determine the actual value returned by the MFPT instruction?
> As far as I know:
>
> MFPT Value Hardware
> 1 PDP-11/44
> 3 PDP-11/24 (should be 2)
> 3 PDP-11/23
> 4 SBC-11/21
> 5 All J11 chips including 11/73, 11/83, 11/93
That is all the values that MFPT can return. (Or rather - all the values
that were returned by any CPUs designed by DEC.)
> I assume that it would be extremely difficult, probably not worth the
> effort, to modify the high order byte of the MFPT instruction at this
> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
Some Mentec boards use a J11. You can guess what they return. For the
other boards, they also seem to pretend to be J11 CPUs, which is a bit
sad, but that can't be helped.
> Can anyone comment on this assumption? Might there be another
> way for hardware to the tell a user which 3rd party board is being
> used as a PDP-11?
Please differ between which *board* is being used, as opposed to which
CPU. MFPT will only tell you which CPU is used, not which board.
> The other possibility is to use the Maintenance Register at 177750,
> although I suspect that there might not be any more bit available.
That register is specifically designed to tell you which board you have,
as opposed to MFPT, which tells which CPU.
And yes, there are bits left.
In the mainenance register, you have 4 bits allocated to system type.
(Note, not CPU type, system type.)
0 - 11/73
1 - J11-A (M11, N11)
2 - KDJ11-B (11/73, 11/83)
3 - KXJ11 (11/73)
4 - 11/53
5 - 11/93
This I collected from the system identification code in RSX. The 0 is
not explicitly stated to be an 11/73, rather, the code checks for the
values 1-5, and if none of those, it assumes it is an 11/73. I very much
doubt any DEC boards ever used any codes above 5, although you can have
up to 15.
The CPU identification code in RSX is very useful to read on how to
identify what kind of system it is.
Essentially, it goes like this:
1) Check if the SYSID registers exist
1.1) If yes, this is an 11/70 or 11/74.
1.2) Check if high bit of PDR is usable.
1.3) If yes, this is an 11/74. If no, this is an 11/70
2) Try MFPT
2.1) If it worked, we have a basic idea of system
2.2) 1 - 11/44
2.3) 3 - Possibly 11/23B or 11/24
2.3.1) Read maintenance register
2.3.2.1) If that succeded - check if bits 4-7
2.3.2.2) If 4-7 = 0 it is an XT system. Treat as unknown system.
2.3.3) Try writing to SWR
2.3.3.1) If that fails - system is an 11/23B
2.3.3.2) If that succeeds - system is an 11/24
2.4) 5 - J11 Based machine
2.4.1) Read maintenance register, look at bits 4-7
2.4.1.1) If that fails - unknown machine
2.4.1.2) 4 - 11/53
2.4.1.3) 3 - KXJ11 based 11/73
2.4.1.4) 1 - Real J11-A?
2.4.1.4.1) Check if writing to kernel PDR7 change state of W bit of
register to written.
2.4.1.4.1.1) If yes, we have an M11
2.4.1.4.2) Try MED instruction
2.4.1.4.2.1) If it works, we have an N11
2.4.1.4.3) Unknown type of CPU
2.4.1.5) 2 - KDJ11-B type. (11/83, 11/84)
2.4.1.6) 5 - KDJ11-E-type. (11/93, 11/94) (Codenamed Thunderbird apparently)
2.4.1.7) All others are called 11/73 (But the code will actually store
model as 11/9x)
3) If MFPT fails, M+ states that system must be 11/60, 11/34, 11/45,
LSI-11, 11/04, 11/05, 11/10, 11/15, 11/20 or 11/40.
3.1) Check 11/60 MED instruction
3.1.1) If that works, it is an 11/60
3.2) Check 11/34 MFPS instruction
3.2.1) If that works, it is an 11/34
3.3) Check 11/45 PIRQ register
3.3.1) If that exist, it is an 11/45
3.4) Of the rest, RSX-11M-PLUS only works on the 11/40
Also, for the machines which both have Qbus and Unibus variants, the
code then goes on to check if the machine have a Unibus map, and if so,
changes it to the Unibus version of the CPU.
All with the reservation that I might have missed something, written
something down wrong in my transcribing the code into the rules above,
and that this is obviously not enough to actually implement it, since
the details for some of these steps are rather intricate in actual
execution.
Anyway. If you have something that intends to implement a J11, it should
do the same thing a J11 does, which means MFPT should return 5. Anything
else is bad.
The maintenance register is a possible place to put something else in,
if you just want to identify your actual system differently, but once
more, if you really want to emulate an existing system, you cannot touch
that register either.
If you want some "foolproof" way of detecting that you are inside an
emulated machine, I'd say that adding a new instruction from the unused
opcodes is probably a better idea. I wouldn't expect anything to
actually try using an undefined opcode anyway, so no existing code
should be hurt by it. And your "new" code will also work on real
machines, in that you will instead get a trap if you try that instruction.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 6:03 ` paramucho
@ 2012-01-18 11:28 ` Johnny Billquist
2012-01-18 13:05 ` glen herrmannsfeldt
2012-01-18 16:02 ` paramucho
2012-01-18 12:41 ` glen herrmannsfeldt
` (2 subsequent siblings)
3 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-18 11:28 UTC (permalink / raw)
On 2012-01-18 07:03, paramucho wrote:
> On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
> <everyone@nospam.com> wrote:
>
>> I have an interesting hardware question.
>>
>> I have been looking at the results for the program RESORC.SAV in RT-11
>> with respect the MFPT instruction. When the J11 chip is used, the value
>> is 5 and the Maintenance Register at 177750 seems to determine what the
>> rest of the actual hardware supports.
>>
>> I thought it would also be helpful for the user to know if an emulator
>> is being
>> used, either software or hardware, or if perhaps some other 3rd party
>> hardware
>> CPU. I would probably target the various 3rd party boards as far as
>> hardware
>> is concerned (such as QED and Mentec). For software emulators, I would
>> suggest that only the high end PDP-11 processors be supported (the DEC
>> CPUs which support the MFPT instruction) in order to keep things simple,
>> at least initially.
> <snip>
>
> Modifying the MFPT instruction is not the right way to go. CPU
> software detection is a delicate business and that process should not
> be interfered with directly.
Totally agree.
> In any case, an emulator is not equivalent to a processor type since
> SimH and E11 support a range of PDP-11 CPUs.
Also right. And each CPU behaves differently, and the emulator needs to
follow that, or it is broken.
> Some CPU software detection is handled by examining CPU behavior. The
> same process can be used to detect an emulator and to determine which
> emulator is being used.
Right. I just posted an outline of how RSX-11M+ detects system type.
It's a combination of available information as well as CPU behavior in
very weird and possibly not documented ways.
> The reason I need detection is because emulators lack standard
> terminal output behavior which I use during startup to detect the
> clock rate of a PDP-11 (I count the number of null characters output
> to the console terminal per clock tick and use a table to determine
> both the clock rate and the terminal rate). The test doesn't work on
> E11, SIMH or V11.
Timing in general is not a good way to detect systems, but I'm sure you
know that... :-)
You could make the code work (sortof) on emulators by removing the
dependency on the serial port. Just make a spinning loop with increments
and at the next clock interrupt check how far you got.
However, as emulators don't have a fixed speed, your speed detection
will be rather odd on those machines anyway.
> In fact, the V11 emulator has a little API which is used to pass
> information between the emulator and the system. It's used to
> relinquish control so that the emulator doesn't hog all the CPU time
> and for various other functions. It would be great if there was a
> common API for PDP-11 emulators for this kind of thing, but I'm not
> sure the motivation is there for the effort involved.
Hmm. How do you use that API? Is it to tell that the emulator isn't
doing anything extremely important, and can run with less CPU right now
and be happy, or is this just an odd way of doing a WAIT?
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 6:03 ` paramucho
2012-01-18 11:28 ` Johnny Billquist
@ 2012-01-18 12:41 ` glen herrmannsfeldt
2012-01-18 13:18 ` Johnny Billquist
2012-01-18 13:20 ` Bob Eager
2012-01-21 12:44 ` Tim Shoppa
2012-01-26 3:22 ` Jerome H. Fine
3 siblings, 2 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-18 12:41 UTC (permalink / raw)
In vmsnet.pdp-11 paramucho <paramucho@hotmail.com> wrote:
> On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
(snip)
>>I have been looking at the results for the program RESORC.SAV in RT-11
>>with respect the MFPT instruction. When the J11 chip is used, the value
>>is 5 and the Maintenance Register at 177750 seems to determine what the
>>rest of the actual hardware supports.
(snip)
> Modifying the MFPT instruction is not the right way to go. CPU
> software detection is a delicate business and that process should not
> be interfered with directly.
> In any case, an emulator is not equivalent to a processor type since
> SimH and E11 support a range of PDP-11 CPUs.
For VM/370, IBM's first try at software emulation (more or less)
of S/370, they use bits from STIDP, which stores the processor serial
number, to identify running under emulation. That is, of course, a
convention as the emulator can return any specified value.
(It also returns the processor model number which, again, can have
any value under emulation.)
In addition, there is one instruction, diagnose (with no assembler
mnemonic) that is defined to be system dependent. That instruction is
then used for communication between guest systems and CP (the emulator).
I don't know if there is anything equivalent for the PDP-11 to either
STIDP or diagnose.
> Some CPU software detection is handled by examining CPU behavior. The
> same process can be used to detect an emulator and to determine which
> emulator is being used.
(snip)
> In fact, the V11 emulator has a little API which is used to pass
> information between the emulator and the system. It's used to
> relinquish control so that the emulator doesn't hog all the CPU time
> and for various other functions.
This is one case where VM has it easy. S/370 processors don't use
an idle loop, but a wait state where they stop executing instructions.
As I understand it, when IBM leased processors, they had a usage meter
such that one would pay based on how much the processor was used.
The usage meter stops in the wait state.
> It would be great if there was a
> common API for PDP-11 emulators for this kind of thing, but I'm not
> sure the motivation is there for the effort involved.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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:23 ` Jerome H. Fine
2012-01-18 16:02 ` paramucho
1 sibling, 2 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-18 13:05 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip, someone wrote)
>>> I have been looking at the results for the program RESORC.SAV in RT-11
>>> with respect the MFPT instruction. When the J11 chip is used, the value
>>> is 5 and the Maintenance Register at 177750 seems to determine what the
>>> rest of the actual hardware supports.
(snip, someone else wrote)
>> Modifying the MFPT instruction is not the right way to go. CPU
>> software detection is a delicate business and that process should not
>> be interfered with directly.
>> In any case, an emulator is not equivalent to a processor type since
>> SimH and E11 support a range of PDP-11 CPUs.
> Also right. And each CPU behaves differently, and the emulator needs to
> follow that, or it is broken.
Or, the emulator can emulate a CPU model different from any previously
built. That usually at least happens in that the emulator runs at a
different speed than any real processor.
>> Some CPU software detection is handled by examining CPU behavior. The
>> same process can be used to detect an emulator and to determine which
>> emulator is being used.
> Right. I just posted an outline of how RSX-11M+ detects system type.
> It's a combination of available information as well as CPU behavior in
> very weird and possibly not documented ways.
I have seen the rules for detecting different x86 CPUs, from 8086 and
8088 on up. Some are pretty strange, though usually documented at least
as needed for detection.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 12:41 ` glen herrmannsfeldt
@ 2012-01-18 13:18 ` Johnny Billquist
2012-01-18 14:28 ` glen herrmannsfeldt
2012-01-18 16:25 ` paramucho
2012-01-18 13:20 ` Bob Eager
1 sibling, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-18 13:18 UTC (permalink / raw)
On 2012-01-18 13:41, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 paramucho<paramucho@hotmail.com> wrote:
>> On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
>
> (snip)
>>> I have been looking at the results for the program RESORC.SAV in RT-11
>>> with respect the MFPT instruction. When the J11 chip is used, the value
>>> is 5 and the Maintenance Register at 177750 seems to determine what the
>>> rest of the actual hardware supports.
>
> (snip)
>> Modifying the MFPT instruction is not the right way to go. CPU
>> software detection is a delicate business and that process should not
>> be interfered with directly.
>
>> In any case, an emulator is not equivalent to a processor type since
>> SimH and E11 support a range of PDP-11 CPUs.
>
> For VM/370, IBM's first try at software emulation (more or less)
> of S/370, they use bits from STIDP, which stores the processor serial
> number, to identify running under emulation. That is, of course, a
> convention as the emulator can return any specified value.
> (It also returns the processor model number which, again, can have
> any value under emulation.)
Unfortunately, the PDP-11 never had anything similar globally defined.
The PDP-11/70 is the only model I know which have such a thing, and it's
more or less unused by everything.
> In addition, there is one instruction, diagnose (with no assembler
> mnemonic) that is defined to be system dependent. That instruction is
> then used for communication between guest systems and CP (the emulator).
There are several instructions on various PDP-11 models for this. The
problem being that it is so undefined. Hard to use to identify the type
of system for that exact reason, since existing models sometimes also
might do things...
> I don't know if there is anything equivalent for the PDP-11 to either
> STIDP or diagnose.
Nothing that I would say is usable.
>> In fact, the V11 emulator has a little API which is used to pass
>> information between the emulator and the system. It's used to
>> relinquish control so that the emulator doesn't hog all the CPU time
>> and for various other functions.
>
> This is one case where VM has it easy. S/370 processors don't use
> an idle loop, but a wait state where they stop executing instructions.
So does a PDP-11 normally, which is why I wonder what this API is
expected to be used for.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 12:41 ` glen herrmannsfeldt
2012-01-18 13:18 ` Johnny Billquist
@ 2012-01-18 13:20 ` Bob Eager
2012-01-19 14:29 ` Bob Koehler
1 sibling, 1 reply; 222+ messages in thread
From: Bob Eager @ 2012-01-18 13:20 UTC (permalink / raw)
On Wed, 18 Jan 2012 12:41:06 +0000, glen herrmannsfeldt wrote:
> This is one case where VM has it easy. S/370 processors don't use an
> idle loop, but a wait state where they stop executing instructions.
>
> As I understand it, when IBM leased processors, they had a usage meter
> such that one would pay based on how much the processor was used. The
> usage meter stops in the wait state.
Isn't that true on the PDP-11, with WAIT? And with at least some x86 CPUs
and HLT?
--
Use the BIG mirror service in the UK:
http://www.mirrorservice.org
*lightning protection* - a w_tom conductor
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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 3:23 ` Jerome H. Fine
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-18 13:26 UTC (permalink / raw)
On 2012-01-18 14:05, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 Johnny Billquist<bqt@softjar.se> wrote:
>
> (snip, someone wrote)
>>>> I have been looking at the results for the program RESORC.SAV in RT-11
>>>> with respect the MFPT instruction. When the J11 chip is used, the value
>>>> is 5 and the Maintenance Register at 177750 seems to determine what the
>>>> rest of the actual hardware supports.
>
> (snip, someone else wrote)
>>> Modifying the MFPT instruction is not the right way to go. CPU
>>> software detection is a delicate business and that process should not
>>> be interfered with directly.
>
>>> In any case, an emulator is not equivalent to a processor type since
>>> SimH and E11 support a range of PDP-11 CPUs.
>
>> Also right. And each CPU behaves differently, and the emulator needs to
>> follow that, or it is broken.
>
> Or, the emulator can emulate a CPU model different from any previously
> built. That usually at least happens in that the emulator runs at a
> different speed than any real processor.
Right.
And yes, that could definitely be done, at which point I think a new
value returned by MFPT would be reasonable.
>>> Some CPU software detection is handled by examining CPU behavior. The
>>> same process can be used to detect an emulator and to determine which
>>> emulator is being used.
>
>> Right. I just posted an outline of how RSX-11M+ detects system type.
>> It's a combination of available information as well as CPU behavior in
>> very weird and possibly not documented ways.
>
> I have seen the rules for detecting different x86 CPUs, from 8086 and
> 8088 on up. Some are pretty strange, though usually documented at least
> as needed for detection.
The "problem" with the PDP-11 is that they obviously didn't anticipate
this beforehand, and so there are no straight and easy rules for
figuring it out. I wouldn't even be surprised if different DEC OSes use
different tricks to figure it out. Not sure there is a canonical
algorithm. They even use some rather undocumented (atleast to the
outside world) diagnostics instructions to help figure out what CPU is
executing.
Example, the 11/60 check in M+:
;
; TEST FOR 11/60
;
T3: MOV #60.,R4 ;;;ASSUME 11/60
CLC ;;;CLEAR CARRY
.WORD 076600 ;;;FIRST HALF OF AN 11/60 MED
;;;INSTRUCTION. IF THIS IS AN 11/60
;;;PROCESSOR, THEN THIS SUBCODE CAUSES
;;;A CPU INTERNAL REGISTER TO BE READ
;;;INTO R0. IF NOT AN 11/60, THE ILLEGAL
;;;INSTRUCTION TRAP CATCHER WILL RETURN TO
;;;THE SECOND HALF OF THE INSTRUCTION WITH
;;;THE C-BIT SET. THE 400 WILL THEN BE
;;;EXECUTED AS A:
.WORD 000400 ;;; BR .+2
;;;WHICH IS EFFECTIVELY A NOP.
BCC CPOK ;;;IF CC IT'S A 11/60
;
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 13:18 ` Johnny Billquist
@ 2012-01-18 14:28 ` glen herrmannsfeldt
2012-01-18 15:14 ` Johnny Billquist
2012-01-18 16:25 ` paramucho
1 sibling, 1 reply; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-18 14:28 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip on VM/370 and emulation)
>> In addition, there is one instruction, diagnose (with no assembler
>> mnemonic) that is defined to be system dependent. That instruction is
>> then used for communication between guest systems and CP (the emulator).
> There are several instructions on various PDP-11 models for this. The
> problem being that it is so undefined. Hard to use to identify the type
> of system for that exact reason, since existing models sometimes also
> might do things...
In the VM/370 case, you use it only after you know that you are
running under VM.
Rumors are that on real hardware you can do things like write to
memory with the wrong parity, (for testing purpose).
On machines with writable control store, it probably does that.
Other things that could really mess up a machine if you didn't
know what you were doing.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 14:28 ` glen herrmannsfeldt
@ 2012-01-18 15:14 ` Johnny Billquist
2012-01-18 21:54 ` glen herrmannsfeldt
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-18 15:14 UTC (permalink / raw)
On 2012-01-18 15:28, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 Johnny Billquist<bqt@softjar.se> wrote:
>
> (snip on VM/370 and emulation)
>>> In addition, there is one instruction, diagnose (with no assembler
>>> mnemonic) that is defined to be system dependent. That instruction is
>>> then used for communication between guest systems and CP (the emulator).
>
>> There are several instructions on various PDP-11 models for this. The
>> problem being that it is so undefined. Hard to use to identify the type
>> of system for that exact reason, since existing models sometimes also
>> might do things...
>
> In the VM/370 case, you use it only after you know that you are
> running under VM.
Ah. I misunderstood you slightly, since I thought you were still talking
about how to identify what (virtual) machine you were running on.
Once such a thing is established, there are all kind of ways you can do
communication with the outside hose. The easiest being to just have a
device for it.
> Rumors are that on real hardware you can do things like write to
> memory with the wrong parity, (for testing purpose).
You can do that on at least some PDP-11s. You can also adjust the
voltage used to write to memory to test the margins, and some other
tricks used by diagnostics. And you can force it to ignore parity and
ECC errors.
> On machines with writable control store, it probably does that.
>
> Other things that could really mess up a machine if you didn't
> know what you were doing.
Yeah, that is another interesting area, where the wrong code can totally
mess up your machine. :-)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 11:28 ` Johnny Billquist
2012-01-18 13:05 ` glen herrmannsfeldt
@ 2012-01-18 16:02 ` paramucho
2012-01-18 18:12 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-18 16:02 UTC (permalink / raw)
On Wed, 18 Jan 2012 12:28:28 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>> The reason I need detection is because emulators lack standard
>> terminal output behavior which I use during startup to detect the
>> clock rate of a PDP-11 (I count the number of null characters output
>> to the console terminal per clock tick and use a table to determine
>> both the clock rate and the terminal rate). The test doesn't work on
>> E11, SIMH or V11.
>
>Timing in general is not a good way to detect systems, but I'm sure you
>know that... :-)
"In general" is right, but in some controlled environments it does
work.
An output serial port is a fairly reliable timing device. You just
send nulls to the port and treat the interrupts as timer events. I
first used this technique when the clock on the PDP-11 I was using at
the Hannover computer show died on me a few hours before the show
started.
The test usually fails benignly. The problem with SimH is that it
outputs a space when you send a null to the terminal. I've not seen a
DEC terminal do that. The test can be disabled with a .INI file
setting. There's a couple of checks which exclude the test.
In any case I think it's great to be able to detect 50 or 60 hertz
automatically (and at the same time determine the baud rate of the
console).
>You could make the code work (sortof) on emulators by removing the
>dependency on the serial port. Just make a spinning loop with increments
>and at the next clock interrupt check how far you got.
>However, as emulators don't have a fixed speed, your speed detection
>will be rather odd on those machines anyway.
I see lots of tiny problems aiming their pointy little arrows at me
down that path.
>> In fact, the V11 emulator has a little API which is used to pass
>> information between the emulator and the system. It's used to
>> relinquish control so that the emulator doesn't hog all the CPU time
>> and for various other functions. It would be great if there was a
>> common API for PDP-11 emulators for this kind of thing, but I'm not
>> sure the motivation is there for the effort involved.
>
>Hmm. How do you use that API? Is it to tell that the emulator isn't
>doing anything extremely important, and can run with less CPU right now
>and be happy, or is this just an odd way of doing a WAIT?
The first. It's called by RUST/SJ when it's waiting for terminal
input, so that only works most of the time. It's called RUST/XM,
multi-process system, whenever it schedules the idle process, which is
much more accurate. The emulator just waits a millisecond and resumes
the RUST system. It doesn't seem to impact RUST performance and it
stops the emulator from acting as an ugly CPU hog.
The API is also used to detect the emulator, get a startup comand and
a few other tasks. It's the sort of thing which could grow and grow...
Here's the autohertz/baud check from the RUST/SJ bootstrap module.
"bnew" and "beqw" combine compare and branch instructions.
map hz.bau 2,0
map hz.htz
map hz.cnt
map hz.bbs
b$thtz: .word 0 ; 0=unknown,
bt$htz: bnew b$tv11,40$ ; VRT is 50hz
bnew b$temu,50$ ; default emulator is 60hz
beqw b$tclk,40$ ; no ticks so far, assume no
clock
btvrb$ <Check clock rate> ;
;
call bt$wai ; wait for silence
;
call hz$cnt ; count them
cmp r3,#hzmax. ; above max?
bhis 40$ ; yep
mov #h$ztab,r1 ;
mov #177777,r2 ;
10$: mov hz.cnt(r1),r0 ;
sub r3,r0 ; get the difference
bpl 20$ ;
neg r0 ;
20$: cmp r0,r2 ; this a better shot?
bhi 30$ ; nope
mov r0,r2 ; remember better
; approximation
mov r1,r4 ; select entry
30$: add #hz.bbs,r1 ; next entry
tst (r1) ; any more?
bne 10$ ; nope
mov hz.htz(r4),b$thtz ; set result
40$: return
50$: mov #60.,b$thtz ; emulator default
return
hz$cnt: mov #-2,b$ttik
clr r3 ;
20$: cmp b$ttik,#10. ; all done?
bge 40$ ; yep
cmp b$ttik,#-1 ; got first one?
bne 30$ ; nope
clr b$ttik ; yep - start counting
clr r3 ; reset counter
30$: tstb @r$mtps ; ready for another?
bpl 30$ ; nope
movb #0,@r$mtpb ; write a null
inc r3 ; count it
tst b$ttik ; waiting for first tick?
bpl 20$ ; nope
cmp r3,#400. ; got a clock?
blo 20$ ; maybe
mov #hzmax.,r3 ; no clock
40$: return
.macro hzbau$ bau
.word bau, 50., bau/5
.word bau, 60., bau/6
.endm
h$ztab: hzbau$ 3840.
hzbau$ 1920.
hzbau$ 960.
hzbau$ 480.
hzbau$ 240.
hzbau$ 120.
hzbau$ 60.
hzbau$ 30.
hzbau$ 15.
.word 0
hzmax. = 3840./5
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 13:18 ` Johnny Billquist
2012-01-18 14:28 ` glen herrmannsfeldt
@ 2012-01-18 16:25 ` paramucho
2012-01-18 18:00 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-18 16:25 UTC (permalink / raw)
On Wed, 18 Jan 2012 14:18:26 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>>> In fact, the V11 emulator has a little API which is used to pass
>>> information between the emulator and the system. It's used to
>>> relinquish control so that the emulator doesn't hog all the CPU time
>>> and for various other functions.
>>
>> This is one case where VM has it easy. S/370 processors don't use
>> an idle loop, but a wait state where they stop executing instructions.
>
>So does a PDP-11 normally, which is why I wonder what this API is
>expected to be used for.
Run RSX under SimH and then look at CPU usage and you'll see why :-)
Under SimH, RSX uses up a full CPU slot, just like RT-11 systems which
don't use the WAIT instruction.
V11 solves the problem for RUST systems, but that doesn't help other
systems.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 16:25 ` paramucho
@ 2012-01-18 18:00 ` Johnny Billquist
2012-01-19 14:25 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-18 18:00 UTC (permalink / raw)
On 2012-01-18 17:25, paramucho wrote:
> On Wed, 18 Jan 2012 14:18:26 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
>>>> In fact, the V11 emulator has a little API which is used to pass
>>>> information between the emulator and the system. It's used to
>>>> relinquish control so that the emulator doesn't hog all the CPU time
>>>> and for various other functions.
>>>
>>> This is one case where VM has it easy. S/370 processors don't use
>>> an idle loop, but a wait state where they stop executing instructions.
>>
>> So does a PDP-11 normally, which is why I wonder what this API is
>> expected to be used for.
>
> Run RSX under SimH and then look at CPU usage and you'll see why :-)
>
> Under SimH, RSX uses up a full CPU slot, just like RT-11 systems which
> don't use the WAIT instruction.
>
> V11 solves the problem for RUST systems, but that doesn't help other
> systems.
That is because you need to tell SimH to actually release the machine
when the PDP-11 executes a WAIT... :-)
In SimH: set cpu idle
otherwise, SimH will "emulate" the WAIT instruction by actually doing a
tight loop.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 16:02 ` paramucho
@ 2012-01-18 18:12 ` Johnny Billquist
2012-01-19 14:30 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-18 18:12 UTC (permalink / raw)
On 2012-01-18 17:02, paramucho wrote:
> On Wed, 18 Jan 2012 12:28:28 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>>> The reason I need detection is because emulators lack standard
>>> terminal output behavior which I use during startup to detect the
>>> clock rate of a PDP-11 (I count the number of null characters output
>>> to the console terminal per clock tick and use a table to determine
>>> both the clock rate and the terminal rate). The test doesn't work on
>>> E11, SIMH or V11.
>>
>> Timing in general is not a good way to detect systems, but I'm sure you
>> know that... :-)
>
> "In general" is right, but in some controlled environments it does
> work.
>
> An output serial port is a fairly reliable timing device. You just
> send nulls to the port and treat the interrupts as timer events. I
> first used this technique when the clock on the PDP-11 I was using at
> the Hannover computer show died on me a few hours before the show
> started.
Hum? So what do you detect? 50Hz vs. 60Hz, and the speed of the console
port. Useful, but I would think you'd like to detect more.
Also, this might be messy if someone actually use a clock source with
some other frequency...
(800Hz seems to have been somewhat popular as well).
> The test usually fails benignly. The problem with SimH is that it
> outputs a space when you send a null to the terminal. I've not seen a
> DEC terminal do that. The test can be disabled with a .INI file
> setting. There's a couple of checks which exclude the test.
Hum? First of all, SimH is running inside some terminal window, so I
would suspect that any such behavior should be blamed on that terminal
program and not Simh, unless you really are saying that if you write a 0
to the CSR, Simh really sends out a 32(10) on the port.
What terminal program, if I may ask. It sounds bad enough that I
probably want to avoid it.
Terminal output is good in a way, I agree. They do normally take some
constant time to perform, no matter what speed the CPU have. The problem
obviously being that when you go to virtual serial ports, that is no
longer true, since the serial data can be clocked out at any speed even
thought you might think it is some other, fixed speed.
> In any case I think it's great to be able to detect 50 or 60 hertz
> automatically (and at the same time determine the baud rate of the
> console).
True. Although I think the test is flawed and will only work under some
restricted circumstances. Even if they are pretty common.
>> You could make the code work (sortof) on emulators by removing the
>> dependency on the serial port. Just make a spinning loop with increments
>> and at the next clock interrupt check how far you got.
>> However, as emulators don't have a fixed speed, your speed detection
>> will be rather odd on those machines anyway.
>
> I see lots of tiny problems aiming their pointy little arrows at me
> down that path.
It is just a solution that tells you the speed of the CPU, assuming you
know the clock interrupt frequency. With emulated CPUs running on some
host, this value will actually be variable, which is messy.
And of course, this all have the problem that you might not know the
clock interrupt rate.
>>> In fact, the V11 emulator has a little API which is used to pass
>>> information between the emulator and the system. It's used to
>>> relinquish control so that the emulator doesn't hog all the CPU time
>>> and for various other functions. It would be great if there was a
>>> common API for PDP-11 emulators for this kind of thing, but I'm not
>>> sure the motivation is there for the effort involved.
>>
>> Hmm. How do you use that API? Is it to tell that the emulator isn't
>> doing anything extremely important, and can run with less CPU right now
>> and be happy, or is this just an odd way of doing a WAIT?
>
> The first. It's called by RUST/SJ when it's waiting for terminal
> input, so that only works most of the time. It's called RUST/XM,
> multi-process system, whenever it schedules the idle process, which is
> much more accurate. The emulator just waits a millisecond and resumes
> the RUST system. It doesn't seem to impact RUST performance and it
> stops the emulator from acting as an ugly CPU hog.
Ah. That is what the WAIT instruction is for. And, reading your other
post, it would appear you have drawn some odd conclusion based on the
default settings in Simh, where Simh don't actually release the CPU if
you do a WAIT.
> The API is also used to detect the emulator, get a startup comand and
> a few other tasks. It's the sort of thing which could grow and grow...
>
> Here's the autohertz/baud check from the RUST/SJ bootstrap module.
> "bnew" and "beqw" combine compare and branch instructions.
[...]
The problem being that 50 and 60 Hz are not the only two clock
frequencies you might find on a PDP-11... :-)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 15:14 ` Johnny Billquist
@ 2012-01-18 21:54 ` glen herrmannsfeldt
2012-01-18 22:32 ` Al Kossow
` (2 more replies)
0 siblings, 3 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-18 21:54 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip)
>>> There are several instructions on various PDP-11 models for this. The
>>> problem being that it is so undefined. Hard to use to identify the type
>>> of system for that exact reason, since existing models sometimes also
>>> might do things...
(then I wrote)
>> In the VM/370 case, you use it only after you know that you are
>> running under VM.
> Ah. I misunderstood you slightly, since I thought you were still talking
> about how to identify what (virtual) machine you were running on.
> Once such a thing is established, there are all kind of ways you can do
> communication with the outside hose. The easiest being to just have a
> device for it.
As I understand it, that was done in the very early days, but the
official ruling disallowed it. I suppose if it looked like a real I/O
device then it might have been allowed.
One feature that S/370 has that seems rare on other sytems is the
CTCA, Channel to Channel adaptor. It connects two systems together
such that output on one is input to the other, and vice versa.
Then, VM/370 implements virtual CTCA that allows I/O between
virtual machines, in the same way that it was allowed between
real machines.
Otherwise, all virtual machines have a virtual card reader and virtual
card punch, and one way to move data between them is to punch virtual
cards and send them to another virtual machine card reader.
It would seem that PDP-11 emulators could emulate serial lines
between emulated machines, such that one could communicate with
another. I will guess that card punches were rare on PDP-11s.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 21:54 ` glen herrmannsfeldt
@ 2012-01-18 22:32 ` Al Kossow
2012-01-19 0:22 ` Johnny Billquist
2012-01-19 14:32 ` Bob Koehler
2 siblings, 0 replies; 222+ messages in thread
From: Al Kossow @ 2012-01-18 22:32 UTC (permalink / raw)
On 1/18/12 1:54 PM, glen herrmannsfeldt wrote:
> I will guess that card punches were rare on PDP-11s.
>
Cross-coupled DR11-B or DR11-C 16 bit parallel interfaces were commonly
used to connect two machines together. Biggest problem were ground loops
if they were on two different power circuits.
They have the advantage of parallel transfers and hardware handshaking.
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
2 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-19 0:22 UTC (permalink / raw)
On 2012-01-18 22:54, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 Johnny Billquist<bqt@softjar.se> wrote:
>
> (snip)
>>>> There are several instructions on various PDP-11 models for this. The
>>>> problem being that it is so undefined. Hard to use to identify the type
>>>> of system for that exact reason, since existing models sometimes also
>>>> might do things...
>
> (then I wrote)
>>> In the VM/370 case, you use it only after you know that you are
>>> running under VM.
>
>> Ah. I misunderstood you slightly, since I thought you were still talking
>> about how to identify what (virtual) machine you were running on.
>> Once such a thing is established, there are all kind of ways you can do
>> communication with the outside hose. The easiest being to just have a
>> device for it.
>
> As I understand it, that was done in the very early days, but the
> official ruling disallowed it. I suppose if it looked like a real I/O
> device then it might have been allowed.
Why not a new I-O device? Why would it have to look like some existing
one? Are no new real I/O devices allowed to be invented either?
> One feature that S/370 has that seems rare on other sytems is the
> CTCA, Channel to Channel adaptor. It connects two systems together
> such that output on one is input to the other, and vice versa.
> Then, VM/370 implements virtual CTCA that allows I/O between
> virtual machines, in the same way that it was allowed between
> real machines.
>
> Otherwise, all virtual machines have a virtual card reader and virtual
> card punch, and one way to move data between them is to punch virtual
> cards and send them to another virtual machine card reader.
>
> It would seem that PDP-11 emulators could emulate serial lines
> between emulated machines, such that one could communicate with
> another. I will guess that card punches were rare on PDP-11s.
You can even attach two virtual ethernet interfaces to each other... ;-)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 0:22 ` Johnny Billquist
@ 2012-01-19 1:30 ` glen herrmannsfeldt
0 siblings, 0 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-19 1:30 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip on emulation)
>>> Ah. I misunderstood you slightly, since I thought you were still talking
>>> about how to identify what (virtual) machine you were running on.
>>> Once such a thing is established, there are all kind of ways you can do
>>> communication with the outside hose. The easiest being to just have a
>>> device for it.
>> As I understand it, that was done in the very early days, but the
>> official ruling disallowed it. I suppose if it looked like a real I/O
>> device then it might have been allowed.
> Why not a new I-O device? Why would it have to look like some existing
> one? Are no new real I/O devices allowed to be invented either?
I suppose, but I/O on S/370 isn't so easy as on the PDP-11.
You write a channel program, which could be just one CCW (Channel
Command Word, which is actually a doubleword), put its address
in a specified real storage location, the do SIO with the operand
giving the I/O device address. After the I/O operation, there
is an I/O interrupt indicating that it is done. (And interrupts
should be disabled, so that no other programs try to do I/O
at the same time, using the same low storage address.)
It might have been that someone wanted to simplify that, such as
have the SIO do the whole operation. It could be that was too much
of a stretch, and so diagnose was suggested instead.
(snip)
>> Otherwise, all virtual machines have a virtual card reader and virtual
>> card punch, and one way to move data between them is to punch virtual
>> cards and send them to another virtual machine card reader.
>> It would seem that PDP-11 emulators could emulate serial lines
>> between emulated machines, such that one could communicate with
>> another. I will guess that card punches were rare on PDP-11s.
> You can even attach two virtual ethernet interfaces to each other... ;-)
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 18:00 ` Johnny Billquist
@ 2012-01-19 14:25 ` paramucho
2012-01-19 16:50 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-19 14:25 UTC (permalink / raw)
On Wed, 18 Jan 2012 19:00:03 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-01-18 17:25, paramucho wrote:
>> On Wed, 18 Jan 2012 14:18:26 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>> <snip>
>>
>>>>> In fact, the V11 emulator has a little API which is used to pass
>>>>> information between the emulator and the system. It's used to
>>>>> relinquish control so that the emulator doesn't hog all the CPU time
>>>>> and for various other functions.
>>>>
>>>> This is one case where VM has it easy. S/370 processors don't use
>>>> an idle loop, but a wait state where they stop executing instructions.
>>>
>>> So does a PDP-11 normally, which is why I wonder what this API is
>>> expected to be used for.
>>
>> Run RSX under SimH and then look at CPU usage and you'll see why :-)
>>
>> Under SimH, RSX uses up a full CPU slot, just like RT-11 systems which
>> don't use the WAIT instruction.
>>
>> V11 solves the problem for RUST systems, but that doesn't help other
>> systems.
>
>That is because you need to tell SimH to actually release the machine
>when the PDP-11 executes a WAIT... :-)
>In SimH: set cpu idle
>
>otherwise, SimH will "emulate" the WAIT instruction by actually doing a
>tight loop.
Yes, I haven't read the SimH documentation for quite some time :-)
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.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 13:20 ` Bob Eager
@ 2012-01-19 14:29 ` Bob Koehler
0 siblings, 0 replies; 222+ messages in thread
From: Bob Koehler @ 2012-01-19 14:29 UTC (permalink / raw)
In article <9nnv8qFi76U8@mid.individual.net>, Bob Eager <news0001@eager.cx> writes:
> On Wed, 18 Jan 2012 12:41:06 +0000, glen herrmannsfeldt wrote:
>
>
>> This is one case where VM has it easy. S/370 processors don't use an
>> idle loop, but a wait state where they stop executing instructions.
>>
>> As I understand it, when IBM leased processors, they had a usage meter
>> such that one would pay based on how much the processor was used. The
>> usage meter stops in the wait state.
>
> Isn't that true on the PDP-11, with WAIT? And with at least some x86 CPUs
> and HLT?
>
It can be done on a lot of systems with a HALT instruction. Many CPU
will start up again when receiving an interrupt, which is how most
systems get out of thier idle loops anyhow.
Some systems, however, will take action when the CPU executes a HALT
instruction. Qbus VAX 4000 were often configurable in this reguard.
The default action was to force a system crash. It was because of
this that I stopped using HALT as a kernel debug instruction. Back
on 11/780, you simply got a console prompt and could enter CONTINUE
when done debugging.
It is important to note, that on some architectures, such as VAX,
the program counter (aka instruction pointer, ...), is incremented
by the halt instruction, so simply dismissing the interrupt can cause
the system to move on to the next instruction (which is also why
console CONTINUE worked on an 11/780).
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 18:12 ` Johnny Billquist
@ 2012-01-19 14:30 ` paramucho
2012-01-19 16:42 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-19 14:30 UTC (permalink / raw)
On Wed, 18 Jan 2012 19:12:24 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>> An output serial port is a fairly reliable timing device. You just
>> send nulls to the port and treat the interrupts as timer events. I
>> first used this technique when the clock on the PDP-11 I was using at
>> the Hannover computer show died on me a few hours before the show
>> started.
>
>Hum? So what do you detect? 50Hz vs. 60Hz, and the speed of the console
>port. Useful, but I would think you'd like to detect more.
It sets out to automatically detect the clock speed, and that's what
it does. What more should it detect?
Of course, other conditions are detected, including emulators and the
presence of a DEC programmable clock.
>Also, this might be messy if someone actually use a clock source with
>some other frequency...
>(800Hz seems to have been somewhat popular as well).
It supports the standard DEC configurations. For non-standard hardware
it fails benignly and can be overridden with a bootstrap .INI file
entry or a startup command file. It's not messy at all.
>> The test usually fails benignly. The problem with SimH is that it
>> outputs a space when you send a null to the terminal. I've not seen a
>> DEC terminal do that. The test can be disabled with a .INI file
>> setting. There's a couple of checks which exclude the test.
>
>Hum? First of all, SimH is running inside some terminal window, so I
>would suspect that any such behavior should be blamed on that terminal
>program and not Simh, unless you really are saying that if you write a 0
>to the CSR, Simh really sends out a 32(10) on the port.
>
>What terminal program, if I may ask. It sounds bad enough that I
>probably want to avoid it.
The Windows console program.
Or rather, it was a problem some years ago when I wrote the code. I
retested tonight and the behavior is no longer there.
>Terminal output is good in a way, I agree. They do normally take some
>constant time to perform, no matter what speed the CPU have.
I've used them instead of a line clock to maintain system time.
> The problem
>obviously being that when you go to virtual serial ports, that is no
>longer true, since the serial data can be clocked out at any speed even
>thought you might think it is some other, fixed speed.
That's not a real-world problem. These tests are performed during
bootstrap on the system console.
>> In any case I think it's great to be able to detect 50 or 60 hertz
>> automatically (and at the same time determine the baud rate of the
>> console).
>
>True. Although I think the test is flawed and will only work under some
>restricted circumstances. Even if they are pretty common.
It works on standard configurations, unflawed. Non-standard
configurations revert to INI files or startup command file. That's how
the world works. I wish I'd thought of the technique back in the
eighties.
<snip>
>>> Hmm. How do you use that API? Is it to tell that the emulator isn't
>>> doing anything extremely important, and can run with less CPU right now
>>> and be happy, or is this just an odd way of doing a WAIT?
>>
>> The first. It's called by RUST/SJ when it's waiting for terminal
>> input, so that only works most of the time. It's called RUST/XM,
>> multi-process system, whenever it schedules the idle process, which is
>> much more accurate. The emulator just waits a millisecond and resumes
>> the RUST system. It doesn't seem to impact RUST performance and it
>> stops the emulator from acting as an ugly CPU hog.
>
>Ah. That is what the WAIT instruction is for. And, reading your other
>post, it would appear you have drawn some odd conclusion based on the
>default settings in Simh, where Simh don't actually release the CPU if
>you do a WAIT.
RT-11 doesn't use WAIT and since RUST systems grows out of that
tradition they don't use WAIT either (and by the way, I rarely use
SimH).
>> The API is also used to detect the emulator, get a startup comand and
>> a few other tasks. It's the sort of thing which could grow and grow...
>>
>> Here's the autohertz/baud check from the RUST/SJ bootstrap module.
>> "bnew" and "beqw" combine compare and branch instructions.
>
>[...]
>The problem being that 50 and 60 Hz are not the only two clock
>frequencies you might find on a PDP-11... :-)
They are the only two line clock frequencies supported by RT-11 and
RUST. The test is not performed if a programmable clock is available.
I have never had a request for the support of any other kind of clock
frequency. In any case, as stated a few times, the test can be
overriden. I don't see a real-world problem here at all. It's one of
my favorite little routines.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 21:54 ` glen herrmannsfeldt
2012-01-18 22:32 ` Al Kossow
2012-01-19 0:22 ` Johnny Billquist
@ 2012-01-19 14:32 ` Bob Koehler
2012-01-19 16:45 ` Johnny Billquist
2 siblings, 1 reply; 222+ messages in thread
From: Bob Koehler @ 2012-01-19 14:32 UTC (permalink / raw)
In article <jf7f3j$lq4$1@speranza.aioe.org>, glen herrmannsfeldt <gah@ugcs.caltech.edu> writes:
>
> It would seem that PDP-11 emulators could emulate serial lines
> between emulated machines, such that one could communicate with
> another. I will guess that card punches were rare on PDP-11s.
Never saw a card punch on a DEC machine, although I suspect they
existed. Did see card readers, although not designed for high
volume.
Early PDP-11 were likely to have paper tape punches and readers.
Moving from roll to fan-fold was certianly an improvement.
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 14:30 ` paramucho
@ 2012-01-19 16:42 ` Johnny Billquist
2012-01-19 20:32 ` glen herrmannsfeldt
2012-01-20 13:29 ` paramucho
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-19 16:42 UTC (permalink / raw)
On 2012-01-19 15.30, paramucho wrote:
> On Wed, 18 Jan 2012 19:12:24 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>>> An output serial port is a fairly reliable timing device. You just
>>> send nulls to the port and treat the interrupts as timer events. I
>>> first used this technique when the clock on the PDP-11 I was using at
>>> the Hannover computer show died on me a few hours before the show
>>> started.
>>
>> Hum? So what do you detect? 50Hz vs. 60Hz, and the speed of the console
>> port. Useful, but I would think you'd like to detect more.
>
> It sets out to automatically detect the clock speed, and that's what
> it does. What more should it detect?
Well, this whole thread started out with the question of how to detect
what CPU/machine you are running on. Which seems like a valid thing to
sometimes want to know.
> Of course, other conditions are detected, including emulators and the
> presence of a DEC programmable clock.
How do you detect emulation or a DEC programmable clock this way?
>> Also, this might be messy if someone actually use a clock source with
>> some other frequency...
>> (800Hz seems to have been somewhat popular as well).
>
> It supports the standard DEC configurations. For non-standard hardware
> it fails benignly and can be overridden with a bootstrap .INI file
> entry or a startup command file. It's not messy at all.
Well, any 11/73, 11/83, 11/84, 11/93 or 11/94 have in the setup menu the
option to run the system clock at power line frequency, 50 Hz, 60 Hz or
800 Hz. Seems rather standard hardware to me.
I have not checked if the 11/53 have the same option. For older
machines, you need the programmable clock to select anything but line
frequency.
>>> The test usually fails benignly. The problem with SimH is that it
>>> outputs a space when you send a null to the terminal. I've not seen a
>>> DEC terminal do that. The test can be disabled with a .INI file
>>> setting. There's a couple of checks which exclude the test.
>>
>> Hum? First of all, SimH is running inside some terminal window, so I
>> would suspect that any such behavior should be blamed on that terminal
>> program and not Simh, unless you really are saying that if you write a 0
>> to the CSR, Simh really sends out a 32(10) on the port.
>>
>> What terminal program, if I may ask. It sounds bad enough that I
>> probably want to avoid it.
>
> The Windows console program.
>
> Or rather, it was a problem some years ago when I wrote the code. I
> retested tonight and the behavior is no longer there.
Still probably a terminal program that I will avoid.
>> Terminal output is good in a way, I agree. They do normally take some
>> constant time to perform, no matter what speed the CPU have.
>
> I've used them instead of a line clock to maintain system time.
Works as long as you have a physical serial port.
>> The problem
>> obviously being that when you go to virtual serial ports, that is no
>> longer true, since the serial data can be clocked out at any speed even
>> thought you might think it is some other, fixed speed.
>
> That's not a real-world problem. These tests are performed during
> bootstrap on the system console.
All my emulated machines have a virtual serial port. It does not take
much, or any time at all, to write a byte to the serial console port.
And I think that is very much the real world.
The console lines are in reality telnet ports.
>>> In any case I think it's great to be able to detect 50 or 60 hertz
>>> automatically (and at the same time determine the baud rate of the
>>> console).
>>
>> True. Although I think the test is flawed and will only work under some
>> restricted circumstances. Even if they are pretty common.
>
> It works on standard configurations, unflawed. Non-standard
> configurations revert to INI files or startup command file. That's how
> the world works. I wish I'd thought of the technique back in the
> eighties.
It's a nice enough technique, and it has been used before. It do have
its limits, which is the main reason it's not become so universal.
>>>> Hmm. How do you use that API? Is it to tell that the emulator isn't
>>>> doing anything extremely important, and can run with less CPU right now
>>>> and be happy, or is this just an odd way of doing a WAIT?
>>>
>>> The first. It's called by RUST/SJ when it's waiting for terminal
>>> input, so that only works most of the time. It's called RUST/XM,
>>> multi-process system, whenever it schedules the idle process, which is
>>> much more accurate. The emulator just waits a millisecond and resumes
>>> the RUST system. It doesn't seem to impact RUST performance and it
>>> stops the emulator from acting as an ugly CPU hog.
>>
>> Ah. That is what the WAIT instruction is for. And, reading your other
>> post, it would appear you have drawn some odd conclusion based on the
>> default settings in Simh, where Simh don't actually release the CPU if
>> you do a WAIT.
>
> RT-11 doesn't use WAIT and since RUST systems grows out of that
> tradition they don't use WAIT either (and by the way, I rarely use
> SimH).
Ok. Anyway, WAIT works very nicely, and SimH actually will not hog the
CPU when a WAIT is executed, *if* you tell it not to. But that is a SimH
implementation detail.
And I'm maybe a little surprised that RT-11 don't use WAIT, but then
again, it's a simple single-user system, so it might not be totally
shocking that it don't use WAIT.
Do you know how the idle loop displays anything on the switch register
in RT-11? Does it actually write to the switch register? Do you know
where in the code it is? Trying to look a little at the RT-11 sources...
>>> The API is also used to detect the emulator, get a startup comand and
>>> a few other tasks. It's the sort of thing which could grow and grow...
>>>
>>> Here's the autohertz/baud check from the RUST/SJ bootstrap module.
>>> "bnew" and "beqw" combine compare and branch instructions.
>>
>> [...]
>> The problem being that 50 and 60 Hz are not the only two clock
>> frequencies you might find on a PDP-11... :-)
>
> They are the only two line clock frequencies supported by RT-11 and
> RUST. The test is not performed if a programmable clock is available.
> I have never had a request for the support of any other kind of clock
> frequency. In any case, as stated a few times, the test can be
> overriden. I don't see a real-world problem here at all. It's one of
> my favorite little routines.
Ouch. RSX supports any clock frequency, and you can also change it
dynamically on M+ systems. (Well, more than 65535 Hz is not possible,
and in the old times of real hardware, I think the recommendation was to
not use something higher than 1000 Hz, because the overhead from the
clock interrupts would start to take too much CPU time.)
And even the line clock type can actually give you other frequencies, as
I mentioned above, depending on which machines you have.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 14:32 ` Bob Koehler
@ 2012-01-19 16:45 ` Johnny Billquist
2012-01-20 17:55 ` Bob Koehler
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-19 16:45 UTC (permalink / raw)
On 2012-01-19 15.32, Bob Koehler wrote:
> In article<jf7f3j$lq4$1@speranza.aioe.org>, glen herrmannsfeldt<gah@ugcs.caltech.edu> writes:
>>
>> It would seem that PDP-11 emulators could emulate serial lines
>> between emulated machines, such that one could communicate with
>> another. I will guess that card punches were rare on PDP-11s.
>
> Never saw a card punch on a DEC machine, although I suspect they
> existed. Did see card readers, although not designed for high
> volume.
I actually have never seen a card punch interface for a DEC machine. I
assumed it was mostly because card were punched on terminals, and then
loaded into the machine. Cards were not used to store data, as far as I
know, and thus there wasn't much need for a puncher on the machine.
> Early PDP-11 were likely to have paper tape punches and readers.
> Moving from roll to fan-fold was certianly an improvement.
Paper punches/readers were pretty common. I still have one or two around.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 14:25 ` paramucho
@ 2012-01-19 16:50 ` Johnny Billquist
2012-01-20 13:32 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-19 16:50 UTC (permalink / raw)
On 2012-01-19 15.25, paramucho wrote:
> On Wed, 18 Jan 2012 19:00:03 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-01-18 17:25, paramucho wrote:
>>> On Wed, 18 Jan 2012 14:18:26 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>> <snip>
>>>
>>>>>> In fact, the V11 emulator has a little API which is used to pass
>>>>>> information between the emulator and the system. It's used to
>>>>>> relinquish control so that the emulator doesn't hog all the CPU time
>>>>>> and for various other functions.
>>>>>
>>>>> This is one case where VM has it easy. S/370 processors don't use
>>>>> an idle loop, but a wait state where they stop executing instructions.
>>>>
>>>> So does a PDP-11 normally, which is why I wonder what this API is
>>>> expected to be used for.
>>>
>>> Run RSX under SimH and then look at CPU usage and you'll see why :-)
>>>
>>> Under SimH, RSX uses up a full CPU slot, just like RT-11 systems which
>>> don't use the WAIT instruction.
>>>
>>> V11 solves the problem for RUST systems, but that doesn't help other
>>> systems.
>>
>> That is because you need to tell SimH to actually release the machine
>> when the PDP-11 executes a WAIT... :-)
>> In SimH: set cpu idle
>>
>> otherwise, SimH will "emulate" the WAIT instruction by actually doing a
>> tight loop.
>
> Yes, I haven't read the SimH documentation for quite some time :-)
>
> 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.
Or, what version of Unix are you referring to? I'm looking at (and
using) 2.11BSD. I haven't really checked older versions.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 1 reply; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-19 20:32 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip)
> And I'm maybe a little surprised that RT-11 don't use WAIT, but then
> again, it's a simple single-user system, so it might not be totally
> shocking that it don't use WAIT.
That would be true for SJ, but for FB or, if I remember right, XM,
I would think it might do WAIT.
> Do you know how the idle loop displays anything on the switch register
> in RT-11? Does it actually write to the switch register? Do you know
> where in the code it is? Trying to look a little at the RT-11 sources...
(snip)
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 16:42 ` Johnny Billquist
2012-01-19 20:32 ` glen herrmannsfeldt
@ 2012-01-20 13:29 ` paramucho
2012-01-20 16:48 ` Johnny Billquist
2012-01-26 3:25 ` Jerome H. Fine
1 sibling, 2 replies; 222+ messages in thread
From: paramucho @ 2012-01-20 13:29 UTC (permalink / raw)
On Thu, 19 Jan 2012 17:42:37 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-01-19 15.30, paramucho wrote:
>> On Wed, 18 Jan 2012 19:12:24 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>> <snip>
>>>> An output serial port is a fairly reliable timing device. You just
>>>> send nulls to the port and treat the interrupts as timer events. I
>>>> first used this technique when the clock on the PDP-11 I was using at
>>>> the Hannover computer show died on me a few hours before the show
>>>> started.
>>>
>>> Hum? So what do you detect? 50Hz vs. 60Hz, and the speed of the console
>>> port. Useful, but I would think you'd like to detect more.
>>
>> It sets out to automatically detect the clock speed, and that's what
>> it does. What more should it detect?
>
>Well, this whole thread started out with the question of how to detect
>what CPU/machine you are running on. Which seems like a valid thing to
>sometimes want to know.
The autohertz feature is just part of a more general bootstrap
detection process. I also have detect the usual things such as
available memory, CPU type, FPU, EIS, LSI and so on. All that code is
pretty straight-forward and carried out by many PDP-11 operating
systems.
The approach I take on RUST/XM is a little bit more interesting though
because I don't assume I'm in kernel mode with access to the I/O page
for a lot of the initial tests. I did that so that I could reuse the
code in a general environment detection utility and so that I act
sensibly if an attempt was made to boot in VAX compatibility mode.
>> Of course, other conditions are detected, including emulators and the
>> presence of a DEC programmable clock.
>
>How do you detect emulation or a DEC programmable clock this way?
The other conditions aren't detected with a timing loop...you seem to
be talking about general detection and timing-loop detection all at
the same time...or are we in alternate universes again...
>>> Also, this might be messy if someone actually use a clock source with
>>> some other frequency...
>>> (800Hz seems to have been somewhat popular as well).
>>
>> It supports the standard DEC configurations. For non-standard hardware
>> it fails benignly and can be overridden with a bootstrap .INI file
>> entry or a startup command file. It's not messy at all.
>
>Well, any 11/73, 11/83, 11/84, 11/93 or 11/94 have in the setup menu the
>option to run the system clock at power line frequency, 50 Hz, 60 Hz or
>800 Hz. Seems rather standard hardware to me.
>I have not checked if the 11/53 have the same option. For older
>machines, you need the programmable clock to select anything but line
>frequency.
The 800hz option isn't present on the 11/73. It's not documented in
the CPU guide and I note that SimH only provides the "JCLK" option for
the 8x and 9x CPUs but not for the 73.
In any case, since the option settings for 50/60/800 hz are visible in
a processor register (xx177520) I don't need to detect the setting in
a timing loop. It's just a matter of a CPU and CSR detect.
At present CPU support for RUST systems hasn't advanced beyond the
11/73. Later stuff is on the TODO list, but until someone who can also
test the code requests the functionality there are better ways to
waste my time.
<snip>
>>> The problem
>>> obviously being that when you go to virtual serial ports, that is no
>>> longer true, since the serial data can be clocked out at any speed even
>>> thought you might think it is some other, fixed speed.
>>
>> That's not a real-world problem. These tests are performed during
>> bootstrap on the system console.
>
>All my emulated machines have a virtual serial port. It does not take
>much, or any time at all, to write a byte to the serial console port.
>And I think that is very much the real world.
>The console lines are in reality telnet ports.
The test is not performed on emulated machines, which is why it's not
a real-world problem for moi. There is no problem to solve.
<snip>
>And I'm maybe a little surprised that RT-11 don't use WAIT, but then
>again, it's a simple single-user system, so it might not be totally
>shocking that it don't use WAIT.
According to SimH documentation the SET CPU IDLE code benefits RSX and
RSTS but not RT-11 or UNIX. Unix is not a single-user operating
system. I'm not sure about the many other operating systems written
for the PDP-11. You note elsewhere that a later version of BSD
supports WAIT, but Bob Supnik is probably talking about "Unix" Unix.
RT-11 is definitely a multi-task/job system. Late versions of the
system support "system jobs" running just about any system program
(I've never actually used the feature though). So, if multi-process is
a reason for WAIT, then it applies equally to RT-11.
In any case, it's more a question of single-CPU than it is single-
user. There's no particular benefit to using WAIT in a single-CPU
configuration. Up until 2006 the instruction was effectively ignored
by SimH and is still ignored out-of-the-box for SimH.
It's not necessary for a system to use every feature provided by the
hardware architecture. For example, the original planned use of
interrupt vectors has essentially been ignored by RT-11 and RSX for
years which uniformly take interrupts at PR7 and then lower priority
to the device level rather than letting the vector do that job as
originally planned. Then there's the PDP-11 virtual memory feature,
not to forget MARK.
>Do you know how the idle loop displays anything on the switch register
>in RT-11? Does it actually write to the switch register? Do you know
>where in the code it is? Trying to look a little at the RT-11 sources...
A long, long time ago, when I was a young coder, I could more-or-less
recite the RT-11 monitor code from memory, and yes, the idle loop code
is still in the sources even though switch registers are long gone.
As discussed in our earlier threads, I usually don't waste my time
presenting details of RT-11 in our discussions since you generally
don't respond (beyond snipping), but since you ask I'll summarise my
fuller response to Glenn here.
No official DEC distribution of RT-11 had a monitor binary with a WAIT
instruction in the idle loop.
Up until V5.4, which was quite late in RT-11's life cycle, there was
no provision at all for WAIT in the loop. A patch point was introduced
late in RT-11's life cycle, around V5.4, which allowed for a WAIT
instruction to be patched in, but that patch point was not used by the
RT-11 bootstrap during startup and was not documented in CUSTOM.TXT
which provides information on monitor patch points. It is essentially
DEC-private.
So the closest you get to WAIT in RT-11 is ";;; WAIT". Indeed, the
commented WAIT shows that the inclusion of the instruction was
considered and rejected.
See my response to Glenn for more details.
(I'm heartened to see that you're finally reading the RT-11 sources.
Welcome to the bright side of the road comrade :-)
>>>> The API is also used to detect the emulator, get a startup comand and
>>>> a few other tasks. It's the sort of thing which could grow and grow...
>>>>
>>>> Here's the autohertz/baud check from the RUST/SJ bootstrap module.
>>>> "bnew" and "beqw" combine compare and branch instructions.
>>>
>>> [...]
>>> The problem being that 50 and 60 Hz are not the only two clock
>>> frequencies you might find on a PDP-11... :-)
>>
>> They are the only two line clock frequencies supported by RT-11 and
>> RUST. The test is not performed if a programmable clock is available.
>> I have never had a request for the support of any other kind of clock
>> frequency. In any case, as stated a few times, the test can be
>> overriden. I don't see a real-world problem here at all. It's one of
>> my favorite little routines.
>
>Ouch. RSX supports any clock frequency, and you can also change it
>dynamically on M+ systems. (Well, more than 65535 Hz is not possible,
>and in the old times of real hardware, I think the recommendation was to
>not use something higher than 1000 Hz, because the overhead from the
>clock interrupts would start to take too much CPU time.)
Once again, the point of the timing loop is to determine the line
clock frequency during *bootstrap*. Dynamic changing of the clock
frequency at runtime is not an issue it attempts to address, could
address or needs to address.
>And even the line clock type can actually give you other frequencies, as
>I mentioned above, depending on which machines you have.
You mentioned one other "line clock" frequency only (800hz), not
plural "frequencies", but it's not necessary to autodetect that
frequency since the information in that case is available in a
processor register.
Indeed, despite your vociferous objections and invented issues there
is *no* problem. For most machines the feature automatically detects
the line frequency. If not, it fails benignly. It doesn't apply to
virtual ports or dynamic runtime changes. It doesn't need to detect
800hz. It can be overriden with a .INI file or the startup command
file.
I know that my European and Australian 50hz customers would have loved
to have had the feature back in the 80s. I only came up with the
feature when I decided to rejuvinate my systems over the last decade
to introduce some of more beneficial recent operating systems ideas,
and one of those good ideas is that systems should figure out for
themselves what hardware they have without bugging users.
Are we done yet? Can we find something else to chew? :-)
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 20:32 ` glen herrmannsfeldt
@ 2012-01-20 13:32 ` paramucho
0 siblings, 0 replies; 222+ messages in thread
From: paramucho @ 2012-01-20 13:32 UTC (permalink / raw)
On Thu, 19 Jan 2012 20:32:25 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:
>In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
>
>(snip)
>> And I'm maybe a little surprised that RT-11 don't use WAIT, but then
>> again, it's a simple single-user system, so it might not be totally
>> shocking that it don't use WAIT.
>
>That would be true for SJ, but for FB or, if I remember right, XM,
>I would think it might do WAIT.
No sign of WAIT at all in RT-11 up to and including V5.3.
In V5.4 a couple of patch points at the end of the idle loop are
introduced which effectively place two NOPs at the end of the loop. A
patch offset, ..NULJ, is also defined, along with conditional code for
RTEM, which entered the sources at the same time. The monitor offset
$NULJB seems to be defined at the same time.
I can't find any BSTRAP.MAC code which would alter the patch points
for an XM monitor. So, I don't think that any RT-11 monitor was
distributed with WAIT in the idle loop. I ran up a couple of XM
monitors today and saw only NOPs
The only code I can find which uses the offset is RTMON, a foreground
program which monitors RT-11's performance. I guess it hooks itself
into the idle loop.
Some late monitor sources show that the patch points had been designed
to optionally use WAIT at the end of the idle loop. The monitor fixed
offset $NULJB has the comment that reads "=> WAIT/NOP" and the first
NOP mentioned above has a WAIT instruction preceded by three
semicolons.
I think this code was either experimental or used by special services
because: (1) it is not enabled/disabled by a conditional, (2) the
offset is not listed in CUSTOM.TXT which describes the monitor patch
points.
Thus, I think that WAIT would have been used only for some specific
customers needs, if anything. It's not unknown for RT-11 developers to
leave hooks to private code in the monitor sources. An examination of
the late sources shows hooks for a disk cache as well.
I doubt that the RT-11 team would have introduced WAIT into the
distribution because (1) it doesn't bring any practical benefit, (2) a
change in the idle loop would almost certainly affect some existing
user applications, and (3) if it's not broken don't fix it.
So the best we can say, at the moment, I think is that the RT-11 team
considered the idea of introducing a WAIT instruction into the idle
loop and rejected the idea.
As to why a customer might have a specific need for WAIT one can only
speculate, however I recall a client I had who built disk testers and
formatters for the large disk pack manufacturers in the early 80s.
They had a custom processor which did the actual work. They called me
in when they had erratic behavior that couldn't explain. To cut a long
story short I found that the noise causing the erratic behavior was
the unibus itself. By inserting a single WAIT instruction I
effectively turned off enough of the electrical behavior of the bus to
remove the problem. But I still didn't need that support in the
monitor.
BTW: One of the companies they worked for, it might have been Nassau,
produced platters for DEC (possibly the RLO1/RLO2). They were the same
specs as used by some other customers and the supplier had worked out
that DEC's quality assurance program was the weakest in the industry
so they sent all their flakiest platters to DEC (who sent them to us).
I was ironic, and rather cruel working for them. I was in a room with
hundreds of thousands of dollars worth of very large disk packs
working on a tiny PDP-11 with single density floppies and one of the
earliers, crudest of the VT52 series.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 16:50 ` Johnny Billquist
@ 2012-01-20 13:32 ` paramucho
2012-01-20 16:54 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-20 13:32 UTC (permalink / raw)
On Thu, 19 Jan 2012 17:50:49 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-01-19 15.25, paramucho wrote:
>> On Wed, 18 Jan 2012 19:00:03 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>>> On 2012-01-18 17:25, paramucho wrote:
>>>> On Wed, 18 Jan 2012 14:18:26 +0100, Johnny Billquist<bqt@softjar.se>
>>>> wrote:
>>>>
>>>> <snip>
>>>>
>>>>>>> In fact, the V11 emulator has a little API which is used to pass
>>>>>>> information between the emulator and the system. It's used to
>>>>>>> relinquish control so that the emulator doesn't hog all the CPU time
>>>>>>> and for various other functions.
>>>>>>
>>>>>> This is one case where VM has it easy. S/370 processors don't use
>>>>>> an idle loop, but a wait state where they stop executing instructions.
>>>>>
>>>>> So does a PDP-11 normally, which is why I wonder what this API is
>>>>> expected to be used for.
>>>>
>>>> Run RSX under SimH and then look at CPU usage and you'll see why :-)
>>>>
>>>> Under SimH, RSX uses up a full CPU slot, just like RT-11 systems which
>>>> don't use the WAIT instruction.
>>>>
>>>> V11 solves the problem for RUST systems, but that doesn't help other
>>>> systems.
>>>
>>> That is because you need to tell SimH to actually release the machine
>>> when the PDP-11 executes a WAIT... :-)
>>> In SimH: set cpu idle
>>>
>>> otherwise, SimH will "emulate" the WAIT instruction by actually doing a
>>> tight loop.
>>
>> Yes, I haven't read the SimH documentation for quite some time :-)
>>
>> 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.
>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 :-)
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-20 13:29 ` paramucho
@ 2012-01-20 16:48 ` Johnny Billquist
2012-01-21 12:25 ` paramucho
2012-01-26 3:25 ` Jerome H. Fine
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-20 16:48 UTC (permalink / raw)
On 2012-01-20 14:29, paramucho wrote:
> On Thu, 19 Jan 2012 17:42:37 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-01-19 15.30, paramucho wrote:
>>> On Wed, 18 Jan 2012 19:12:24 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>> <snip>
>>> Of course, other conditions are detected, including emulators and the
>>> presence of a DEC programmable clock.
>>
>> How do you detect emulation or a DEC programmable clock this way?
>
> The other conditions aren't detected with a timing loop...you seem to
> be talking about general detection and timing-loop detection all at
> the same time...or are we in alternate universes again...
I was responding to your comment above, which I did include above my
question. You said you detect other conditions, including emulators and
the presence of a DEC programmable clock.
So I just asked how you detected those ones. I thought that was a very
straight forward question.
>>>> Also, this might be messy if someone actually use a clock source with
>>>> some other frequency...
>>>> (800Hz seems to have been somewhat popular as well).
>>>
>>> It supports the standard DEC configurations. For non-standard hardware
>>> it fails benignly and can be overridden with a bootstrap .INI file
>>> entry or a startup command file. It's not messy at all.
>>
>> Well, any 11/73, 11/83, 11/84, 11/93 or 11/94 have in the setup menu the
>> option to run the system clock at power line frequency, 50 Hz, 60 Hz or
>> 800 Hz. Seems rather standard hardware to me.
>> I have not checked if the 11/53 have the same option. For older
>> machines, you need the programmable clock to select anything but line
>> frequency.
>
> The 800hz option isn't present on the 11/73. It's not documented in
> the CPU guide and I note that SimH only provides the "JCLK" option for
> the 8x and 9x CPUs but not for the 73.
At least some 11/73 machines use the same CPU as the 11/83, so it is
present on some 11/73 machines.
> In any case, since the option settings for 50/60/800 hz are visible in
> a processor register (xx177520) I don't need to detect the setting in
> a timing loop. It's just a matter of a CPU and CSR detect.
Right.
> At present CPU support for RUST systems hasn't advanced beyond the
> 11/73. Later stuff is on the TODO list, but until someone who can also
> test the code requests the functionality there are better ways to
> waste my time.
:-)
>> And I'm maybe a little surprised that RT-11 don't use WAIT, but then
>> again, it's a simple single-user system, so it might not be totally
>> shocking that it don't use WAIT.
>
> According to SimH documentation the SET CPU IDLE code benefits RSX and
> RSTS but not RT-11 or UNIX. Unix is not a single-user operating
> system. I'm not sure about the many other operating systems written
> for the PDP-11. You note elsewhere that a later version of BSD
> supports WAIT, but Bob Supnik is probably talking about "Unix" Unix.
Just checked Unix V7, it also uses WAIT.
> RT-11 is definitely a multi-task/job system. Late versions of the
> system support "system jobs" running just about any system program
> (I've never actually used the feature though). So, if multi-process is
> a reason for WAIT, then it applies equally to RT-11.
>
> In any case, it's more a question of single-CPU than it is single-
> user. There's no particular benefit to using WAIT in a single-CPU
> configuration. Up until 2006 the instruction was effectively ignored
> by SimH and is still ignored out-of-the-box for SimH.
Actually, there is not much of a point for WAIT even in multiprocessor
systems. There is a reason why the VAX don't have a WAIT.
WAIT is actually only really nice to have when you are emulating the
CPU, since at a WAIT, you can stop processing until some external event
happens.
The biggest reason for using WAIT on a real PDP-11 is that when the WAIT
is executing R0 is placed on the data bus, and thus you have a nice and
convenient way of displaying something on the front panel of computers
that have that, and yet have that bludder away as the CPU have more work
to do.
There is even one or two machines that have a display that can show
values, but as far as I can remember, didn't work with a switch register
CSR (the 11/60 being one, if I remember right). So actually writing to
the switch register wasn't possible, but having idle loops on the system
show some pattern on the front panels were rather popular... And I
thought the RT-11 also did, but looking at the code, I'm unclear if
RT-11 did, and if it did, then how...
> It's not necessary for a system to use every feature provided by the
> hardware architecture. For example, the original planned use of
> interrupt vectors has essentially been ignored by RT-11 and RSX for
> years which uniformly take interrupts at PR7 and then lower priority
> to the device level rather than letting the vector do that job as
> originally planned. Then there's the PDP-11 virtual memory feature,
> not to forget MARK.
The PDP-11 virtual memory is extensively used by most OSes on the
PDP-11. Are you thinking of the potential on some machines to implement
demand paging?
And please lets forget the MARK. ;-) It is incompatible with I/D space...
>> Do you know how the idle loop displays anything on the switch register
>> in RT-11? Does it actually write to the switch register? Do you know
>> where in the code it is? Trying to look a little at the RT-11 sources...
>
> A long, long time ago, when I was a young coder, I could more-or-less
> recite the RT-11 monitor code from memory, and yes, the idle loop code
> is still in the sources even though switch registers are long gone.
I hope you understand my question better based on the discussion of the
WAIT instruction above.
> As discussed in our earlier threads, I usually don't waste my time
> presenting details of RT-11 in our discussions since you generally
> don't respond (beyond snipping), but since you ask I'll summarise my
> fuller response to Glenn here.
I usually have very little to contribute on RT-11 specific things. In
this case I was wondering how RT-11 played with idle loop displays on
the front panel, which is (on other systems) based on the behavior of
the WAIT instruction. Since RT-11 appears to not use WAIT, this becomes
a rather relevant question. But it is a small detail, and not bearing
much relevance on RT-11 in a larger picture.
I'm basically curious on how RT-11 does it, if it don't use WAIT. Do it
write to the switch register (well, maybe it is called the display
register, I can't remember and am too lazy to check that one up right
now, I'm sure you know what I'm talking about), or does it have some
other trick?
> (I'm heartened to see that you're finally reading the RT-11 sources.
> Welcome to the bright side of the road comrade :-)
I've read through a bunch of RT-11 before. I don't remember if it was
you or someone else I had a discussion with, where I needed to figure
out how USR and file operations work, in the face of potentially
multiple programs calling it.
Bright side... I don't know. It's always nice to read PDP-11 code, and
you can always learn a trick or two. But I definitely prefer the RSX
code. :-)
>> And even the line clock type can actually give you other frequencies, as
>> I mentioned above, depending on which machines you have.
>
> You mentioned one other "line clock" frequency only (800hz), not
> plural "frequencies", but it's not necessary to autodetect that
> frequency since the information in that case is available in a
> processor register.
Caught me. :-)
I don't know if there are other frequencies that you might hit or not.
My point was that I *know* of at least one other frequency. Actually,
since we're talking line frequency, it can be more or less anything.
Just because Europe use 50 Hz, and the US 60 Hz don't mean we've covered
the whole world on the questions of what line frequencies might exist.
> Indeed, despite your vociferous objections and invented issues there
> is *no* problem. For most machines the feature automatically detects
> the line frequency. If not, it fails benignly. It doesn't apply to
> virtual ports or dynamic runtime changes. It doesn't need to detect
> 800hz. It can be overriden with a .INI file or the startup command
> file.
You might think I'm making up imaginary problems. I (obviously)
disagree. This is not meant as an attack on you, and I hope you don't
take it that way.
I'm pointing out ways your code can fail, and you just say that in real
life you haven't been bitten. Good for you. Does that mean it can't
happen? I think it can.
There are plenty of examples in the real world where designs in code
have suddenly failed because of a scenario that was considered unlikely
enough to be ignored when the code was written.
> I know that my European and Australian 50hz customers would have loved
> to have had the feature back in the 80s. I only came up with the
> feature when I decided to rejuvinate my systems over the last decade
> to introduce some of more beneficial recent operating systems ideas,
> and one of those good ideas is that systems should figure out for
> themselves what hardware they have without bugging users.
>
> Are we done yet? Can we find something else to chew? :-)
I'm almost never done. Haven't you figured that out yet? :-)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-20 13:32 ` paramucho
@ 2012-01-20 16:54 ` Johnny Billquist
2012-01-21 13:16 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-20 16:54 UTC (permalink / raw)
On 2012-01-20 14:32, paramucho wrote:
> On Thu, 19 Jan 2012 17:50:49 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-01-19 15.25, paramucho wrote:
>>> On Wed, 18 Jan 2012 19:00:03 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>>> On 2012-01-18 17:25, paramucho wrote:
>>>>> On Wed, 18 Jan 2012 14:18:26 +0100, Johnny Billquist<bqt@softjar.se>
>>>>> wrote:
>>>>>
>>>>> <snip>
>>>>>
>>>>>>>> In fact, the V11 emulator has a little API which is used to pass
>>>>>>>> information between the emulator and the system. It's used to
>>>>>>>> relinquish control so that the emulator doesn't hog all the CPU time
>>>>>>>> and for various other functions.
>>>>>>>
>>>>>>> This is one case where VM has it easy. S/370 processors don't use
>>>>>>> an idle loop, but a wait state where they stop executing instructions.
>>>>>>
>>>>>> So does a PDP-11 normally, which is why I wonder what this API is
>>>>>> expected to be used for.
>>>>>
>>>>> Run RSX under SimH and then look at CPU usage and you'll see why :-)
>>>>>
>>>>> Under SimH, RSX uses up a full CPU slot, just like RT-11 systems which
>>>>> don't use the WAIT instruction.
>>>>>
>>>>> V11 solves the problem for RUST systems, but that doesn't help other
>>>>> systems.
>>>>
>>>> That is because you need to tell SimH to actually release the machine
>>>> when the PDP-11 executes a WAIT... :-)
>>>> In SimH: set cpu idle
>>>>
>>>> otherwise, SimH will "emulate" the WAIT instruction by actually doing a
>>>> tight loop.
>>>
>>> Yes, I haven't read the SimH documentation for quite some time :-)
>>>
>>> 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.
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?
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-19 16:45 ` Johnny Billquist
@ 2012-01-20 17:55 ` Bob Koehler
2012-01-20 18:38 ` Bill Gunshannon
0 siblings, 1 reply; 222+ messages in thread
From: Bob Koehler @ 2012-01-20 17:55 UTC (permalink / raw)
In article <jf9hac$7ol$2@Iltempo.Update.UU.SE>, Johnny Billquist <bqt@softjar.se> writes:
>
> I actually have never seen a card punch interface for a DEC machine. I
> assumed it was mostly because card were punched on terminals, and then
> loaded into the machine. Cards were not used to store data, as far as I
> know, and thus there wasn't much need for a puncher on the machine.
CR11 UNIBUS interface card reader, for which VMS had it's only input
symbiont, only supported on VAX, and for which DCL recognized both
LOGIN and PASSWORD as commands.
We had two of these connected to DECSYTSEM 20 systems. The original
contractor had not wanted any, the customer thought all computers
had to have them. "How else are the programmer's going to give
you thier code, on tape?" They agreed to just put them on the two
DECSYSTEMs and see if they were really needed. (Everything else had
been bid as various PDP-11, but on the last round the PDP-11/70 were
respecified as "PDP VAX 11/780".)
We ended up using them on rare occasion to read in 3 card ephemeris
points, supplied by the Navy, for our spacecraft. Normally we read
in ephemeris tapes provided by old IBM mainframes.
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-20 17:55 ` Bob Koehler
@ 2012-01-20 18:38 ` Bill Gunshannon
0 siblings, 0 replies; 222+ messages in thread
From: Bill Gunshannon @ 2012-01-20 18:38 UTC (permalink / raw)
In article <FJJw1FEy$Ao5@eisner.encompasserve.org>,
koehler@eisner.nospam.encompasserve.org (Bob Koehler) writes:
> In article <jf9hac$7ol$2@Iltempo.Update.UU.SE>, Johnny Billquist <bqt@softjar.se> writes:
>>
>> I actually have never seen a card punch interface for a DEC machine. I
>> assumed it was mostly because card were punched on terminals, and then
>> loaded into the machine. Cards were not used to store data, as far as I
>> know, and thus there wasn't much need for a puncher on the machine.
>
> CR11 UNIBUS interface card reader, for which VMS had it's only input
> symbiont, only supported on VAX, and for which DCL recognized both
> LOGIN and PASSWORD as commands.
That's a reader, not a punch.
>
> We had two of these connected to DECSYTSEM 20 systems. The original
> contractor had not wanted any, the customer thought all computers
> had to have them. "How else are the programmer's going to give
> you thier code, on tape?" They agreed to just put them on the two
> DECSYSTEMs and see if they were really needed. (Everything else had
> been bid as various PDP-11, but on the last round the PDP-11/70 were
> respecified as "PDP VAX 11/780".)
>
> We ended up using them on rare occasion to read in 3 card ephemeris
> points, supplied by the Navy, for our spacecraft. Normally we read
> in ephemeris tapes provided by old IBM mainframes.
I agree with Johnny. I have looked for both a card reader and a card punch
to add to my PDP-11 collection. I have never found a CR-11 that I could
get. And I have never found any reference to a card punch at all.
Of course, I would also love to find an OPSCAN-20. I once wrote software
for that on a PDP-11. :-)
bill
--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
billg999@cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-20 16:48 ` Johnny Billquist
@ 2012-01-21 12:25 ` paramucho
2012-01-21 20:15 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-21 12:25 UTC (permalink / raw)
On Fri, 20 Jan 2012 17:48:57 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>>> How do you detect emulation or a DEC programmable clock this way?
>>
>> The other conditions aren't detected with a timing loop...you seem to
>> be talking about general detection and timing-loop detection all at
>> the same time...or are we in alternate universes again...
>
>I was responding to your comment above, which I did include above my
>question. You said you detect other conditions, including emulators and
>the presence of a DEC programmable clock.
>So I just asked how you detected those ones. I thought that was a very
>straight forward question.
I was confused because you asked how I detected emulation or a
programmable clock "this way", which sounded like you were asking how
I detected them using a timer loop.
I posted the code for the emulation detection earlier in this thread.
My strategy, from memory, is to write some values into MMU SR0 and
then look at the results. It's not a particularly great test for a
couple of reasons.
(1) it only works if the emulated CPU has memory management. That
doesn't worry me too much because there's no reason to run any RUST
system without the default memory management setting.
(2) E11 doesn't really implement SR0 at the moment, so I'll be screwed
if it ever does so. That doesn't worry me too much because there's no
real reason for JW to add the code.
(3) I don't perform the test if there's a bootstrap module at I/O
pagte 173000. Neither SimH or E11 emulate the device, or at least, not
by default. I don't know why I implemented that restriction. O/S's are
just conservative by nature.
The programmable clock is detected just like all the other system
registers: you look to see if the I/O address of the relevant CSR
answers. There's nothing particularly fancy going on. I managed to put
together some reasonably well-tested detection code back in the 80s
and I still rely on it these days. The good thing about having
customers was that you got a lot of testing done...
RUST/XM has pages and pages of detection routines. It does all the
usual things, as I've stated, but I'd like it to do more in terms of
recognising the available devices. At present I handle device
detection with special routines in each driver.
RUST/XM begins with a general environment scan. The code is
semi-independent and can be compiled as a separate ENV utility. We
sometimes gave potential clients ENV so that could check in advance if
their computer setup was a suitable machine.
ENV attempts to do as many of the checks as possible without accessing
the I/O page or using kernel-only instructions. One of the ways it
does this is by testing for lots of the processor differences listed
at the back of the PDP-11 processor handbooks. It also tests for VAX
compatibility mode.
There are other peculiarities...
<snip>
>> According to SimH documentation the SET CPU IDLE code benefits RSX and
>> RSTS but not RT-11 or UNIX. Unix is not a single-user operating
>> system. I'm not sure about the many other operating systems written
>> for the PDP-11. You note elsewhere that a later version of BSD
>> supports WAIT, but Bob Supnik is probably talking about "Unix" Unix.
>
>Just checked Unix V7, it also uses WAIT.
>
<snip>
>There is even one or two machines that have a display that can show
>values, but as far as I can remember, didn't work with a switch register
>CSR (the 11/60 being one, if I remember right). So actually writing to
>the switch register wasn't possible, but having idle loops on the system
>show some pattern on the front panels were rather popular... And I
>thought the RT-11 also did, but looking at the code, I'm unclear if
>RT-11 did, and if it did, then how...
See my detailed reponse in my other reply.
>> It's not necessary for a system to use every feature provided by the
>> hardware architecture. For example, the original planned use of
>> interrupt vectors has essentially been ignored by RT-11 and RSX for
>> years which uniformly take interrupts at PR7 and then lower priority
>> to the device level rather than letting the vector do that job as
>> originally planned. Then there's the PDP-11 virtual memory feature,
>> not to forget MARK.
>
>The PDP-11 virtual memory is extensively used by most OSes on the
>PDP-11. Are you thinking of the potential on some machines to implement
>demand paging?
Yes, demand paging. There for the taking. Has any system ever used it?
I sometimes think about giving it a shot.
>And please lets forget the MARK. ;-) It is incompatible with I/D space...
>
>>> Do you know how the idle loop displays anything on the switch register
>>> in RT-11? Does it actually write to the switch register? Do you know
>>> where in the code it is? Trying to look a little at the RT-11 sources...
>>
>> A long, long time ago, when I was a young coder, I could more-or-less
>> recite the RT-11 monitor code from memory, and yes, the idle loop code
>> is still in the sources even though switch registers are long gone.
>
>I hope you understand my question better based on the discussion of the
>WAIT instruction above.
Yes.
>> As discussed in our earlier threads, I usually don't waste my time
>> presenting details of RT-11 in our discussions since you generally
>> don't respond (beyond snipping), but since you ask I'll summarise my
>> fuller response to Glenn here.
>
>I usually have very little to contribute on RT-11 specific things. In
>this case I was wondering how RT-11 played with idle loop displays on
>the front panel, which is (on other systems) based on the behavior of
>the WAIT instruction. Since RT-11 appears to not use WAIT, this becomes
>a rather relevant question. But it is a small detail, and not bearing
>much relevance on RT-11 in a larger picture.
>I'm basically curious on how RT-11 does it, if it don't use WAIT. Do it
>write to the switch register (well, maybe it is called the display
>register, I can't remember and am too lazy to check that one up right
>now, I'm sure you know what I'm talking about), or does it have some
>other trick?
See the other detailed response.
<snip>
>Caught me. :-)
>I don't know if there are other frequencies that you might hit or not.
>My point was that I *know* of at least one other frequency. Actually,
>since we're talking line frequency, it can be more or less anything.
>Just because Europe use 50 Hz, and the US 60 Hz don't mean we've covered
>the whole world on the questions of what line frequencies might exist.
Well, there's *only one* other known standard line clock frequency,
and we see that in the systems and the emulators. Non-standard
hardware is always treated differently but I always attempt to fail in
some non-critical manner with work-arounds. If there are problems
beyond that then it's time to debug and redesign.
>> Indeed, despite your vociferous objections and invented issues there
>> is *no* problem. For most machines the feature automatically detects
>> the line frequency. If not, it fails benignly. It doesn't apply to
>> virtual ports or dynamic runtime changes. It doesn't need to detect
>> 800hz. It can be overriden with a .INI file or the startup command
>> file.
>
>You might think I'm making up imaginary problems. I (obviously)
>disagree. This is not meant as an attack on you, and I hope you don't
>take it that way.
I don't take it as an attack at all. I enjoy talking details and don't
mind being hammered for inaccuracies. It keeps the PDP-11 area of my
brain a little sharper. However, I do find there's an excess of
repetition and overstatement at times. It means that responding
becomes a longer, more verbose process. I seem to be retyping the same
things over and over.
>I'm pointing out ways your code can fail, and you just say that in real
>life you haven't been bitten. Good for you. Does that mean it can't
>happen? I think it can.
>There are plenty of examples in the real world where designs in code
>have suddenly failed because of a scenario that was considered unlikely
>enough to be ignored when the code was written.
Of course all new code can fail. But somethings are worth putting out
there. You win some, you lose some, and you patch the rest. My company
always tried to extend the ease-of-use of systems and that involved
taking calculated risks, but those risks were tempered by providing
overrides and workarounds etc.
Back in the eighties I had commercial, competitive goals and full
compatibility with RT-11 was the primary goal. These days I don't have
those pressures and I like to try more innovation. It's not like I
have a thousand customers to deal with. I know that there's a regular
stream of people going to to my download page, but whether anyone is
actually using the systems these days, I have no idea, beyond one or
two.
>> I know that my European and Australian 50hz customers would have loved
>> to have had the feature back in the 80s. I only came up with the
>> feature when I decided to rejuvinate my systems over the last decade
>> to introduce some of more beneficial recent operating systems ideas,
>> and one of those good ideas is that systems should figure out for
>> themselves what hardware they have without bugging users.
>>
>> Are we done yet? Can we find something else to chew? :-)
>
>I'm almost never done. Haven't you figured that out yet? :-)
We definitely need a bigger bone.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 6:03 ` paramucho
2012-01-18 11:28 ` Johnny Billquist
2012-01-18 12:41 ` glen herrmannsfeldt
@ 2012-01-21 12:44 ` Tim Shoppa
2012-01-21 13:50 ` paramucho
2012-01-21 14:25 ` glen herrmannsfeldt
2012-01-26 3:22 ` Jerome H. Fine
3 siblings, 2 replies; 222+ messages in thread
From: Tim Shoppa @ 2012-01-21 12:44 UTC (permalink / raw)
On Jan 18, 1:03 am, paramu...@hotmail.com (paramucho) wrote:
> In any case, an emulator is not equivalent to a processor type since
> SimH and E11 support a range of PDP-11 CPUs.
Emulation of interesting (not textbook) machines might be a special
case of Godel's theorem. Working a lot like Hofstader's example of a
record that states "This record cannot be played on record player x"
and Hofstadter's thought of a record-player that has a record-player
emulator inside it. As soon as the emulator author finds out there's a
difference between the real world and emulation, such that software on
the emulated system can know it's not on the real system, the author
can refine the emulator so the software cannot tell anymore.
But without a formal and complete definition of the "real hardware"
that the "real hardware" actually followed, the game can probably be
repeated indefinitely. There will be a corner case of the real machine
not following the textbook architecture spec. In an academic way
that's what makes the whole emulator authoring process so interesting.
(This is something that the seller of commercial emulators could
probably never admit in public!)
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-20 16:54 ` Johnny Billquist
@ 2012-01-21 13:16 ` paramucho
2012-01-21 13:58 ` Bob Eager
` (2 more replies)
0 siblings, 3 replies; 222+ messages in thread
From: paramucho @ 2012-01-21 13:16 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 12:44 ` Tim Shoppa
@ 2012-01-21 13:50 ` paramucho
2012-01-22 16:56 ` Tim Shoppa
2012-01-21 14:25 ` glen herrmannsfeldt
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-21 13:50 UTC (permalink / raw)
On Sat, 21 Jan 2012 04:44:37 -0800 (PST), Tim Shoppa
<tshoppa@gmail.com> wrote:
>On Jan 18, 1:03�am, paramu...@hotmail.com (paramucho) wrote:
>> In any case, an emulator is not equivalent to a processor type since
>> SimH and E11 support a range of PDP-11 CPUs.
>
>Emulation of interesting (not textbook) machines might be a special
>case of Godel's theorem. Working a lot like Hofstader's example of a
>record that states "This record cannot be played on record player x"
>and Hofstadter's thought of a record-player that has a record-player
>emulator inside it. As soon as the emulator author finds out there's a
>difference between the real world and emulation, such that software on
>the emulated system can know it's not on the real system, the author
>can refine the emulator so the software cannot tell anymore.
>
>But without a formal and complete definition of the "real hardware"
>that the "real hardware" actually followed, the game can probably be
>repeated indefinitely. There will be a corner case of the real machine
>not following the textbook architecture spec. In an academic way
>that's what makes the whole emulator authoring process so interesting.
>(This is something that the seller of commercial emulators could
>probably never admit in public!)
In another post in this thread I presented the code I use to detect
the SimH and E11 emulators, which I do by examining the behavior of a
wierd little corner of the machine. When I did it I mentally went
through the scenario you outlined. Of course the authors of SimH and
E11 can look at my code and remove the anomalies, or just plain
straight screw me with a different anomaly.
A few years ago I decided implemented RT-11 compatible drivers for my
operating systems. I first got them working on real iron. Later I
tested them on SimH and E11 and found myself altering the drivers to
survive on the emulators. In a sense, I was treating the emulators as
alternate hardware implementations.
The ultimate competitor for PDP-11 emulators is XXDP and it's warrior
diagnostics, which might (if I'm hopeful) explain a little obsession I
have with XXDP. But we can also think of the XXDP test programs as
"emulations" themselves
But you're right. This is a real-world/unreal-world Turing Test living
itself out.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 13:16 ` paramucho
@ 2012-01-21 13:58 ` Bob Eager
2012-01-21 20:02 ` Johnny Billquist
2012-01-22 11:59 ` Johnny Billquist
2 siblings, 0 replies; 222+ messages in thread
From: Bob Eager @ 2012-01-21 13:58 UTC (permalink / raw)
On Sat, 21 Jan 2012 13:16:47 +0000, paramucho wrote:
> 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.
I always did love the wonderful comments in the monitor source; they
encouraged me to do similar in other systems!
--
Use the BIG mirror service in the UK:
http://www.mirrorservice.org
*lightning protection* - a w_tom conductor
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 12:44 ` Tim Shoppa
2012-01-21 13:50 ` paramucho
@ 2012-01-21 14:25 ` glen herrmannsfeldt
2012-01-21 16:46 ` Bob Eager
2012-01-25 22:12 ` Tim Shoppa
1 sibling, 2 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-21 14:25 UTC (permalink / raw)
In vmsnet.pdp-11 Tim Shoppa <tshoppa@gmail.com> wrote:
> On Jan 18, 1:03�am, paramu...@hotmail.com (paramucho) wrote:
>> In any case, an emulator is not equivalent to a processor type since
>> SimH and E11 support a range of PDP-11 CPUs.
> Emulation of interesting (not textbook) machines might be a special
> case of Godel's theorem. Working a lot like Hofstader's example of a
> record that states "This record cannot be played on record player x"
> and Hofstadter's thought of a record-player that has a record-player
> emulator inside it. As soon as the emulator author finds out there's a
> difference between the real world and emulation, such that software on
> the emulated system can know it's not on the real system, the author
> can refine the emulator so the software cannot tell anymore.
Emulators are one thing, virtual machines another. At least as I
understand it, the idea of a virtual machine is running on a similar
host, and only emulating the differences, usually the privileged
instructions. I first saw this described in the 68020 days, as the
68020, if I remember right, allows an unprivileged program to see
the privilege flag bit.
The usual exception, both for user programs running on a variety
of systems, and for systems running in a virtual machine, is that
they shouldn't be time dependent.
> But without a formal and complete definition of the "real hardware"
> that the "real hardware" actually followed, the game can probably be
> repeated indefinitely. There will be a corner case of the real machine
> not following the textbook architecture spec. In an academic way
> that's what makes the whole emulator authoring process so interesting.
> (This is something that the seller of commercial emulators could
> probably never admit in public!)
There is an emulator story I remember from 1976, though not at all the
machine that was being discussed, about how the emulator had to emulate
bugs in the original. I believe that has been repeated over and over
again in the emulation world, both hardware (supposedly compatible
processors that weren't) and software emulation.
I seem to remember some clone 8080 that wouldn't run microsoft basic,
which it seems used some undocumented flag bit.
One big problem in modern emulation of older systems is that they
often run too fast. Timing loops run faster than their author ever
imagined, possibly resulting in divide by zero. An I/O device complete
an I/O operation faster than expected. Things like that. (Or just game
programs that run faster than human responses allow for.)
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 14:25 ` glen herrmannsfeldt
@ 2012-01-21 16:46 ` Bob Eager
2012-01-25 22:12 ` Tim Shoppa
1 sibling, 0 replies; 222+ messages in thread
From: Bob Eager @ 2012-01-21 16:46 UTC (permalink / raw)
On Sat, 21 Jan 2012 14:25:37 +0000, glen herrmannsfeldt wrote:
> One big problem in modern emulation of older systems is that they often
> run too fast. Timing loops run faster than their author ever imagined,
> possibly resulting in divide by zero. An I/O device complete an I/O
> operation faster than expected. Things like that. (Or just game programs
> that run faster than human responses allow for.)
The VAX SIMH is a case in point. The power-on diagnostics in the ROM ran
too fast; it had to be modified so that access to ROM ran more slowly
than to RAM.
--
Use the BIG mirror service in the UK:
http://www.mirrorservice.org
*lightning protection* - a w_tom conductor
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 13:16 ` paramucho
2012-01-21 13:58 ` Bob Eager
@ 2012-01-21 20:02 ` Johnny Billquist
2012-01-22 11:59 ` Johnny Billquist
2 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-21 20:02 UTC (permalink / raw)
On 2012-01-21 14:16, paramucho wrote:
> On Fri, 20 Jan 2012 17:54:16 +0100, Johnny Billquist
> <bqt@softjar.se> wrote:
>
> <snip>
>
>> 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.
[...]
Ah. Thanks. I now see what they do. RT-11 writes to the switch register.
Cool. That works too, but gives a slightly different view and feel to
the idle pattern display used by other OSes. But it avoids using a WAIT.
Nice.
Also noticed that RTEM have an alternative idle loop, which signals out
to the emulator that it should go idle. Makes sense, as RTEM is not a
CPU emulator...
>> 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.
Ah. My mistake. I was thinking that you patched RT-11 to signal the idle
condition. I must admit that hadn't given RUST much thought, nor do I
know pretty much anything about them, except what you have mentioned a
few times. :-)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 12:25 ` paramucho
@ 2012-01-21 20:15 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-21 20:15 UTC (permalink / raw)
On 2012-01-21 13:25, paramucho wrote:
> On Fri, 20 Jan 2012 17:48:57 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>
>>>> How do you detect emulation or a DEC programmable clock this way?
>>>
>>> The other conditions aren't detected with a timing loop...you seem to
>>> be talking about general detection and timing-loop detection all at
>>> the same time...or are we in alternate universes again...
>>
>> I was responding to your comment above, which I did include above my
>> question. You said you detect other conditions, including emulators and
>> the presence of a DEC programmable clock.
>> So I just asked how you detected those ones. I thought that was a very
>> straight forward question.
>
> I was confused because you asked how I detected emulation or a
> programmable clock "this way", which sounded like you were asking how
> I detected them using a timer loop.
>
> I posted the code for the emulation detection earlier in this thread.
> My strategy, from memory, is to write some values into MMU SR0 and
> then look at the results. It's not a particularly great test for a
> couple of reasons.
[...]
Gotcha.
> (3) I don't perform the test if there's a bootstrap module at I/O
> pagte 173000. Neither SimH or E11 emulate the device, or at least, not
> by default. I don't know why I implemented that restriction. O/S's are
> just conservative by nature.
Right. However, E11 (or rather JW) did provide me with one, as I had a
customer who had the monitoring code in RSX patched to jump to 173000 if
some component of the system failed in a fatal way, to make the system
reboot. Easiest when we moved them to E11 was to make sure we had a boot
rom which worked in E11 located at that address. So I have a couple of
E11 machines with data in those addresses. :-)
> The programmable clock is detected just like all the other system
> registers: you look to see if the I/O address of the relevant CSR
> answers. There's nothing particularly fancy going on. I managed to put
> together some reasonably well-tested detection code back in the 80s
> and I still rely on it these days. The good thing about having
> customers was that you got a lot of testing done...
Ah! That was too easy. :-)
>> There is even one or two machines that have a display that can show
>> values, but as far as I can remember, didn't work with a switch register
>> CSR (the 11/60 being one, if I remember right). So actually writing to
>> the switch register wasn't possible, but having idle loops on the system
>> show some pattern on the front panels were rather popular... And I
>> thought the RT-11 also did, but looking at the code, I'm unclear if
>> RT-11 did, and if it did, then how...
>
> See my detailed reponse in my other reply.
Yup. And the answer was/is that RT-11 write to the switch register CSR.
>>> It's not necessary for a system to use every feature provided by the
>>> hardware architecture. For example, the original planned use of
>>> interrupt vectors has essentially been ignored by RT-11 and RSX for
>>> years which uniformly take interrupts at PR7 and then lower priority
>>> to the device level rather than letting the vector do that job as
>>> originally planned. Then there's the PDP-11 virtual memory feature,
>>> not to forget MARK.
>>
>> The PDP-11 virtual memory is extensively used by most OSes on the
>> PDP-11. Are you thinking of the potential on some machines to implement
>> demand paging?
>
> Yes, demand paging. There for the taking. Has any system ever used it?
I have never seen any software make use of the possibility of demand
paging. Virtual memory however, is something most of them use. These two
things are not the same, but lots of people (and even Wikipedia) confuse
the two.
> I sometimes think about giving it a shot.
Hehe. Me too... It is tempting. Just as a proof of concept (atleast for me).
But I can't remember straight off my head if I figured this needed all
the access modes provided by the 11/70 MMU, or if you could make do with
the limited functionality of the J11 MMU.
I seem to remember that the 11/70 style was needed, but it might be that
it would just make life much easier.
>>> Are we done yet? Can we find something else to chew? :-)
>>
>> I'm almost never done. Haven't you figured that out yet? :-)
>
> We definitely need a bigger bone.
Point me to it...
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 13:16 ` paramucho
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
2 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-22 11:59 UTC (permalink / raw)
By the way, a reflection here. I note that the coding style in RT-11 is
rather different than in RSX. They seem much more "hackish" in RT-11.
Making use of all kind of shortcuts and tricky solutions. Lots of mixing
of data and code everywhere. Interesting, and rather different from what
I'm used to.
But it also makes it hopeless to ever have split I/D space. Did anything
in RT-11 ever used split I/D space?
Johnny
On 2012-01-21 14.16, paramucho wrote:
> 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
>
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-22 11:59 ` Johnny Billquist
@ 2012-01-22 14:03 ` paramucho
2012-01-22 16:15 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-22 14:03 UTC (permalink / raw)
On Sun, 22 Jan 2012 12:59:14 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>By the way, a reflection here. I note that the coding style in RT-11 is
>rather different than in RSX. They seem much more "hackish" in RT-11.
>Making use of all kind of shortcuts and tricky solutions. Lots of mixing
>of data and code everywhere. Interesting, and rather different from what
>I'm used to.
>
>But it also makes it hopeless to ever have split I/D space. Did anything
>in RT-11 ever used split I/D space?
In the unmapped monitors RT-11 programs and the O/S have had to
cohabit the same 28kw address space, so there has been enormous space
pressure on the system. Anything which saves a word of memory goes.
RT-11 developers were often given the job of just saving a few words
so that more functionality could be fitted into a fixed space.
Because of these constraints the code looks "hackish", however, these
hacks are not the result of hasty or sloppy thinking or individual
programmers doing their own thing. The RT-11 team remained fairly
constant over the years and knew the code intimately. I visited
Maynard a couple of times and was given a desk at the Mill and invited
to join some of their regular meetings in which functionality was
proposed, discussed and decided. They weren't cowboys.
The mixture of code and data is not as uncontrolled as it looks. At
one point RT-11 supported a ROMable monitor by using conditionals.
The RT-11 mapped monitor (RT-11/XM) is built on the same code base as
the unmapped montors. The later XM monitors support "virtual jobs"
which allows programs to run in their own full address spaces by
emulating RT-11 within RT-11, and with V5.6 they implemented I/D space
and supported supervisor mode. I can't say much more about it than
that because I have yet to examine the code.
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-22 14:03 ` paramucho
@ 2012-01-22 16:15 ` Johnny Billquist
2012-01-23 4:14 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-22 16:15 UTC (permalink / raw)
On 2012-01-22 15:03, paramucho wrote:
> On Sun, 22 Jan 2012 12:59:14 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> By the way, a reflection here. I note that the coding style in RT-11 is
>> rather different than in RSX. They seem much more "hackish" in RT-11.
>> Making use of all kind of shortcuts and tricky solutions. Lots of mixing
>> of data and code everywhere. Interesting, and rather different from what
>> I'm used to.
>>
>> But it also makes it hopeless to ever have split I/D space. Did anything
>> in RT-11 ever used split I/D space?
>
> In the unmapped monitors RT-11 programs and the O/S have had to
> cohabit the same 28kw address space, so there has been enormous space
> pressure on the system. Anything which saves a word of memory goes.
> RT-11 developers were often given the job of just saving a few words
> so that more functionality could be fitted into a fixed space.
>
> Because of these constraints the code looks "hackish", however, these
> hacks are not the result of hasty or sloppy thinking or individual
> programmers doing their own thing. The RT-11 team remained fairly
> constant over the years and knew the code intimately. I visited
> Maynard a couple of times and was given a desk at the Mill and invited
> to join some of their regular meetings in which functionality was
> proposed, discussed and decided. They weren't cowboys.
Oh! I didn't want to imply that it was sloppish. My usual experience is
that you need to keep your tongue even more straight in your mouth when
your code is tricky. Becoming sloppy at that point is an almost sure way
of getting into very bad bugs and unusable systems.
But a thing like:
DEC (PC)+ ;The RT-11 lights routine!
LITECT: .WORD 1
BNE ..NULJ ;Not too often
ADD #<512.>,LITECT ;Reset count, clear carry
is both tricky, and totally non-functioning if you have split I/D space.
(Just as one example from the code you posted.)
Neat and efficient, though. But not something you'd see in RSX, and not
something I would write myself.
Different style, as I said.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
0 siblings, 2 replies; 222+ messages in thread
From: Tim Shoppa @ 2012-01-22 16:56 UTC (permalink / raw)
On Jan 21, 8:50 am, paramu...@hotmail.com (paramucho) wrote:
> On Sat, 21 Jan 2012 04:44:37 -0800 (PST), TimShoppa
>
>
>
>
>
>
>
>
>
> <tsho...@gmail.com> wrote:
> >On Jan 18, 1:03 am, paramu...@hotmail.com (paramucho) wrote:
> >> In any case, an emulator is not equivalent to a processor type since
> >> SimH and E11 support a range of PDP-11 CPUs.
>
> >Emulation of interesting (not textbook) machines might be a special
> >case of Godel's theorem. Working a lot like Hofstader's example of a
> >record that states "This record cannot be played on record player x"
> >and Hofstadter's thought of a record-player that has a record-player
> >emulator inside it. As soon as the emulator author finds out there's a
> >difference between the real world and emulation, such that software on
> >the emulated system can know it's not on the real system, the author
> >can refine the emulator so the software cannot tell anymore.
>
> >But without a formal and complete definition of the "real hardware"
> >that the "real hardware" actually followed, the game can probably be
> >repeated indefinitely. There will be a corner case of the real machine
> >not following the textbook architecture spec. In an academic way
> >that's what makes the whole emulator authoring process so interesting.
> >(This is something that the seller of commercial emulators could
> >probably never admit in public!)
>
> In another post in this thread I presented the code I use to detect
> the SimH and E11 emulators, which I do by examining the behavior of a
> wierd little corner of the machine. When I did it I mentally went
> through the scenario you outlined. Of course the authors of SimH and
> E11 can look at my code and remove the anomalies, or just plain
> straight screw me with a different anomaly.
That sort of adversarial mindset is what permeates Hofstadter's "this
record cannot be played on record player X" discussions too.
But just like Hofstadter's examples, I don't think the activity is
actually adversarial, I think it's more exploratory. When we discover
anomalies of a 40 year old machine that had never been documented
before, maybe that's how an archaeologist feels? The folks living in
ancient civilization never had the advantage of our mindset and
perspective, when they looked at their own cultures. That doesn't make
us superior to them but it might give us some context as to what's
going on in today's civiliazations.
Tim.
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-22 16:56 ` Tim Shoppa
@ 2012-01-22 18:11 ` glen herrmannsfeldt
2012-01-23 3:52 ` paramucho
1 sibling, 0 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-22 18:11 UTC (permalink / raw)
In vmsnet.pdp-11 Tim Shoppa <shoppa@trailing-edge.com> wrote:
(snip)
> That sort of adversarial mindset is what permeates Hofstadter's "this
> record cannot be played on record player X" discussions too.
> But just like Hofstadter's examples, I don't think the activity is
> actually adversarial, I think it's more exploratory. When we discover
> anomalies of a 40 year old machine that had never been documented
> before, maybe that's how an archaeologist feels?
The person who gave me my first "System/370 Principles of Operation"
when I was in high school calls what we do compuarchaeology.
(I believe as one word.)
> The folks living in
> ancient civilization never had the advantage of our mindset and
> perspective, when they looked at their own cultures. That doesn't make
> us superior to them but it might give us some context as to what's
> going on in today's civiliazations.
And same for computer architecture.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-22 16:56 ` Tim Shoppa
2012-01-22 18:11 ` glen herrmannsfeldt
@ 2012-01-23 3:52 ` paramucho
1 sibling, 0 replies; 222+ messages in thread
From: paramucho @ 2012-01-23 3:52 UTC (permalink / raw)
On Sun, 22 Jan 2012 08:56:12 -0800 (PST), Tim Shoppa
<shoppa@trailing-edge.com> wrote:
>On Jan 21, 8:50�am, paramu...@hotmail.com (paramucho) wrote:
>> On Sat, 21 Jan 2012 04:44:37 -0800 (PST), TimShoppa
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> <tsho...@gmail.com> wrote:
>> >On Jan 18, 1:03�am, paramu...@hotmail.com (paramucho) wrote:
>> >> In any case, an emulator is not equivalent to a processor type since
>> >> SimH and E11 support a range of PDP-11 CPUs.
>>
>> >Emulation of interesting (not textbook) machines might be a special
>> >case of Godel's theorem. Working a lot like Hofstader's example of a
>> >record that states "This record cannot be played on record player x"
>> >and Hofstadter's thought of a record-player that has a record-player
>> >emulator inside it. As soon as the emulator author finds out there's a
>> >difference between the real world and emulation, such that software on
>> >the emulated system can know it's not on the real system, the author
>> >can refine the emulator so the software cannot tell anymore.
>>
>> >But without a formal and complete definition of the "real hardware"
>> >that the "real hardware" actually followed, the game can probably be
>> >repeated indefinitely. There will be a corner case of the real machine
>> >not following the textbook architecture spec. In an academic way
>> >that's what makes the whole emulator authoring process so interesting.
>> >(This is something that the seller of commercial emulators could
>> >probably never admit in public!)
>>
>> In another post in this thread I presented the code I use to detect
>> the SimH and E11 emulators, which I do by examining the behavior of a
>> wierd little corner of the machine. When I did it I mentally went
>> through the scenario you outlined. Of course the authors of SimH and
>> E11 can look at my code and remove the anomalies, or just plain
>> straight screw me with a different anomaly.
>
>That sort of adversarial mindset is what permeates Hofstadter's "this
>record cannot be played on record player X" discussions too.
Combatting that mindset is one reason I posted my "secret" code. I
would have had real difficulties doing that at certain times in the
past.
As another example, in music we think of the progress of a piece as a
kind of competition between opposite poles of the "tonic" and
"dominant", but in another culture the adversarial "dominant" is
thought of as the collegial "companion".
>But just like Hofstadter's examples, I don't think the activity is
>actually adversarial, I think it's more exploratory. When we discover
>anomalies of a 40 year old machine that had never been documented
>before, maybe that's how an archaeologist feels? The folks living in
>ancient civilization never had the advantage of our mindset and
>perspective, when they looked at their own cultures. That doesn't make
>us superior to them but it might give us some context as to what's
>going on in today's civiliazations.
The exploration is mutual. In a sense, an emulator is a program which
runs *on* the systems it emulates.
I think sometimes that the emulation process receives its legitimation
from both the complexity of the emulated process and from the human
effort previously expended on the original objects, i.e. the original
software and hardware. I'm exploring that a little bit, in a sense, by
writing *new* code for the objects: is the new code as valid as the
historic code?
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-22 16:15 ` Johnny Billquist
@ 2012-01-23 4:14 ` paramucho
0 siblings, 0 replies; 222+ messages in thread
From: paramucho @ 2012-01-23 4:14 UTC (permalink / raw)
On Sun, 22 Jan 2012 17:15:48 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-01-22 15:03, paramucho wrote:
>> On Sun, 22 Jan 2012 12:59:14 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>>> By the way, a reflection here. I note that the coding style in RT-11 is
>>> rather different than in RSX. They seem much more "hackish" in RT-11.
>>> Making use of all kind of shortcuts and tricky solutions. Lots of mixing
>>> of data and code everywhere. Interesting, and rather different from what
>>> I'm used to.
>>>
>>> But it also makes it hopeless to ever have split I/D space. Did anything
>>> in RT-11 ever used split I/D space?
>>
>> In the unmapped monitors RT-11 programs and the O/S have had to
>> cohabit the same 28kw address space, so there has been enormous space
>> pressure on the system. Anything which saves a word of memory goes.
>> RT-11 developers were often given the job of just saving a few words
>> so that more functionality could be fitted into a fixed space.
>>
>> Because of these constraints the code looks "hackish", however, these
>> hacks are not the result of hasty or sloppy thinking or individual
>> programmers doing their own thing. The RT-11 team remained fairly
>> constant over the years and knew the code intimately. I visited
>> Maynard a couple of times and was given a desk at the Mill and invited
>> to join some of their regular meetings in which functionality was
>> proposed, discussed and decided. They weren't cowboys.
>
>Oh! I didn't want to imply that it was sloppish. My usual experience is
>that you need to keep your tongue even more straight in your mouth when
>your code is tricky. Becoming sloppy at that point is an almost sure way
>of getting into very bad bugs and unusable systems.
>
>But a thing like:
>
> DEC (PC)+ ;The RT-11 lights routine!
>LITECT: .WORD 1
> BNE ..NULJ ;Not too often
> ADD #<512.>,LITECT ;Reset count, clear carry
>
>is both tricky, and totally non-functioning if you have split I/D space.
>(Just as one example from the code you posted.)
>
>Neat and efficient, though. But not something you'd see in RSX, and not
>something I would write myself.
>Different style, as I said.
I mentioned above that a ROM version of RT-11 was released in the 80s.
For that version of the monitor the code would have read:
.ROM DEC LITECT,VALUE=1
Which would have expanded to the inline data for the non-ROM version,
as above,
DEC (PC)+
LITECT: .WORD 1
or to a data area reference for the ROM version, roughly:
.SAVE
.PSECT RTDATA
LITECT: .WORD 1
.RESTORE
DEC LITECT
But somewhere around V5.6 the .ROM macros were removed and the
original non-ROM inline code was reinstated. I/D support was added at
the same time, I think. So, I guess the I/D separation applies only to
user mode applications, not to the kernel. That would make sense
because I can't see how existing RT-11 device drivers could be easily
modified support I/D space.
As I said, I haven't looked at it in detail. Back in the eighties I
would have felt compelled to add compatible I/D space support to
SHAREplus (as RUST/XM was called then), but RT-11 V5.6, which was the
last DEC release, had a very low customer take-up and I don't think
there's more than a handful of apps out there which use the feature.
So, it's way down my TODO list.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-21 14:25 ` glen herrmannsfeldt
2012-01-21 16:46 ` Bob Eager
@ 2012-01-25 22:12 ` Tim Shoppa
1 sibling, 0 replies; 222+ messages in thread
From: Tim Shoppa @ 2012-01-25 22:12 UTC (permalink / raw)
On Jan 21, 9:25 am, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> In vmsnet.pdp-11 Tim Shoppa <tsho...@gmail.com> wrote:
>
> > On Jan 18, 1:03 am, paramu...@hotmail.com (paramucho) wrote:
> >> In any case, an emulator is not equivalent to a processor type since
> >> SimH and E11 support a range of PDP-11 CPUs.
> > Emulation of interesting (not textbook) machines might be a special
> > case of Godel's theorem. Working a lot like Hofstader's example of a
> > record that states "This record cannot be played on record player x"
> > and Hofstadter's thought of a record-player that has a record-player
> > emulator inside it. As soon as the emulator author finds out there's a
> > difference between the real world and emulation, such that software on
> > the emulated system can know it's not on the real system, the author
> > can refine the emulator so the software cannot tell anymore.
>
> Emulators are one thing, virtual machines another.
That's an interesting tack. Hofstadter's analogy was the record player
that had a record player emulator in it, such that any damage a record
might do, can be found before being played on the real machine. You
want the emulated machine inside to be as much like the real one as
possible, but you don't want the real record player to be broken just
because the record broke the emulated record player.
Hofstadter seemed at least a little resigned to how the emulated
record player would never be quite like the real thing. But the
virtual machine seems to erase many lines. If the record breaks the
virtual machine does it also break the real machine (since the virtual
machine is in fact the real machine?)
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 11:20 ` Johnny Billquist
@ 2012-01-26 3:21 ` Jerome H. Fine
2012-01-26 14:12 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-26 3:21 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 10514 bytes --]
>Johnny Billquist wrote:
> I'm not entirely sure what your question is, Jerome...
> But I'll make some comments anyway.
Very much appreciated. I was away for a week. I am catching up now.
> On 2012-01-15 15:37, Jerome H. Fine wrote:
>
>> I have an interesting hardware question.
>>
>> I have been looking at the results for the program RESORC.SAV in RT-11
>> with respect the MFPT instruction. When the J11 chip is used, the value
>> is 5 and the Maintenance Register at 177750 seems to determine what the
>> rest of the actual hardware supports.
>
> Correct.
>
>> I thought it would also be helpful for the user to know if an
>> emulator is being
>> used, either software or hardware, or if perhaps some other 3rd party
>> hardware
>> CPU. I would probably target the various 3rd party boards as far as
>> hardware
>> is concerned (such as QED and Mentec). For software emulators, I would
>> suggest that only the high end PDP-11 processors be supported (the DEC
>> CPUs which support the MFPT instruction) in order to keep things simple,
>> at least initially.
>
> If an emulator wants to truly emulate a specific CPU, then you cannot
> just go and change the behavior of the emulator, since you will break
> the basic idea behind it.
> As far as different implementations goes, what is the difference
> between an emulator and a "real" CPU? Both are running code to
> implement the PDP-11 architecture. It's just that if the emulator is
> running on an x86 (for example), the microcode happens to be identical
> to x86 assembler, whilst the J11 (for example) have a microcode CPU
> which we don't know much about, but it still executes the microcode
> instructions...
I actually agree with you. The only reason that I mention the
MFPT instruction is that RT-11 ignores the high order byte
and I thought that I would ask if RSX-11 also ignores the
high order byte, along perhaps with RSTS/E.
>> An incomplete list of software emulators is:
>> SIMH
>> Ersatz-11
>>
>> An incomplete list of hardware boards is:
>> QED - more than 1?
>> Mentec - at least 3
>> and I can remember at least 2 others, but not the company names.
>
> You have Strobe Data, which I'm sure you'll remember now that I
> mention them.
Yes. I seem to remember they were first. Do you classify them as
a hardware or software emulator? If my hazy memory is correct,
Strobe Data initially used the J11 chip on a board that plugged
into an ISA slot on a DOS machine. Later, the J11 chips were
very difficult to obtain, so Strobe Data managed to do something
else.
When I first saw the emulation actually running RT-11, I was very
surprised.
Does anyone know how many boards and the names that
QED and Mentec produced. Also, does the name Nissho
ring a bell? I think they were a Unibus hardware emulator
or were they just high speed memory?
>> Right now the Logical Co. has a combined emulator called a
>> PDQ-1000 board which actually plugs into a Qbus which takes
>> only 4 slots, but includes CPU, memory and many controllers.
>
> Yes... And...?
The reason that I specifically mention the PDQ-1000 is that while
it seems like a hardware emulator (since the final result is a Qbus
board), inside the hardware is actually a software emulator.
>> Thus far, the high order byte of the MFPT instruction always seems
>> to be zero and is currently ignored by the RESORC.SAV program.
>> Under SIMH and Ersatz-11, it would be trivial to use the high order
>> byte of the MFPT instruction to signify which software emulator is
>> being used.
>
> Right, except then they wouldn't truthfully emulate a J11.
>
> And basing your design on how one application in RT-11 works seems
> like an extremely bad idea.
I had my doubts as well, so I do agree with you. But if no one else
uses the high order byte of MFPT, then it might be possible to
set a standard.
>> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>> available determine the actual value returned by the MFPT instruction?
>> As far as I know:
>>
>> MFPT Value Hardware
>> 1 PDP-11/44
>> 3 PDP-11/24 (should be 2)
>> 3 PDP-11/23
>> 4 SBC-11/21
>> 5 All J11 chips including 11/73, 11/83, 11/93
>
> That is all the values that MFPT can return. (Or rather - all the
> values that were returned by any CPUs designed by DEC.)
Understood. It would have been "nice" if DEC had supported
a more open concept, but since probably at least 50% (maybe
over 90%) of the emulators in use are SIMH and Ersatz-11,
it is probably not all that important any more.
>> I assume that it would be extremely difficult, probably not worth the
>> effort, to modify the high order byte of the MFPT instruction at this
>> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>
> Some Mentec boards use a J11. You can guess what they return. For the
> other boards, they also seem to pretend to be J11 CPUs, which is a bit
> sad, but that can't be helped.
And of course, the result is that they reported a particular DEC
CPU as being used. What were the names of all of the Mentec
boards and their primary difference from each other?
>> Can anyone comment on this assumption? Might there be another
>> way for hardware to the tell a user which 3rd party board is being
>> used as a PDP-11?
>
> Please differ between which *board* is being used, as opposed to which
> CPU. MFPT will only tell you which CPU is used, not which board.
Yes, you are correct. Even DEC used the J11 chip
on many different boards.
I have the impression that it would no longer be either
useful or reasonable to attempt to identify any Mentec
or QED boards at this point.
>> The other possibility is to use the Maintenance Register at 177750,
>> although I suspect that there might not be any more bit available.
>
> That register is specifically designed to tell you which board you
> have, as opposed to MFPT, which tells which CPU.
> And yes, there are bits left.
> In the mainenance register, you have 4 bits allocated to system type.
> (Note, not CPU type, system type.)
> 0 - 11/73
> 1 - J11-A (M11, N11)
> 2 - KDJ11-B (11/73, 11/83)
> 3 - KXJ11 (11/73)
> 4 - 11/53
> 5 - 11/93
>
> This I collected from the system identification code in RSX. The 0 is
> not explicitly stated to be an 11/73, rather, the code checks for the
> values 1-5, and if none of those, it assumes it is an 11/73. I very
> much doubt any DEC boards ever used any codes above 5, although you
> can have up to 15.
>
> The CPU identification code in RSX is very useful to read on how to
> identify what kind of system it is.
>
> Essentially, it goes like this:
> 1) Check if the SYSID registers exist
> 1.1) If yes, this is an 11/70 or 11/74.
> 1.2) Check if high bit of PDR is usable.
> 1.3) If yes, this is an 11/74. If no, this is an 11/70
> 2) Try MFPT
> 2.1) If it worked, we have a basic idea of system
> 2.2) 1 - 11/44
> 2.3) 3 - Possibly 11/23B or 11/24
> 2.3.1) Read maintenance register
> 2.3.2.1) If that succeded - check if bits 4-7
> 2.3.2.2) If 4-7 = 0 it is an XT system. Treat as unknown system.
> 2.3.3) Try writing to SWR
> 2.3.3.1) If that fails - system is an 11/23B
> 2.3.3.2) If that succeeds - system is an 11/24
> 2.4) 5 - J11 Based machine
> 2.4.1) Read maintenance register, look at bits 4-7
> 2.4.1.1) If that fails - unknown machine
> 2.4.1.2) 4 - 11/53
> 2.4.1.3) 3 - KXJ11 based 11/73
> 2.4.1.4) 1 - Real J11-A?
> 2.4.1.4.1) Check if writing to kernel PDR7 change state of W bit of
> register to written.
> 2.4.1.4.1.1) If yes, we have an M11
> 2.4.1.4.2) Try MED instruction
> 2.4.1.4.2.1) If it works, we have an N11
> 2.4.1.4.3) Unknown type of CPU
> 2.4.1.5) 2 - KDJ11-B type. (11/83, 11/84)
> 2.4.1.6) 5 - KDJ11-E-type. (11/93, 11/94) (Codenamed Thunderbird
> apparently)
> 2.4.1.7) All others are called 11/73 (But the code will actually store
> model as 11/9x)
> 3) If MFPT fails, M+ states that system must be 11/60, 11/34, 11/45,
> LSI-11, 11/04, 11/05, 11/10, 11/15, 11/20 or 11/40.
> 3.1) Check 11/60 MED instruction
> 3.1.1) If that works, it is an 11/60
> 3.2) Check 11/34 MFPS instruction
> 3.2.1) If that works, it is an 11/34
> 3.3) Check 11/45 PIRQ register
> 3.3.1) If that exist, it is an 11/45
> 3.4) Of the rest, RSX-11M-PLUS only works on the 11/40
>
> Also, for the machines which both have Qbus and Unibus variants, the
> code then goes on to check if the machine have a Unibus map, and if
> so, changes it to the Unibus version of the CPU.
>
> All with the reservation that I might have missed something, written
> something down wrong in my transcribing the code into the rules above,
> and that this is obviously not enough to actually implement it, since
> the details for some of these steps are rather intricate in actual
> execution.
>
> Anyway. If you have something that intends to implement a J11, it
> should do the same thing a J11 does, which means MFPT should return 5.
> Anything else is bad.
> The maintenance register is a possible place to put something else in,
> if you just want to identify your actual system differently, but once
> more, if you really want to emulate an existing system, you cannot
> touch that register either.
>
> If you want some "foolproof" way of detecting that you are inside an
> emulated machine, I'd say that adding a new instruction from the
> unused opcodes is probably a better idea. I wouldn't expect anything
> to actually try using an undefined opcode anyway, so no existing code
> should be hurt by it. And your "new" code will also work on real
> machines, in that you will instead get a trap if you try that instruction.
Your suggestion to use an instruction code which is presently
illegal is actually almost trivial in Ersatz-11. John Wilson explicitly
supports adding code for new instructions. Well, I guess it
is not exactly trivial, but I could probably write and test the
code for the required DLL in less than a week.
I imagine the same would apply to SIMH. it would be useful
if there could be an agreement on a standard!!!!!!!!!!!!!
Other emulators or 3rd party hardware implementations which
are no longer supported by their original manufacturers would be
much more difficult, if not impossible, at this point.
What about RUST? Could that support a new instruction as well?
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 12414 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 6:03 ` paramucho
` (2 preceding siblings ...)
2012-01-21 12:44 ` Tim Shoppa
@ 2012-01-26 3:22 ` Jerome H. Fine
2012-01-26 13:46 ` paramucho
3 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-26 3:22 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 4256 bytes --]
>paramucho wrote:
>>On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine" wrote:
>
>>I have an interesting hardware question.
>>
>>I have been looking at the results for the program RESORC.SAV in RT-11
>>with respect the MFPT instruction. When the J11 chip is used, the value
>>is 5 and the Maintenance Register at 177750 seems to determine what the
>>rest of the actual hardware supports.
>>
>>I thought it would also be helpful for the user to know if an emulator
>>is being
>>used, either software or hardware, or if perhaps some other 3rd party
>>hardware
>>CPU. I would probably target the various 3rd party boards as far as
>>hardware
>>is concerned (such as QED and Mentec). For software emulators, I would
>>suggest that only the high end PDP-11 processors be supported (the DEC
>>CPUs which support the MFPT instruction) in order to keep things simple,
>>at least initially.
>>
>>
><snip>
>
>Modifying the MFPT instruction is not the right way to go. CPU
>software detection is a delicate business and that process should not
>be interfered with directly.
>
>
As I already answered with Johnny, I have my own
doubts for using MFPT. I do like his suggestion of a
currently illegal instruction code (a new hardware
instruction) which an actual DEC J11 chip would
need to trap.
>In any case, an emulator is not equivalent to a processor type since
>SimH and E11 support a range of PDP-11 CPUs.
>
>
And having a new instruction would be very easy
Ersatz-11. I suspect that SIMH would also be
very easy. What about RUST?
>Some CPU software detection is handled by examining CPU behavior. The
>same process can be used to detect an emulator and to determine which
>emulator is being used.
>
>
It would even be possible to tell the user details of
the emulator environment. There would need to be
some sort of standard. Any suggestions?
>I currently use some of the behavior of the MMU SR0 and SR1 to detect
>emulators in RUST. Clearly, these tests only work when E11 and SIMH
>are emulating a machine with MMU, but that's their default state and
>there's not much point running RUST in other configurations. Here's
>some of the code:
>
>bt$emu: call tr$cat ; capture traps
>
> ... ; skip V11 checks
>
> mov #m$msr0,r0 ; emulator check
> mov #m$msr1,r1 ;
> tst (r1) ; got MMU with SR1 etc?
> bcs 40$ ; nope
> clr (r0)+ ; clear SR0 with increment
> bis #160000,-(r0) ; overwrite and freeze
>
> cmpb (r1),#27 ; SIMH magic number
> bne 10$ ; not SIMH
> btwar$ <Emulator detected: SIMH>;
> br 20$ ;
> ;
>10$: mov #340,(r0) ; SR0 = 340
> cmpb (r0),#140 ; E11 magic number
> bne 30$ ; not E11
> btwar$ <Emulator detected: E11>; (misses some read-only bits)
> ;
>20$: inc b$temu ; is emulator
> ;
>30$: clr (r0) ; make them all clean again
> clr (r1) ;
>40$: call tr$res ; restore traps
> return
>
>There is more code which checks for my V11 emulator. That check is
>done with a hacked IOT instruction.
>
>The reason I need detection is because emulators lack standard
>terminal output behavior which I use during startup to detect the
>clock rate of a PDP-11 (I count the number of null characters output
>to the console terminal per clock tick and use a table to determine
>both the clock rate and the terminal rate). The test doesn't work on
>E11, SIMH or V11.
>
>In fact, the V11 emulator has a little API which is used to pass
>information between the emulator and the system. It's used to
>relinquish control so that the emulator doesn't hog all the CPU time
>and for various other functions. It would be great if there was a
>common API for PDP-11 emulators for this kind of thing, but I'm not
>sure the motivation is there for the effort involved.
>
I don't think that the about properties (or at least how
the PDP-11 instructions react to the above code) has
been documented under Ersatz-11. I would imagine
that the source code could be used under SIMH to
figure out why the above code is needed.
I am VERY curious!!!!!!!!! How did you figure out the
code for Ersatz-11? Did John Wilson help? Does the
above code still work with V6.0 of E11?
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 5217 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 13:05 ` glen herrmannsfeldt
2012-01-18 13:26 ` Johnny Billquist
@ 2012-01-26 3:23 ` Jerome H. Fine
1 sibling, 0 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-26 3:23 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 2420 bytes --]
>glen herrmannsfeldt wrote:
>(snip, someone wrote)
>
>
>>>>I have been looking at the results for the program RESORC.SAV in RT-11
>>>>with respect the MFPT instruction. When the J11 chip is used, the value
>>>>is 5 and the Maintenance Register at 177750 seems to determine what the
>>>>rest of the actual hardware supports.
>>>>
>(snip, someone else wrote)
>
>
>>>Modifying the MFPT instruction is not the right way to go. CPU
>>>software detection is a delicate business and that process should not
>>>be interfered with directly.
>>>
>>>In any case, an emulator is not equivalent to a processor type since
>>>SimH and E11 support a range of PDP-11 CPUs.
>>>
>>Also right. And each CPU behaves differently, and the emulator needs to
>>follow that, or it is broken.
>>
>Or, the emulator can emulate a CPU model different from any previously
>built. That usually at least happens in that the emulator runs at a
>different speed than any real processor.
>
>
My suggestion would be to treat the speed difference
separately from the CPU and board being emulated.
NOTE that with Ersatz-11, it is almost trivial to
specify a particular CPU and board which was
NEVER produced.
As for the speed difference, that aspect seems quite
important since it is possible for Ersatz-11 to run
RT-11 at a speed which is more than 100 times
the speed of a DEC PDP-11/93 and that is just
the CPU speed. The disk I/O can easily be more
than 200 times the speed of any disk drive which
was available on a real DEC PDP-11/93.
>>>Some CPU software detection is handled by examining CPU behavior. The
>>>same process can be used to detect an emulator and to determine which
>>>emulator is being used.
>>>
>>Right. I just posted an outline of how RSX-11M+ detects system type.
>>It's a combination of available information as well as CPU behavior in
>>very weird and possibly not documented ways.
>>
>I have seen the rules for detecting different x86 CPUs, from 8086 and
>8088 on up. Some are pretty strange, though usually documented at least
>as needed for detection.
>
As has been pointed out, however, an emulator
like Ersatz-11 or SIMH actually emulates MANY
different CPUs and boards. So the suggestion
that Johnny made to use a new CPU instruction
does seem very helpful. Does anyone else agree?
What sort of standards might be helpful to use?
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 3763 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-18 13:26 ` Johnny Billquist
@ 2012-01-26 3:24 ` Jerome H. Fine
2012-01-26 13:38 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-26 3:24 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1860 bytes --]
>Johnny Billquist wrote:
>>>>> I have been looking at the results for the program RESORC.SAV in
>>>>> RT-11
>>>>> with respect the MFPT instruction. When the J11 chip is used, the
>>>>> value
>>>>> is 5 and the Maintenance Register at 177750 seems to determine
>>>>> what the
>>>>> rest of the actual hardware supports.
>>>>
>>>> Modifying the MFPT instruction is not the right way to go. CPU
>>>> software detection is a delicate business and that process should not
>>>> be interfered with directly.
>>>
>>>> In any case, an emulator is not equivalent to a processor type since
>>>> SimH and E11 support a range of PDP-11 CPUs.
>>>
>>> Also right. And each CPU behaves differently, and the emulator needs to
>>> follow that, or it is broken.
>>
>> Or, the emulator can emulate a CPU model different from any previously
>> built. That usually at least happens in that the emulator runs at a
>> different speed than any real processor.
>
> Right.
> And yes, that could definitely be done, at which point I think a new
> value returned by MFPT would be reasonable.
We seem to have travelled full circle. As I mentioned,
Ersatz-11 (under an Intel CPU such as an E8200)
can run RT-11 over 100 times as fast as on a PDP-11/93.
That would certainly qualify as being faster!!!!!!!
But your original suggestion of using a new
CPU instruction actually appeals to me.
Can anyone suggest some standards for which
emulators could be used as well as any additional
information like CPU speed or additional memory?
For example, Ersatz-11 supports direct access to
more than a GB of the memory on the PC via a
PDP-11 IOPAGE register at access speeds only
about 3 times the time to access regular memory.
I even have FORTRAN callable subroutines under
RT-11 which support these memory references.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 2825 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-20 13:29 ` paramucho
2012-01-20 16:48 ` Johnny Billquist
@ 2012-01-26 3:25 ` Jerome H. Fine
2012-01-26 6:09 ` paramucho
2012-01-26 13:46 ` Johnny Billquist
1 sibling, 2 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-26 3:25 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 944 bytes --]
>paramucho wrote:
>The 800hz option isn't present on the 11/73. It's not documented in
>the CPU guide and I note that SimH only provides the "JCLK" option for
>the 8x and 9x CPUs but not for the 73.
>
>In any case, since the option settings for 50/60/800 hz are visible in
>a processor register (xx177520) I don't need to detect the setting in
>a timing loop. It's just a matter of a CPU and CSR detect.
>
Do you have a manual name and page number which
specifies 177520 and the name of the register.
I am curious what else might be in that manual
which may have information.
I note that the Page Control Register is at 177520,
so I am extremely curious as to how that register
also holds the clock rate. Using a PDP-11/83,
177520 is set at 4000 for 60 and 800 Hz and
at 2000 for 50 Hz when I run Ersatz-11. I don't
have my DEC PDP-11/83 working at the
moment, so I can't use the real DEC hardware.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 1536 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 3:25 ` Jerome H. Fine
@ 2012-01-26 6:09 ` paramucho
2012-01-26 6:30 ` paramucho
2012-01-26 13:48 ` Johnny Billquist
2012-01-26 13:46 ` Johnny Billquist
1 sibling, 2 replies; 222+ messages in thread
From: paramucho @ 2012-01-26 6:09 UTC (permalink / raw)
On Wed, 25 Jan 2012 22:25:11 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
> >paramucho wrote:
>
>>The 800hz option isn't present on the 11/73. It's not documented in
>>the CPU guide and I note that SimH only provides the "JCLK" option for
>>the 8x and 9x CPUs but not for the 73.
>>
>>In any case, since the option settings for 50/60/800 hz are visible in
>>a processor register (xx177520) I don't need to detect the setting in
>>a timing loop. It's just a matter of a CPU and CSR detect.
>>
>Do you have a manual name and page number which
>specifies 177520 and the name of the register.
>
>I am curious what else might be in that manual
>which may have information.
>
>I note that the Page Control Register is at 177520,
>so I am extremely curious as to how that register
>also holds the clock rate. Using a PDP-11/83,
>177520 is set at 4000 for 60 and 800 Hz and
>at 2000 for 50 Hz when I run Ersatz-11. I don't
>have my DEC PDP-11/83 working at the
>moment, so I can't use the real DEC hardware.
>
>Jerome Fine
I used the 11/94 CPU document below, page 5-27
http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 6:09 ` paramucho
@ 2012-01-26 6:30 ` paramucho
2012-01-26 13:50 ` Johnny Billquist
2012-01-26 13:48 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-26 6:30 UTC (permalink / raw)
On Thu, 26 Jan 2012 06:09:33 GMT, paramucho@hotmail.com (paramucho)
wrote:
>On Wed, 25 Jan 2012 22:25:11 -0500, "Jerome H. Fine"
><everyone@nospam.com> wrote:
>
>> >paramucho wrote:
>>
>>>The 800hz option isn't present on the 11/73. It's not documented in
>>>the CPU guide and I note that SimH only provides the "JCLK" option for
>>>the 8x and 9x CPUs but not for the 73.
>>>
>>>In any case, since the option settings for 50/60/800 hz are visible in
>>>a processor register (xx177520) I don't need to detect the setting in
>>>a timing loop. It's just a matter of a CPU and CSR detect.
>>>
>>Do you have a manual name and page number which
>>specifies 177520 and the name of the register.
>>
>>I am curious what else might be in that manual
>>which may have information.
>>
>>I note that the Page Control Register is at 177520,
>>so I am extremely curious as to how that register
>>also holds the clock rate. Using a PDP-11/83,
>>177520 is set at 4000 for 60 and 800 Hz and
>>at 2000 for 50 Hz when I run Ersatz-11. I don't
>>have my DEC PDP-11/83 working at the
>>moment, so I can't use the real DEC hardware.
>>
>>Jerome Fine
>
>I used the 11/94 CPU document below, page 5-27
>
>http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
BTW: The document above has the Page Control Register at 177522, not
177520. See page 5-29.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 3:24 ` Jerome H. Fine
@ 2012-01-26 13:38 ` Johnny Billquist
2012-01-29 1:32 ` Jerome H. Fine
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-26 13:38 UTC (permalink / raw)
On 2012-01-26 04.24, Jerome H. Fine wrote:
> >Johnny Billquist wrote:
>>>>>> I have been looking at the results for the program RESORC.SAV in
>>>>>> RT-11
>>>>>> with respect the MFPT instruction. When the J11 chip is used, the
>>>>>> value
>>>>>> is 5 and the Maintenance Register at 177750 seems to determine
>>>>>> what the
>>>>>> rest of the actual hardware supports.
>>>>> Modifying the MFPT instruction is not the right way to go. CPU
>>>>> software detection is a delicate business and that process should not
>>>>> be interfered with directly.
>>>>> In any case, an emulator is not equivalent to a processor type since
>>>>> SimH and E11 support a range of PDP-11 CPUs.
>>>> Also right. And each CPU behaves differently, and the emulator needs to
>>>> follow that, or it is broken.
>>> Or, the emulator can emulate a CPU model different from any previously
>>> built. That usually at least happens in that the emulator runs at a
>>> different speed than any real processor.
>> Right.
>> And yes, that could definitely be done, at which point I think a new
>> value returned by MFPT would be reasonable.
> We seem to have travelled full circle. As I mentioned,
> Ersatz-11 (under an Intel CPU such as an E8200)
> can run RT-11 over 100 times as fast as on a PDP-11/93.
>
> That would certainly qualify as being faster!!!!!!!
Right. No one argued that. Personally, I just don't consider the CPU
speed to be a differentiating factor. Even physical DEC CPUs for the
same model, giving the same identity to various ways of identification,
could be running at different speeds. For example, the 11/83 exists both
with 15 MHz and 18MHz clocks. But they are both 11/83 machines, with the
same values from the MFPT as well as the maintenance register.
> But your original suggestion of using a new
> CPU instruction actually appeals to me.
I think that is a much more sensible way to go.
> Can anyone suggest some standards for which
> emulators could be used as well as any additional
> information like CPU speed or additional memory?
> For example, Ersatz-11 supports direct access to
> more than a GB of the memory on the PC via a
> PDP-11 IOPAGE register at access speeds only
> about 3 times the time to access regular memory.
> I even have FORTRAN callable subroutines under
> RT-11 which support these memory references.
I hope you do understand that this could just as well be done under a
real PDP-11. It's just a device. No different than any other. It's not
that E11 gives any magical extensions by having a new device.
There just don't happen to exist any physical implementation of this
device. But it wouldn't be particularly hard to implement it and plug it
into any Qbus or Unibus.
Additional information - I would say that the sensible way would be to
add a new instruction. There are a few opcodes left unused which could
be allocated for this. It don't make sense to reuse any existing
opcodes, since even though they might not be used normally, instructions
like MED are valid on something like an 11/60, and if your emulator
emulates that CPU, then it should work right, and not do some
emulator-specific thing.
To make something really simple, yet extensible, we could define a
single opcode for calling into the emulator. As a start, it can take a
function specific code in R0, and return a value in R0 as well.
We can then extend on this later by just adding more functions defined
by R0 (and possibly other registers).
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 3:22 ` Jerome H. Fine
@ 2012-01-26 13:46 ` paramucho
2012-01-29 1:34 ` Jerome H. Fine
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-26 13:46 UTC (permalink / raw)
On Wed, 25 Jan 2012 22:22:05 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
>
>>Modifying the MFPT instruction is not the right way to go. CPU
>>software detection is a delicate business and that process should not
>>be interfered with directly.
>>
>>
>As I already answered with Johnny, I have my own
>doubts for using MFPT. I do like his suggestion of a
>currently illegal instruction code (a new hardware
>instruction) which an actual DEC J11 chip would
>need to trap.
>
>>In any case, an emulator is not equivalent to a processor type since
>>SimH and E11 support a range of PDP-11 CPUs.
>>
>>
>And having a new instruction would be very easy
>Ersatz-11. I suspect that SIMH would also be
>very easy. What about RUST?
Adding a new instruction is usually trivial.
>>Some CPU software detection is handled by examining CPU behavior. The
>>same process can be used to detect an emulator and to determine which
>>emulator is being used.
>>
>>
>It would even be possible to tell the user details of
>the emulator environment. There would need to be
>some sort of standard. Any suggestions?
I use the API to get the host command, create host directories, define
host logical names, idle and V11 detection. I also use the API to
implement a cheap network connection. I have a list of other general
functions the API could handle, but it's no use just implementing a
general API for a single emulator and I doubt we'll see a generic
standard emerge...
<snip>
>>In fact, the V11 emulator has a little API which is used to pass
>>information between the emulator and the system. It's used to
>>relinquish control so that the emulator doesn't hog all the CPU time
>>and for various other functions. It would be great if there was a
>>common API for PDP-11 emulators for this kind of thing, but I'm not
>>sure the motivation is there for the effort involved.
>>
>I don't think that the about properties (or at least how
>the PDP-11 instructions react to the above code) has
>been documented under Ersatz-11. I would imagine
>that the source code could be used under SIMH to
>figure out why the above code is needed.
>
>I am VERY curious!!!!!!!!! How did you figure out the
>code for Ersatz-11? Did John Wilson help? Does the
>above code still work with V6.0 of E11?
I didn't use the source code for SimH. It's often easier to use a
debugger to "read" the system behavior than it is to hunt through
sources. I just experimented until I found a suitable test. I also
tested on real F11 and J11 systems.
The trick was to find some "undefined" behavior that didn't need
correction. The code above gets different results from an F11 and a
J11 as well as from SimH and E11. The test is far from ideal, but it
works well enough for my purposes.
The test works with V6.0 of E11.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 3:25 ` Jerome H. Fine
2012-01-26 6:09 ` paramucho
@ 2012-01-26 13:46 ` Johnny Billquist
2012-01-29 1:35 ` Jerome H. Fine
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-26 13:46 UTC (permalink / raw)
On 2012-01-26 04.25, Jerome H. Fine wrote:
> >paramucho wrote:
>> The 800hz option isn't present on the 11/73. It's not documented in
>> the CPU guide and I note that SimH only provides the "JCLK" option for
>> the 8x and 9x CPUs but not for the 73.
>>
>> In any case, since the option settings for 50/60/800 hz are visible in
>> a processor register (xx177520) I don't need to detect the setting in
>> a timing loop. It's just a matter of a CPU and CSR detect.
> Do you have a manual name and page number which
> specifies 177520 and the name of the register.
Ian already send you the link for the 11/9x systems, where you can see this.
> I am curious what else might be in that manual
> which may have information.
>
> I note that the Page Control Register is at 177520,
> so I am extremely curious as to how that register
> also holds the clock rate. Using a PDP-11/83,
> 177520 is set at 4000 for 60 and 800 Hz and
> at 2000 for 50 Hz when I run Ersatz-11. I don't
> have my DEC PDP-11/83 working at the
> moment, so I can't use the real DEC hardware.
Seems like E11 don't set that register right for 800 Hz then.
It should have been 6000.
Of course, it might be that E11 don't truly set the clock to 800 Hz as
well, or that it emulates a KW11-P in that case...?
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 6:09 ` paramucho
2012-01-26 6:30 ` paramucho
@ 2012-01-26 13:48 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-26 13:48 UTC (permalink / raw)
On 2012-01-26 07.09, paramucho wrote:
> On Wed, 25 Jan 2012 22:25:11 -0500, "Jerome H. Fine"
> <everyone@nospam.com> wrote:
>
>>> paramucho wrote:
>>
>>> The 800hz option isn't present on the 11/73. It's not documented in
>>> the CPU guide and I note that SimH only provides the "JCLK" option for
>>> the 8x and 9x CPUs but not for the 73.
>>>
>>> In any case, since the option settings for 50/60/800 hz are visible in
>>> a processor register (xx177520) I don't need to detect the setting in
>>> a timing loop. It's just a matter of a CPU and CSR detect.
>>>
>> Do you have a manual name and page number which
>> specifies 177520 and the name of the register.
>>
>> I am curious what else might be in that manual
>> which may have information.
>>
>> I note that the Page Control Register is at 177520,
>> so I am extremely curious as to how that register
>> also holds the clock rate. Using a PDP-11/83,
>> 177520 is set at 4000 for 60 and 800 Hz and
>> at 2000 for 50 Hz when I run Ersatz-11. I don't
>> have my DEC PDP-11/83 working at the
>> moment, so I can't use the real DEC hardware.
>>
>> Jerome Fine
>
> I used the 11/94 CPU document below, page 5-27
>
> http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
Another option is the 11/8x manual.
http://www.bitsavers.org/pdf/dec/pdp11/1184/EK-1184E-TM-001_Dec87.pdf
page 2-41. Same information as for the 11/9x though.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 6:30 ` paramucho
@ 2012-01-26 13:50 ` Johnny Billquist
2012-01-29 1:52 ` Jerome H. Fine
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-26 13:50 UTC (permalink / raw)
On 2012-01-26 07.30, paramucho wrote:
> On Thu, 26 Jan 2012 06:09:33 GMT, paramucho@hotmail.com (paramucho)
> wrote:
>
>> On Wed, 25 Jan 2012 22:25:11 -0500, "Jerome H. Fine"
>> <everyone@nospam.com> wrote:
>>
>>>> paramucho wrote:
>>>
>>>> The 800hz option isn't present on the 11/73. It's not documented in
>>>> the CPU guide and I note that SimH only provides the "JCLK" option for
>>>> the 8x and 9x CPUs but not for the 73.
>>>>
>>>> In any case, since the option settings for 50/60/800 hz are visible in
>>>> a processor register (xx177520) I don't need to detect the setting in
>>>> a timing loop. It's just a matter of a CPU and CSR detect.
>>>>
>>> Do you have a manual name and page number which
>>> specifies 177520 and the name of the register.
>>>
>>> I am curious what else might be in that manual
>>> which may have information.
>>>
>>> I note that the Page Control Register is at 177520,
>>> so I am extremely curious as to how that register
>>> also holds the clock rate. Using a PDP-11/83,
>>> 177520 is set at 4000 for 60 and 800 Hz and
>>> at 2000 for 50 Hz when I run Ersatz-11. I don't
>>> have my DEC PDP-11/83 working at the
>>> moment, so I can't use the real DEC hardware.
>>>
>>> Jerome Fine
>>
>> I used the 11/94 CPU document below, page 5-27
>>
>> http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
>
> BTW: The document above has the Page Control Register at 177522, not
> 177520. See page 5-29.
Uh. The page control register is indeed at 177522, but that is not the
register holding the information we talk about. (Jerome confused?).
It's the Control/Status register we are talking about, and that is at
177520.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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:39 ` Jerome H. Fine
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-26 14:12 UTC (permalink / raw)
On 2012-01-26 04.21, Jerome H. Fine wrote:
> >Johnny Billquist wrote:
>> I'm not entirely sure what your question is, Jerome...
>> But I'll make some comments anyway.
> Very much appreciated. I was away for a week. I am catching up now.
>> On 2012-01-15 15:37, Jerome H. Fine wrote:
>>> I have an interesting hardware question.
>>>
>>> I have been looking at the results for the program RESORC.SAV in RT-11
>>> with respect the MFPT instruction. When the J11 chip is used, the value
>>> is 5 and the Maintenance Register at 177750 seems to determine what the
>>> rest of the actual hardware supports.
>> Correct.
>>> I thought it would also be helpful for the user to know if an
>>> emulator is being
>>> used, either software or hardware, or if perhaps some other 3rd party
>>> hardware
>>> CPU. I would probably target the various 3rd party boards as far as
>>> hardware
>>> is concerned (such as QED and Mentec). For software emulators, I would
>>> suggest that only the high end PDP-11 processors be supported (the DEC
>>> CPUs which support the MFPT instruction) in order to keep things simple,
>>> at least initially.
>> If an emulator wants to truly emulate a specific CPU, then you cannot
>> just go and change the behavior of the emulator, since you will break
>> the basic idea behind it.
>> As far as different implementations goes, what is the difference
>> between an emulator and a "real" CPU? Both are running code to
>> implement the PDP-11 architecture. It's just that if the emulator is
>> running on an x86 (for example), the microcode happens to be identical
>> to x86 assembler, whilst the J11 (for example) have a microcode CPU
>> which we don't know much about, but it still executes the microcode
>> instructions...
> I actually agree with you. The only reason that I mention the
> MFPT instruction is that RT-11 ignores the high order byte
> and I thought that I would ask if RSX-11 also ignores the
> high order byte, along perhaps with RSTS/E.
The fact that some code ignore parts of the returned value is not a good
enough reason to abuse it.
There might be userland code which also use MFPT, and might react badly
if you change this. Not to mention other OSes, all of which we might not
even know of.
If you (supposedly) emulate a J11 CPU, you *must* return the same value
as a real J11, or else you are not in fact emulating a J11 CPU.
Now, admittedly, sometimes it might be necessary to break the mold for
various reasons, but let's do that in a less intrusive way.
>>> An incomplete list of software emulators is:
>>> SIMH
>>> Ersatz-11
>>>
>>> An incomplete list of hardware boards is:
>>> QED - more than 1?
>>> Mentec - at least 3
>>> and I can remember at least 2 others, but not the company names.
>> You have Strobe Data, which I'm sure you'll remember now that I
>> mention them.
> Yes. I seem to remember they were first. Do you classify them as
> a hardware or software emulator? If my hazy memory is correct,
> Strobe Data initially used the J11 chip on a board that plugged
> into an ISA slot on a DOS machine. Later, the J11 chips were
> very difficult to obtain, so Strobe Data managed to do something
> else.
I wouldn't call any of their implementations an emulator. It's a PDP-11.
I'm not even sure what the point is in trying to make the distinction
between a "hardware" and a "software" emulator. As I points out at
another place, all PDP-11s except for the PDP-11/20 are implemented
using microcode. So, in short, it is all done in software. The actual
instructions performed by the hardware have little to no resemblance to
a PDP-11 instruction.
Be that the microcode engine in the J11 CPU, or the x86 underlying the E11.
Try to think of x86 instructions as microcode for the E11 CPU, if that
helps.
> When I first saw the emulation actually running RT-11, I was very
> surprised.
>
> Does anyone know how many boards and the names that
> QED and Mentec produced. Also, does the name Nissho
> ring a bell? I think they were a Unibus hardware emulator
> or were they just high speed memory?
I don't have any complete lists.
>>> Right now the Logical Co. has a combined emulator called a
>>> PDQ-1000 board which actually plugs into a Qbus which takes
>>> only 4 slots, but includes CPU, memory and many controllers.
>> Yes... And...?
> The reason that I specifically mention the PDQ-1000 is that while
> it seems like a hardware emulator (since the final result is a Qbus
> board), inside the hardware is actually a software emulator.
And what is the difference? The J11 is also a software implementation.
>>> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>>> available determine the actual value returned by the MFPT instruction?
>>> As far as I know:
>>>
>>> MFPT Value Hardware
>>> 1 PDP-11/44
>>> 3 PDP-11/24 (should be 2)
>>> 3 PDP-11/23
>>> 4 SBC-11/21
>>> 5 All J11 chips including 11/73, 11/83, 11/93
>> That is all the values that MFPT can return. (Or rather - all the
>> values that were returned by any CPUs designed by DEC.)
> Understood. It would have been "nice" if DEC had supported
> a more open concept, but since probably at least 50% (maybe
> over 90%) of the emulators in use are SIMH and Ersatz-11,
> it is probably not all that important any more.
It's not that DEC didn't design an open concept. But what is the point
of defining new values for MFPT. We could do that. Let's for instance
say that E11 should return 6 for MFPT.
That would be perfectly valid. We could then decide what CPU options and
capabilities would be implied by this value.
The problem, however, is that no current software will recognize this.
So we need to adjust all OSes, as well as other software that use this
information, to get things right. That is where the problem is. And that
is why E11 instead tries to emulate existing CPUs truthfully, so that
existing software will work right.
That includes implementing all the bugs for the individual CPU as well.
Software might depend on it.
What you then might seek is a middle ground. Let's make the system act
just like an existing machine made by DEC, but let's make additional
features available to code that actually can figure out that this is not
a normal 11/93 (or whatever). That is the point when you hit the problem
that you need to truthfully emulate an 11/93, but still need to do
something that is incompatible with an 11/93. So, what is the least
intrusive incompatibility you can think of.
I say it is having an undefined instruction (which in all likelyhood no
existing program would be using anyway) actually not trap, but instead
do something.
>>> I assume that it would be extremely difficult, probably not worth the
>>> effort, to modify the high order byte of the MFPT instruction at this
>>> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>> Some Mentec boards use a J11. You can guess what they return. For the
>> other boards, they also seem to pretend to be J11 CPUs, which is a bit
>> sad, but that can't be helped.
> And of course, the result is that they reported a particular DEC
> CPU as being used. What were the names of all of the Mentec
> boards and their primary difference from each other?
The ones I can think off are the M70, M100, M11. M70 uses a J11. M11
uses Mentecs own FPGA implementation. The M11 have a TOY clock, but it
is not compatible with the 11/9x TOY. Also, the M11 adds one more
instruction not existing in the J11, namely MOVR, which is a block move
instruction. Takes three registers as arguments. Source address,
destination address and length.
There are more CPUs by Mentec, and possibly also other
features/differences between them that I don't know of.
>>> Can anyone comment on this assumption? Might there be another
>>> way for hardware to the tell a user which 3rd party board is being
>>> used as a PDP-11?
>> Please differ between which *board* is being used, as opposed to which
>> CPU. MFPT will only tell you which CPU is used, not which board.
> Yes, you are correct. Even DEC used the J11 chip
> on many different boards.
>
> I have the impression that it would no longer be either
> useful or reasonable to attempt to identify any Mentec
> or QED boards at this point.
Existing code already identify Mentec boards. Not surprising,
considering that Mentec owned the major OSes for a while.
QED processors looks like DEC ones as far as OSes are concerned.
>> If you want some "foolproof" way of detecting that you are inside an
>> emulated machine, I'd say that adding a new instruction from the
>> unused opcodes is probably a better idea. I wouldn't expect anything
>> to actually try using an undefined opcode anyway, so no existing code
>> should be hurt by it. And your "new" code will also work on real
>> machines, in that you will instead get a trap if you try that instruction.
> Your suggestion to use an instruction code which is presently
> illegal is actually almost trivial in Ersatz-11. John Wilson explicitly
> supports adding code for new instructions. Well, I guess it
> is not exactly trivial, but I could probably write and test the
> code for the required DLL in less than a week.
>
> I imagine the same would apply to SIMH. it would be useful
> if there could be an agreement on a standard!!!!!!!!!!!!!
>
> Other emulators or 3rd party hardware implementations which
> are no longer supported by their original manufacturers would be
> much more difficult, if not impossible, at this point.
>
> What about RUST? Could that support a new instruction as well?
Already answered by Ian. And yes, in short, adding a new instruction in
any emulator is trivial.
There is no standard. We might try to make a suggestion. But that's all
we could do.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 14:12 ` Johnny Billquist
@ 2012-01-26 15:26 ` paramucho
2012-01-29 1:41 ` Jerome H. Fine
2012-01-29 1:39 ` Jerome H. Fine
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-26 15:26 UTC (permalink / raw)
On Thu, 26 Jan 2012 15:12:29 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>> What about RUST? Could that support a new instruction as well?
>
>Already answered by Ian. And yes, in short, adding a new instruction in
>any emulator is trivial.
>There is no standard. We might try to make a suggestion. But that's all
>we could do.
We could do more if we wanted to. SimH is open source, so it is
entirely possible to add private code. E11 supports an extension API
which could be used to implement an API.
The problem is, however, that this kind of thing isn't really worth it
unless it's part of the standard configuration. Perhaps that could
come later...
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 13:38 ` Johnny Billquist
@ 2012-01-29 1:32 ` Jerome H. Fine
2012-01-29 1:43 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-29 1:32 UTC (permalink / raw)
>Johnny Billquist wrote:
> Right. No one argued that. Personally, I just don't consider the CPU
> speed to be a differentiating factor. Even physical DEC CPUs for the
> same model, giving the same identity to various ways of
> identification, could be running at different speeds. For example, the
> 11/83 exists both with 15 MHz and 18MHz clocks. But they are both
> 11/83 machines, with the same values from the MFPT as well as the
> maintenance register.
I basically agree with you as well. Functionally should be
the reason for specifying a CPU to be different.
Note that many PDP-11/73 boards (maybe all M8190-BA,
M8190-BB, M8190-BC) also supported the use of PMI
memory, Just needed to place the PMI memory ahead of
the CPU board in the backplane (backplane must be ABCD
of course) and the faster access to memory was then used.
I tried that at one point with my M8190-BB and was surprised
to note that most of the extra speed for the CPU was due to the
faster PMI memory, not the 18 MHz clock. I imagine that
the reason RESORC.SAV reported a PDP-11/83 was that
both the MFPT and maintenance register were correct. But
I would need to check the exact nature of the code in RT-11.
Naturally a floating point intensive application would show
the PDP-11/83 to be significantly faster, but at the moment,
I don't have any such applications.
>> But your original suggestion of using a new
>> CPU instruction actually appeals to me.
>
> I think that is a much more sensible way to go.
AGREED!!!
>> Can anyone suggest some standards for which
>> emulators could be used as well as any additional
>> information like CPU speed or additional memory?
>> For example, Ersatz-11 supports direct access to
>> more than a GB of the memory on the PC via a
>> PDP-11 IOPAGE register at access speeds only
>> about 3 times the time to access regular memory.
>> I even have FORTRAN callable subroutines under
>> RT-11 which support these memory references.
>
>
> I hope you do understand that this could just as well be done under a
> real PDP-11. It's just a device. No different than any other. It's not
> that E11 gives any magical extensions by having a new device.
> There just don't happen to exist any physical implementation of this
> device. But it wouldn't be particularly hard to implement it and plug
> it into any Qbus or Unibus.
These days, it would only need a single stick of memory
from a PC to implement a 4 GB memory device or the
HD: disk that Ersatz-11 supports as in:
MOUNT HDA0: RAM: /SIZE:4096MB
> Additional information - I would say that the sensible way would be to
> add a new instruction. There are a few opcodes left unused which could
> be allocated for this. It don't make sense to reuse any existing
> opcodes, since even though they might not be used normally,
> instructions like MED are valid on something like an 11/60, and if
> your emulator emulates that CPU, then it should work right, and not do
> some emulator-specific thing.
>
> To make something really simple, yet extensible, we could define a
> single opcode for calling into the emulator. As a start, it can take a
> function specific code in R0, and return a value in R0 as well.
>
> We can then extend on this later by just adding more functions defined
> by R0 (and possibly other registers).
I would agree with the above suggestion. If
possible, perhaps Ersatz-11, SIMH and RUST
could all use the same definitions so that there
would need to be only a single instruction used. Do
you have any suggestions as to which instruction
code would be best? Also, there would need to
be common agreement on the value placed into
R0: It is probably too late to support the Mentec
and QED additions, but that could be done by
the user adding code to the trap instructions if
that was desired. So my suggestion would be
to include all of the 3rd party hardware as well
just in case:
Strobe Data - 2
Mentec M70 -3
Mentec M11 -4
Mentec M100 - 5
QED 993 - 6
Nissho?? - 7
RUST - 22
SIMH - 23
Ersatz-11 - 24
Charon - 25
PDQ-1000 - 32
If anyone has any additions or corrections, please
add them. Also, does anyone have any dates when
there were first available? It would seem reasonable
to assign the table of values in the order they first
appeared. I also used two separate lists, one for
what would be hardware and another for software.
The way I distinguish between hardware and software
was that hardware emulation was based on a given
set of hardware components which usually resulted
in a set speed for the CPU while for a software
emulation, a faster CPU could make a huge difference
in the speed of the emulation.
The PDQ-1000 might be in-between since it might
be a software emulator inside, but once the components
have been chosen, the Logical Co. will not want to
frequently change the Intel CPU that is being used
since these days it would also mean changing the
motherboard.
Can anyone else add anything to the discussion?
Jerome Fine
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 13:46 ` paramucho
@ 2012-01-29 1:34 ` Jerome H. Fine
2012-01-29 15:46 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-29 1:34 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]
>paramucho wrote:
>On Wed, 25 Jan 2012 22:22:05 -0500, "Jerome H. Fine" wrote:
>
>>I don't think that the about properties (or at least how
>>the PDP-11 instructions react to the above code) has
>>been documented under Ersatz-11. I would imagine
>>that the source code could be used under SIMH to
>>figure out why the above code is needed.
>>
>>I am VERY curious!!!!!!!!! How did you figure out the
>>code for Ersatz-11? Did John Wilson help? Does the
>>above code still work with V6.0 of E11?
>>
>I didn't use the source code for SimH. It's often easier to use a
>debugger to "read" the system behavior than it is to hunt through
>sources. I just experimented until I found a suitable test. I also
>tested on real F11 and J11 systems.
>
>The trick was to find some "undefined" behavior that didn't need
>correction. The code above gets different results from an F11 and a
>J11 as well as from SimH and E11. The test is far from ideal, but it
>works well enough for my purposes.
>
>The test works with V6.0 of E11.
>
After you "found" the way that SIMH can be tested for,
were you able to verify that from the source code. To
say the least, the activity that you found is VERY
unexpected!!!!!!!!!
Also, what led you to attempt to use the hardware
in that manner. It does not seem very obvious as
to why the hardware registers (software in the case
of a software emulator as opposed to a real DEC
CPU) would behave in that fashion.
Can anyone else verify what Ian found?
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 2267 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 13:46 ` Johnny Billquist
@ 2012-01-29 1:35 ` Jerome H. Fine
0 siblings, 0 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-29 1:35 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]
>Johnny Billquist wrote:
>> I note that the Page Control Register is at 177520,
>> so I am extremely curious as to how that register
>> also holds the clock rate. Using a PDP-11/83,
>> 177520 is set at 4000 for 60 and 800 Hz and
>> at 2000 for 50 Hz when I run Ersatz-11. I don't
>> have my DEC PDP-11/83 working at the
>> moment, so I can't use the real DEC hardware.
>
> Seems like E11 don't set that register right for 800 Hz then.
> It should have been 6000.
>
> Of course, it might be that E11 don't truly set the clock to 800 Hz as
> well, or that it emulates a KW11-P in that case...?
Some how, when E11 was give the commands:
SET HERTZ 60
SET HERTZ 50
the register was set correctly. But
SET HERTZ 800
did not result in 6000 as I found 4000 instead. I will
have to ask John Wilson about this. I presume that
since SET HERTZ 800 is not an expected value
to run a PDP-11 that John may not have considered
the value that the register was to be set.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 1791 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 14:12 ` Johnny Billquist
2012-01-26 15:26 ` paramucho
@ 2012-01-29 1:39 ` Jerome H. Fine
2012-01-29 1:45 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-29 1:39 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 4146 bytes --]
>Johnny Billquist wrote:
> >On 2012-01-26 04.21, Jerome H. Fine wrote:
>
>>> You have Strobe Data, which I'm sure you'll remember now that I
>>> mention them.
>>
>> Yes. I seem to remember they were first. Do you classify them as
>> a hardware or software emulator? If my hazy memory is correct,
>> Strobe Data initially used the J11 chip on a board that plugged
>> into an ISA slot on a DOS machine. Later, the J11 chips were
>> very difficult to obtain, so Strobe Data managed to do something
>> else.
>
> I wouldn't call any of their implementations an emulator. It's a
> PDP-11. I'm not even sure what the point is in trying to make the
> distinction between a "hardware" and a "software" emulator. As I
> points out at another place, all PDP-11s except for the PDP-11/20 are
> implemented using microcode. So, in short, it is all done in software.
> The actual instructions performed by the hardware have little to no
> resemblance to a PDP-11 instruction.
> Be that the microcode engine in the J11 CPU, or the x86 underlying the
> E11.
> Try to think of x86 instructions as microcode for the E11 CPU, if that
> helps.
I agree completely. To be even more specific, the microcode
could be considered to be contained in a number of layers
with x86 instructions being the layer just before the PDP-11
instructions. The other layers of microcode would be hidden
even from the x86 instructions.
>>>> Right now the Logical Co. has a combined emulator called a
>>>> PDQ-1000 board which actually plugs into a Qbus which takes
>>>> only 4 slots, but includes CPU, memory and many controllers.
>>>
>>> Yes... And...?
>>
>> The reason that I specifically mention the PDQ-1000 is that while
>> it seems like a hardware emulator (since the final result is a Qbus
>> board), inside the hardware is actually a software emulator.
>
> And what is the difference? The J11 is also a software implementation.
The difference for the PDQ-1000 is that the implementation
is a specific Qbus board as opposed to a software program
which runs on many different hardware systems. In this one very
specific case, it would seem to deserve a separate number to
identify it.
> What you then might seek is a middle ground. Let's make the system act
> just like an existing machine made by DEC, but let's make additional
> features available to code that actually can figure out that this is
> not a normal 11/93 (or whatever). That is the point when you hit the
> problem that you need to truthfully emulate an 11/93, but still need
> to do something that is incompatible with an 11/93. So, what is the
> least intrusive incompatibility you can think of.
>
> I say it is having an undefined instruction (which in all likelyhood
> no existing program would be using anyway) actually not trap, but
> instead do something.
I also agree now that this certainly is the best method.
>> And of course, the result is that they reported a particular DEC
>> CPU as being used. What were the names of all of the Mentec
>> boards and their primary difference from each other?
>
> The ones I can think off are the M70, M100, M11. M70 uses a J11. M11
> uses Mentecs own FPGA implementation. The M11 have a TOY clock, but it
> is not compatible with the 11/9x TOY. Also, the M11 adds one more
> instruction not existing in the J11, namely MOVR, which is a block
> move instruction. Takes three registers as arguments. Source address,
> destination address and length.
>
> There are more CPUs by Mentec, and possibly also other
> features/differences between them that I don't know of.
Thank you for the list of Mentec CPUs. I added them to my
other response. Can anyone else who remembers other Mentec
CPUs add to my list?
> Existing code already identify Mentec boards. Not surprising,
> considering that Mentec owned the major OSes for a while.
> QED processors looks like DEC ones as far as OSes are concerned.
I am not familiar with, nor have I observed any code to
identify a Mentec board within RT-11. Does RSX-11
have any such code?
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 5299 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 15:26 ` paramucho
@ 2012-01-29 1:41 ` Jerome H. Fine
2012-01-29 2:04 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-29 1:41 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]
>paramucho wrote:
>>On Thu, 26 Jan 2012 15:12:29 +0100, Johnny Billquist wrote:
>
>>>What about RUST? Could that support a new instruction as well?
>>>
>>>
>>Already answered by Ian. And yes, in short, adding a new instruction in
>>any emulator is trivial.
>>There is no standard. We might try to make a suggestion. But that's all
>>we could do.
>>
>We could do more if we wanted to. SimH is open source, so it is
>entirely possible to add private code. E11 supports an extension API
>which could be used to implement an API.
>
>The problem is, however, that this kind of thing isn't really worth it
>unless it's part of the standard configuration. Perhaps that could
>come later...
>
I was hoping to add code to RESORC.SAV in RT-11
to support the ability to determine which, if any, emulator
was running. Johnny's preference to use an instruction
code which is presently NOT defined and in use seems
the best solution and is easily implemented for both SIMH
and Ersatz-11. Since RUST can support that as well, then
the opcode needs to be specified along with the values
to be used for the different emulators. Then as it becomes
reasonable, the extra code can be included.
However, if no one can agree on a standard, it becomes
much less likely for this to eventually take place. It would
be helpful, therefore, if as many individuals could comment
on at least the concept, if not the actual details. I would think
that only the very few individuals who were going to actually
implement the concept need to be concerned with the details
like which instruction code is used, the table of values and
how the value is provided to the PDP-11 program.
At the very least, is there anyone who objects or who thinks
this would be a bad idea?
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 2495 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-29 1:32 ` Jerome H. Fine
@ 2012-01-29 1:43 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-29 1:43 UTC (permalink / raw)
On 2012-01-29 02:32, Jerome H. Fine wrote:
> >Johnny Billquist wrote:
>
>> Right. No one argued that. Personally, I just don't consider the CPU
>> speed to be a differentiating factor. Even physical DEC CPUs for the
>> same model, giving the same identity to various ways of
>> identification, could be running at different speeds. For example, the
>> 11/83 exists both with 15 MHz and 18MHz clocks. But they are both
>> 11/83 machines, with the same values from the MFPT as well as the
>> maintenance register.
>
> I basically agree with you as well. Functionally should be
> the reason for specifying a CPU to be different.
[...]
Didn't realize that Jerome had written this both to me in person as well
as a post here, so my response only got sent to him.
Oh well, I disagree with most of the actual implementation he suggests,
since I think it is messy, inflexible and makes irrelevant distinctions
between "hardware" and "software".
I think we first should ask what we actually want to find out, and then
we could continue designing something of an API once we've figured that out.
And I actually am not really sure what Jerome wants to know/find out
here. So it's hard to talk about the API in much more detail...
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-29 1:39 ` Jerome H. Fine
@ 2012-01-29 1:45 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-29 1:45 UTC (permalink / raw)
On 2012-01-29 02:39, Jerome H. Fine wrote:
> >Johnny Billquist wrote:
>> Existing code already identify Mentec boards. Not surprising,
>> considering that Mentec owned the major OSes for a while.
>> QED processors looks like DEC ones as far as OSes are concerned.
> I am not familiar with, nor have I observed any code to
> identify a Mentec board within RT-11. Does RSX-11
> have any such code?
Yes. I just told you.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-26 13:50 ` Johnny Billquist
@ 2012-01-29 1:52 ` Jerome H. Fine
2012-01-29 2:08 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-01-29 1:52 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1794 bytes --]
>Johnny Billquist wrote:
>>> >On Wed, 25 Jan 2012 22:25:11 -0500, "Jerome H. Fine" wrote:
>>>
>>>> I note that the Page Control Register is at 177520,
>>>> so I am extremely curious as to how that register
>>>> also holds the clock rate. Using a PDP-11/83,
>>>> 177520 is set at 4000 for 60 and 800 Hz and
>>>> at 2000 for 50 Hz when I run Ersatz-11. I don't
>>>> have my DEC PDP-11/83 working at the
>>>> moment, so I can't use the real DEC hardware.
>>>
>>> I used the 11/94 CPU document below, page 5-27
>>>
>>> http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
>>
>> BTW: The document above has the Page Control Register at 177522, not
>> 177520. See page 5-29.
>
> Uh. The page control register is indeed at 177522, but that is not the
> register holding the information we talk about. (Jerome confused?).
> It's the Control/Status register we are talking about, and that is at
> 177520.
I am confused.
The Ersatz-11 manual lists the PCR at 177520, but does
not provide any more details as to how it is used. In
every case, John Wilson has attempted to duplicate
how actual real DEC PDP-11 hardware functions.
But, since the PCR (as far as I can remember) is
rarely used except when performing a hardware boot
of the operating system, it is possible that John did
not attempt to duplicate the functions exactly, in
particular since the EPROMs which held the code
for booting would probably be considered as being
copyright.
On the other hand, maybe the confusion is how John
specified the register at 177520, not how it is used.
If anyone has a copy of the Ersatz-11 manual, please
check under SET CPU options and provide your
interpretation. There is also a copy of the PDF on
the dbit site.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 2785 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-29 1:41 ` Jerome H. Fine
@ 2012-01-29 2:04 ` Johnny Billquist
2012-01-29 2:31 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-29 2:04 UTC (permalink / raw)
On 2012-01-29 02:41, Jerome H. Fine wrote:
> >paramucho wrote:
>> >On Thu, 26 Jan 2012 15:12:29 +0100, Johnny Billquist wrote:
>>>> What about RUST? Could that support a new instruction as well?
>>>>
>>> Already answered by Ian. And yes, in short, adding a new instruction in
>>> any emulator is trivial.
>>> There is no standard. We might try to make a suggestion. But that's all
>>> we could do.
>> We could do more if we wanted to. SimH is open source, so it is
>> entirely possible to add private code. E11 supports an extension API
>> which could be used to implement an API.
>>
>> The problem is, however, that this kind of thing isn't really worth it
>> unless it's part of the standard configuration. Perhaps that could
>> come later...
> I was hoping to add code to RESORC.SAV in RT-11
> to support the ability to determine which, if any, emulator
> was running. Johnny's preference to use an instruction
> code which is presently NOT defined and in use seems
> the best solution and is easily implemented for both SIMH
> and Ersatz-11. Since RUST can support that as well, then
> the opcode needs to be specified along with the values
> to be used for the different emulators. Then as it becomes
> reasonable, the extra code can be included.
>
> However, if no one can agree on a standard, it becomes
> much less likely for this to eventually take place. It would
> be helpful, therefore, if as many individuals could comment
> on at least the concept, if not the actual details. I would think
> that only the very few individuals who were going to actually
> implement the concept need to be concerned with the details
> like which instruction code is used, the table of values and
> how the value is provided to the PDP-11 program.
>
> At the very least, is there anyone who objects or who thinks
> this would be a bad idea?
Ok. Here is a short suggestion for you, then:
Opcode 7 is, as far as I can tell, unused. (Someone correct me if I'm
wrong).
I suggest we adopt this opcode as CEM (Call EMulator).
It might use any registers for input and/or output, all defined by the
actual function requested.
When the instruction is executed on any machine not having this
function, it will trap as an illegal instruction, same as always.
If the machine actually understands CEM, it will start by looking at the
function code in R0. If the function code is not understood, nothing
will be done, and the carry will be set.
If the function code is understood, the instruction will perform some
action, and possibly return values in registers. The carry will be clear
in this case. Other condition code flags can be used to indicate
possible other errors or conditions. They will be defined for those
specific functions at a later time.
For now, the only defined function is:
R0 = 0 - Get emulator system.
If the emulator understands this instruction, it will place a code in R0
that reflects which emulator is being used.
Currently defined values:
0 - Undefined
1 - SimH
2 - E11
3 - Rust
There. Now all we need is for everyone to actually implement it.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-29 1:52 ` Jerome H. Fine
@ 2012-01-29 2:08 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-29 2:08 UTC (permalink / raw)
On 2012-01-29 02:52, Jerome H. Fine wrote:
> >Johnny Billquist wrote:
>>>> >On Wed, 25 Jan 2012 22:25:11 -0500, "Jerome H. Fine" wrote:
>>>>> I note that the Page Control Register is at 177520,
>>>>> so I am extremely curious as to how that register
>>>>> also holds the clock rate. Using a PDP-11/83,
>>>>> 177520 is set at 4000 for 60 and 800 Hz and
>>>>> at 2000 for 50 Hz when I run Ersatz-11. I don't
>>>>> have my DEC PDP-11/83 working at the
>>>>> moment, so I can't use the real DEC hardware.
>>>> I used the 11/94 CPU document below, page 5-27
>>>>
>>>> http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
>>> BTW: The document above has the Page Control Register at 177522, not
>>> 177520. See page 5-29.
>> Uh. The page control register is indeed at 177522, but that is not the
>> register holding the information we talk about. (Jerome confused?).
>> It's the Control/Status register we are talking about, and that is at
>> 177520.
> I am confused.
>
> The Ersatz-11 manual lists the PCR at 177520, but does
> not provide any more details as to how it is used. In
> every case, John Wilson has attempted to duplicate
> how actual real DEC PDP-11 hardware functions.
>
> But, since the PCR (as far as I can remember) is
> rarely used except when performing a hardware boot
> of the operating system, it is possible that John did
> not attempt to duplicate the functions exactly, in
> particular since the EPROMs which held the code
> for booting would probably be considered as being
> copyright.
>
> On the other hand, maybe the confusion is how John
> specified the register at 177520, not how it is used.
>
> If anyone has a copy of the Ersatz-11 manual, please
> check under SET CPU options and provide your
> interpretation. There is also a copy of the PDF on
> the dbit site.
This has little to do with E11.
The register at 177520 is the Control/Status register, according to DEC
documentation. The Page Control Register is at 177522. What is there to
argue about?
E11 documentation might, at the most, have put the wrong name on the
register in its documentation. In this case I prefer to use the DEC
documentation for the actual systems... I have not even looked at the
E11 documentation.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-29 2:04 ` Johnny Billquist
@ 2012-01-29 2:31 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-29 2:31 UTC (permalink / raw)
On 2012-01-29 03:04, Johnny Billquist wrote:
> On 2012-01-29 02:41, Jerome H. Fine wrote:
>> >paramucho wrote:
>>> >On Thu, 26 Jan 2012 15:12:29 +0100, Johnny Billquist wrote:
>>>>> What about RUST? Could that support a new instruction as well?
>>>>>
>>>> Already answered by Ian. And yes, in short, adding a new instruction in
>>>> any emulator is trivial.
>>>> There is no standard. We might try to make a suggestion. But that's all
>>>> we could do.
>>> We could do more if we wanted to. SimH is open source, so it is
>>> entirely possible to add private code. E11 supports an extension API
>>> which could be used to implement an API.
>>>
>>> The problem is, however, that this kind of thing isn't really worth it
>>> unless it's part of the standard configuration. Perhaps that could
>>> come later...
>> I was hoping to add code to RESORC.SAV in RT-11
>> to support the ability to determine which, if any, emulator
>> was running. Johnny's preference to use an instruction
>> code which is presently NOT defined and in use seems
>> the best solution and is easily implemented for both SIMH
>> and Ersatz-11. Since RUST can support that as well, then
>> the opcode needs to be specified along with the values
>> to be used for the different emulators. Then as it becomes
>> reasonable, the extra code can be included.
>>
>> However, if no one can agree on a standard, it becomes
>> much less likely for this to eventually take place. It would
>> be helpful, therefore, if as many individuals could comment
>> on at least the concept, if not the actual details. I would think
>> that only the very few individuals who were going to actually
>> implement the concept need to be concerned with the details
>> like which instruction code is used, the table of values and
>> how the value is provided to the PDP-11 program.
>>
>> At the very least, is there anyone who objects or who thinks
>> this would be a bad idea?
>
> Ok. Here is a short suggestion for you, then:
>
> Opcode 7 is, as far as I can tell, unused. (Someone correct me if I'm
> wrong).
>
> I suggest we adopt this opcode as CEM (Call EMulator).
Argh! Looking at an old document. Opcode 7 is in fact MFPT.
However, I can't find that opcode 10 is used. So let's go for that then.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-29 1:34 ` Jerome H. Fine
@ 2012-01-29 15:46 ` paramucho
2012-02-01 3:53 ` Jerome H. Fine
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-29 15:46 UTC (permalink / raw)
On Sat, 28 Jan 2012 20:34:32 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
> >paramucho wrote:
>
>>On Wed, 25 Jan 2012 22:22:05 -0500, "Jerome H. Fine" wrote:
>>
>>>I don't think that the about properties (or at least how
>>>the PDP-11 instructions react to the above code) has
>>>been documented under Ersatz-11. I would imagine
>>>that the source code could be used under SIMH to
>>>figure out why the above code is needed.
>>>
>>>I am VERY curious!!!!!!!!! How did you figure out the
>>>code for Ersatz-11? Did John Wilson help? Does the
>>>above code still work with V6.0 of E11?
>>>
>>I didn't use the source code for SimH. It's often easier to use a
>>debugger to "read" the system behavior than it is to hunt through
>>sources. I just experimented until I found a suitable test. I also
>>tested on real F11 and J11 systems.
>>
>>The trick was to find some "undefined" behavior that didn't need
>>correction. The code above gets different results from an F11 and a
>>J11 as well as from SimH and E11. The test is far from ideal, but it
>>works well enough for my purposes.
>>
>>The test works with V6.0 of E11.
>>
>After you "found" the way that SIMH can be tested for,
>were you able to verify that from the source code. To
>say the least, the activity that you found is VERY
>unexpected!!!!!!!!!
The source code isn't really relevant. Just the behavior.
>Also, what led you to attempt to use the hardware
>in that manner. It does not seem very obvious as
>to why the hardware registers (software in the case
>of a software emulator as opposed to a real DEC
>CPU) would behave in that fashion.
I spent the first year or so of my PDP-11 career working almost
entirely at the switch register of an 11/20. You learn to read the
binary state of the machine as "source code". I remember once during a
switch register session looking at the clock and noticing it was
twelve midnight. The next time I looked it was eight in the morning. I
still enjoy reading binary and making sense of it. I guess others here
have had similar experiences.
Selecting the MMU registers was initially process of elimination.
Following that, I knew that E11 doesn't actually attempt to fully
implement MMU register SR1. I started playing around on a J11 and F11
to see what happened when I jammed those registers in an illogical
manner. After a little experimentation I found a test which came out
differently on the F11 to the J11. Then I played around with E11 and
SimH. It's not that hard, and it's not the ideal test either.
>Can anyone else verify what Ian found?
RUST/SJ runs the test everytime it boots. It currently issues a
message when its booted under SimH or E11. Actually, the message is a
bit annoying and needs to be muted except in verbose boot mode.
I also have a little ENV.SAV utility which runs the test. I'll try to
find the time to put it on my upload site (where I still have to find
the time to package and upload the RUST driver sources).
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-15 14:37 PDP11 Values from MFPT Jerome H. Fine
2012-01-18 6:03 ` paramucho
2012-01-18 11:20 ` Johnny Billquist
@ 2012-01-30 2:21 ` Bob Supnik
2012-01-31 7:14 ` paramucho
2012-02-01 3:54 ` Jerome H. Fine
2 siblings, 2 replies; 222+ messages in thread
From: Bob Supnik @ 2012-01-30 2:21 UTC (permalink / raw)
No. Just no. SimH will never add "features" that didn't exist in the
real hardware.
The maintenance register (MAINT) is already read/write. After it has
been initialized, you can set arbitrary values in it to create "new"
models, at least for processors (like the J-11) that implement it.
The model emulation in SimH is not perfect, which is why clever
software can detect it. But the intent is to mimic real systems. SimH
is not a "different" PDP11.
/Bob Supnik
On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
> I have an interesting hardware question.
>
>I have been looking at the results for the program RESORC.SAV in RT-11
>with respect the MFPT instruction. When the J11 chip is used, the value
>is 5 and the Maintenance Register at 177750 seems to determine what the
>rest of the actual hardware supports.
>
>I thought it would also be helpful for the user to know if an emulator
>is being
>used, either software or hardware, or if perhaps some other 3rd party
>hardware
>CPU. I would probably target the various 3rd party boards as far as
>hardware
>is concerned (such as QED and Mentec). For software emulators, I would
>suggest that only the high end PDP-11 processors be supported (the DEC
>CPUs which support the MFPT instruction) in order to keep things simple,
>at least initially.
>
>An incomplete list of software emulators is:
>SIMH
>Ersatz-11
>
>An incomplete list of hardware boards is:
>QED - more than 1?
>Mentec - at least 3
>and I can remember at least 2 others, but not the company names.
>
>Right now the Logical Co. has a combined emulator called a
>PDQ-1000 board which actually plugs into a Qbus which takes
>only 4 slots, but includes CPU, memory and many controllers.
>
>Thus far, the high order byte of the MFPT instruction always seems
>to be zero and is currently ignored by the RESORC.SAV program.
>Under SIMH and Ersatz-11, it would be trivial to use the high order
>byte of the MFPT instruction to signify which software emulator is
>being used.
>
>Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>available determine the actual value returned by the MFPT instruction?
>As far as I know:
>
>MFPT Value Hardware
> 1 PDP-11/44
> 3 PDP-11/24 (should be 2)
> 3 PDP-11/23
> 4 SBC-11/21
> 5 All J11 chips including 11/73, 11/83, 11/93
>
>I assume that it would be extremely difficult, probably not worth the
>effort, to modify the high order byte of the MFPT instruction at this
>point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>Can anyone comment on this assumption? Might there be another
>way for hardware to the tell a user which 3rd party board is being
>used as a PDP-11?
>
>The other possibility is to use the Maintenance Register at 177750,
>although I suspect that there might not be any more bit available.
>
>Jerome Fine
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-30 2:21 ` Bob Supnik
@ 2012-01-31 7:14 ` paramucho
2012-01-31 9:42 ` Johnny Billquist
2012-02-01 3:54 ` Jerome H. Fine
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-01-31 7:14 UTC (permalink / raw)
On Sun, 29 Jan 2012 21:21:04 -0500, Bob Supnik <bob AT supnik DOT org>
wrote:
>No. Just no. SimH will never add "features" that didn't exist in the
>real hardware.
>
>The maintenance register (MAINT) is already read/write. After it has
>been initialized, you can set arbitrary values in it to create "new"
>models, at least for processors (like the J-11) that implement it.
>
>The model emulation in SimH is not perfect, which is why clever
>software can detect it. But the intent is to mimic real systems. SimH
>is not a "different" PDP11.
>
>/Bob Supnik
>On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
><everyone@nospam.com> wrote:
>
>> I have an interesting hardware question.
<snip>
>>Thus far, the high order byte of the MFPT instruction always seems
>>to be zero and is currently ignored by the RESORC.SAV program.
>>Under SIMH and Ersatz-11, it would be trivial to use the high order
>>byte of the MFPT instruction to signify which software emulator is
>>being used.
>>
>>Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>>available determine the actual value returned by the MFPT instruction?
>>As far as I know:
>>
>>MFPT Value Hardware
>> 1 PDP-11/44
>> 3 PDP-11/24 (should be 2)
>> 3 PDP-11/23
>> 4 SBC-11/21
>> 5 All J11 chips including 11/73, 11/83, 11/93
>>
>>I assume that it would be extremely difficult, probably not worth the
>>effort, to modify the high order byte of the MFPT instruction at this
>>point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>>Can anyone comment on this assumption? Might there be another
>>way for hardware to the tell a user which 3rd party board is being
>>used as a PDP-11?
>>
>>The other possibility is to use the Maintenance Register at 177750,
>>although I suspect that there might not be any more bit available.
>>
>>Jerome Fine
Perhaps a better way to implement this functionality, if it is worth
implementing at all, is in the form of a new custom device, freeing it
from any dependency on a particular CPU's facilities. The same psuedo-
device could be implemented for E11 using the E11 plug-in facilities.
V11 would just add a code module.
Going back to Bob Supnik's comments, the implementation of a new
"different" device doesn't materially alter the CPU architecture of
"real" PDP-11 systems. PDP-11s have always supported custom devices.
Clearly, one would not expect the standard SimH deliverable to include
this custom device, but there are already specialized versions of SimH
such as the Pro version.
The PDP-11 client-side interface to the device could be direct
addressing for bootstrap/kernel code, or via a driver to provide
access for user-mode processes.
Implementing an emulator device is not as trivial as inserting a new
instruction for something as simple as a Move-From-Emulator-Type
instruction. However, a device is a more convenient way of packaging
the functionality if you want to implement a more complex API (which
is what I have).
All that said, we need to ask: Do We Really Need This Functionality?
If we don't, the idea will merely live and flourish for a few months
only to later wither on the vine... It's a nice idea, but there are
lots of nice ideas...
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-31 7:14 ` paramucho
@ 2012-01-31 9:42 ` Johnny Billquist
2012-01-31 14:24 ` Bill Gunshannon
` (2 more replies)
0 siblings, 3 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-01-31 9:42 UTC (permalink / raw)
On 2012-01-31 08.14, paramucho wrote:
> On Sun, 29 Jan 2012 21:21:04 -0500, Bob Supnik<bob AT supnik DOT org>
> wrote:
>
>> No. Just no. SimH will never add "features" that didn't exist in the
>> real hardware.
>>
>> The maintenance register (MAINT) is already read/write. After it has
>> been initialized, you can set arbitrary values in it to create "new"
>> models, at least for processors (like the J-11) that implement it.
>>
>> The model emulation in SimH is not perfect, which is why clever
>> software can detect it. But the intent is to mimic real systems. SimH
>> is not a "different" PDP11.
>>
>> /Bob Supnik
>> On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
>> <everyone@nospam.com> wrote:
>>
>>> I have an interesting hardware question.
> <snip>
>
>>> Thus far, the high order byte of the MFPT instruction always seems
>>> to be zero and is currently ignored by the RESORC.SAV program.
>>> Under SIMH and Ersatz-11, it would be trivial to use the high order
>>> byte of the MFPT instruction to signify which software emulator is
>>> being used.
>>>
>>> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>>> available determine the actual value returned by the MFPT instruction?
>>> As far as I know:
>>>
>>> MFPT Value Hardware
>>> 1 PDP-11/44
>>> 3 PDP-11/24 (should be 2)
>>> 3 PDP-11/23
>>> 4 SBC-11/21
>>> 5 All J11 chips including 11/73, 11/83, 11/93
>>>
>>> I assume that it would be extremely difficult, probably not worth the
>>> effort, to modify the high order byte of the MFPT instruction at this
>>> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>>> Can anyone comment on this assumption? Might there be another
>>> way for hardware to the tell a user which 3rd party board is being
>>> used as a PDP-11?
>>>
>>> The other possibility is to use the Maintenance Register at 177750,
>>> although I suspect that there might not be any more bit available.
>>>
>>> Jerome Fine
>
> Perhaps a better way to implement this functionality, if it is worth
> implementing at all, is in the form of a new custom device, freeing it
> from any dependency on a particular CPU's facilities. The same psuedo-
> device could be implemented for E11 using the E11 plug-in facilities.
> V11 would just add a code module.
>
> Going back to Bob Supnik's comments, the implementation of a new
> "different" device doesn't materially alter the CPU architecture of
> "real" PDP-11 systems. PDP-11s have always supported custom devices.
> Clearly, one would not expect the standard SimH deliverable to include
> this custom device, but there are already specialized versions of SimH
> such as the Pro version.
>
> The PDP-11 client-side interface to the device could be direct
> addressing for bootstrap/kernel code, or via a driver to provide
> access for user-mode processes.
>
> Implementing an emulator device is not as trivial as inserting a new
> instruction for something as simple as a Move-From-Emulator-Type
> instruction. However, a device is a more convenient way of packaging
> the functionality if you want to implement a more complex API (which
> is what I have).
>
> All that said, we need to ask: Do We Really Need This Functionality?
> If we don't, the idea will merely live and flourish for a few months
> only to later wither on the vine... It's a nice idea, but there are
> lots of nice ideas...
I don't particularly feel we need this at all, but since Jerome asked, I
(and you, and others...) answered.
If one absolutely do want a way, then I still think that a new
instruction is the right way to go. Adding a device is both problematic
since it could very well be implemented in a real machine, and also
because if you are to do it properly, it needs to be defined in the
order of floating CSR space, and adopted properly, or else all kind of
autodetection of devices will fail in spectacular ways. I'm not sure any
room is left around in the fixed CSR space...
And that would mean it needs to move around depending on what other
hardware you have, which in turn will make it very hard for any software
to actually use unless they implement the whole autodetection algorithm,
which in turn also might make it difficult to use under a running OS,
not to mention the fact that if you configure things wrong, it will not
work right at all.
But, to reiterate my stand, I don't particularly feel the need for this
at all. And I am unclear on what Jerome needs, and why.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-31 9:42 ` Johnny Billquist
@ 2012-01-31 14:24 ` Bill Gunshannon
2012-01-31 20:17 ` Johnny Billquist
2012-02-01 5:28 ` Charles Richmond
2012-02-01 3:55 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
2 siblings, 2 replies; 222+ messages in thread
From: Bill Gunshannon @ 2012-01-31 14:24 UTC (permalink / raw)
In article <jg8d26$a1d$1@iltempo.update.uu.se>,
Johnny Billquist <bqt@softjar.se> writes:
> On 2012-01-31 08.14, paramucho wrote:
>> On Sun, 29 Jan 2012 21:21:04 -0500, Bob Supnik<bob AT supnik DOT org>
>> wrote:
>>
>>> No. Just no. SimH will never add "features" that didn't exist in the
>>> real hardware.
>>>
>>> The maintenance register (MAINT) is already read/write. After it has
>>> been initialized, you can set arbitrary values in it to create "new"
>>> models, at least for processors (like the J-11) that implement it.
>>>
>>> The model emulation in SimH is not perfect, which is why clever
>>> software can detect it. But the intent is to mimic real systems. SimH
>>> is not a "different" PDP11.
>>>
>>> /Bob Supnik
>>> On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
>>> <everyone@nospam.com> wrote:
>>>
>>>> I have an interesting hardware question.
>> <snip>
>>
>>>> Thus far, the high order byte of the MFPT instruction always seems
>>>> to be zero and is currently ignored by the RESORC.SAV program.
>>>> Under SIMH and Ersatz-11, it would be trivial to use the high order
>>>> byte of the MFPT instruction to signify which software emulator is
>>>> being used.
>>>>
>>>> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>>>> available determine the actual value returned by the MFPT instruction?
>>>> As far as I know:
>>>>
>>>> MFPT Value Hardware
>>>> 1 PDP-11/44
>>>> 3 PDP-11/24 (should be 2)
>>>> 3 PDP-11/23
>>>> 4 SBC-11/21
>>>> 5 All J11 chips including 11/73, 11/83, 11/93
>>>>
>>>> I assume that it would be extremely difficult, probably not worth the
>>>> effort, to modify the high order byte of the MFPT instruction at this
>>>> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>>>> Can anyone comment on this assumption? Might there be another
>>>> way for hardware to the tell a user which 3rd party board is being
>>>> used as a PDP-11?
>>>>
>>>> The other possibility is to use the Maintenance Register at 177750,
>>>> although I suspect that there might not be any more bit available.
>>>>
>>>> Jerome Fine
>>
>> Perhaps a better way to implement this functionality, if it is worth
>> implementing at all, is in the form of a new custom device, freeing it
>> from any dependency on a particular CPU's facilities. The same psuedo-
>> device could be implemented for E11 using the E11 plug-in facilities.
>> V11 would just add a code module.
>>
>> Going back to Bob Supnik's comments, the implementation of a new
>> "different" device doesn't materially alter the CPU architecture of
>> "real" PDP-11 systems. PDP-11s have always supported custom devices.
>> Clearly, one would not expect the standard SimH deliverable to include
>> this custom device, but there are already specialized versions of SimH
>> such as the Pro version.
>>
>> The PDP-11 client-side interface to the device could be direct
>> addressing for bootstrap/kernel code, or via a driver to provide
>> access for user-mode processes.
>>
>> Implementing an emulator device is not as trivial as inserting a new
>> instruction for something as simple as a Move-From-Emulator-Type
>> instruction. However, a device is a more convenient way of packaging
>> the functionality if you want to implement a more complex API (which
>> is what I have).
>>
>> All that said, we need to ask: Do We Really Need This Functionality?
>> If we don't, the idea will merely live and flourish for a few months
>> only to later wither on the vine... It's a nice idea, but there are
>> lots of nice ideas...
>
> I don't particularly feel we need this at all, but since Jerome asked, I
> (and you, and others...) answered.
> If one absolutely do want a way, then I still think that a new
> instruction is the right way to go. Adding a device is both problematic
> since it could very well be implemented in a real machine, and also
> because if you are to do it properly, it needs to be defined in the
> order of floating CSR space, and adopted properly, or else all kind of
> autodetection of devices will fail in spectacular ways. I'm not sure any
> room is left around in the fixed CSR space...
> And that would mean it needs to move around depending on what other
> hardware you have, which in turn will make it very hard for any software
> to actually use unless they implement the whole autodetection algorithm,
> which in turn also might make it difficult to use under a running OS,
> not to mention the fact that if you configure things wrong, it will not
> work right at all.
>
> But, to reiterate my stand, I don't particularly feel the need for this
> at all. And I am unclear on what Jerome needs, and why.
Let me throw a couple comments out in regards this latest discussion.
First, on Bob's comment about what will or will not go into SIMH, I
totally agree that the base SIMH needs to remain just what it is, an
emulator of real hardware. But I would be in favor of a fork of SIMH
for experimenters where the internal engine was used to add or change
features of the hardware for the pure academic sake of seeing if the
architecture was really at a dead end or if one could have done things
with the PDP-11 (and the VAX, for that matter) to extend the architecture
while remaining compatable with the old architecture, much like what
IBM dod with the 360 <-> 390.
On, on this latest piece, I agree with Johnny that creating a bogus
device to identify what the processor is is more work than needed
and because such a device would never exist anyway, kind of meaningless.
Assuming that there is a serious need/desire to be able to identify a
processor using some external means provided by the operator, why
not create a pseudo-dongle that can hang off of an unused (or even a
used one with a little more work) serial port that can be queried to
identify the processor? Advantage is it requires no architectural
change to the underlying hardware, emulated or real. It could also
be created in real hardware with out too much difficulty if one wanted
to move this from the emulated PDP world to real hardware.
bill
--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
billg999@cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-31 14:24 ` Bill Gunshannon
@ 2012-01-31 20:17 ` Johnny Billquist
2012-01-31 21:39 ` Bill Gunshannon
2012-02-01 5:28 ` Charles Richmond
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-01-31 20:17 UTC (permalink / raw)
On 2012-01-31 15.24, Bill Gunshannon wrote:
> In article<jg8d26$a1d$1@iltempo.update.uu.se>,
> Johnny Billquist<bqt@softjar.se> writes:
>> On 2012-01-31 08.14, paramucho wrote:
>>> On Sun, 29 Jan 2012 21:21:04 -0500, Bob Supnik<bob AT supnik DOT org>
>>> wrote:
>>>
>>>> No. Just no. SimH will never add "features" that didn't exist in the
>>>> real hardware.
>>>>
>>>> The maintenance register (MAINT) is already read/write. After it has
>>>> been initialized, you can set arbitrary values in it to create "new"
>>>> models, at least for processors (like the J-11) that implement it.
>>>>
>>>> The model emulation in SimH is not perfect, which is why clever
>>>> software can detect it. But the intent is to mimic real systems. SimH
>>>> is not a "different" PDP11.
>>>>
>>>> /Bob Supnik
>>>> On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
>>>> <everyone@nospam.com> wrote:
>>>>
>>>>> I have an interesting hardware question.
>>> <snip>
>>>
>>>>> Thus far, the high order byte of the MFPT instruction always seems
>>>>> to be zero and is currently ignored by the RESORC.SAV program.
>>>>> Under SIMH and Ersatz-11, it would be trivial to use the high order
>>>>> byte of the MFPT instruction to signify which software emulator is
>>>>> being used.
>>>>>
>>>>> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>>>>> available determine the actual value returned by the MFPT instruction?
>>>>> As far as I know:
>>>>>
>>>>> MFPT Value Hardware
>>>>> 1 PDP-11/44
>>>>> 3 PDP-11/24 (should be 2)
>>>>> 3 PDP-11/23
>>>>> 4 SBC-11/21
>>>>> 5 All J11 chips including 11/73, 11/83, 11/93
>>>>>
>>>>> I assume that it would be extremely difficult, probably not worth the
>>>>> effort, to modify the high order byte of the MFPT instruction at this
>>>>> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>>>>> Can anyone comment on this assumption? Might there be another
>>>>> way for hardware to the tell a user which 3rd party board is being
>>>>> used as a PDP-11?
>>>>>
>>>>> The other possibility is to use the Maintenance Register at 177750,
>>>>> although I suspect that there might not be any more bit available.
>>>>>
>>>>> Jerome Fine
>>>
>>> Perhaps a better way to implement this functionality, if it is worth
>>> implementing at all, is in the form of a new custom device, freeing it
>>> from any dependency on a particular CPU's facilities. The same psuedo-
>>> device could be implemented for E11 using the E11 plug-in facilities.
>>> V11 would just add a code module.
>>>
>>> Going back to Bob Supnik's comments, the implementation of a new
>>> "different" device doesn't materially alter the CPU architecture of
>>> "real" PDP-11 systems. PDP-11s have always supported custom devices.
>>> Clearly, one would not expect the standard SimH deliverable to include
>>> this custom device, but there are already specialized versions of SimH
>>> such as the Pro version.
>>>
>>> The PDP-11 client-side interface to the device could be direct
>>> addressing for bootstrap/kernel code, or via a driver to provide
>>> access for user-mode processes.
>>>
>>> Implementing an emulator device is not as trivial as inserting a new
>>> instruction for something as simple as a Move-From-Emulator-Type
>>> instruction. However, a device is a more convenient way of packaging
>>> the functionality if you want to implement a more complex API (which
>>> is what I have).
>>>
>>> All that said, we need to ask: Do We Really Need This Functionality?
>>> If we don't, the idea will merely live and flourish for a few months
>>> only to later wither on the vine... It's a nice idea, but there are
>>> lots of nice ideas...
>>
>> I don't particularly feel we need this at all, but since Jerome asked, I
>> (and you, and others...) answered.
>> If one absolutely do want a way, then I still think that a new
>> instruction is the right way to go. Adding a device is both problematic
>> since it could very well be implemented in a real machine, and also
>> because if you are to do it properly, it needs to be defined in the
>> order of floating CSR space, and adopted properly, or else all kind of
>> autodetection of devices will fail in spectacular ways. I'm not sure any
>> room is left around in the fixed CSR space...
>> And that would mean it needs to move around depending on what other
>> hardware you have, which in turn will make it very hard for any software
>> to actually use unless they implement the whole autodetection algorithm,
>> which in turn also might make it difficult to use under a running OS,
>> not to mention the fact that if you configure things wrong, it will not
>> work right at all.
>>
>> But, to reiterate my stand, I don't particularly feel the need for this
>> at all. And I am unclear on what Jerome needs, and why.
>
> Let me throw a couple comments out in regards this latest discussion.
> First, on Bob's comment about what will or will not go into SIMH, I
> totally agree that the base SIMH needs to remain just what it is, an
> emulator of real hardware. But I would be in favor of a fork of SIMH
> for experimenters where the internal engine was used to add or change
> features of the hardware for the pure academic sake of seeing if the
> architecture was really at a dead end or if one could have done things
> with the PDP-11 (and the VAX, for that matter) to extend the architecture
> while remaining compatable with the old architecture, much like what
> IBM dod with the 360<-> 390.
Hmm. That is a totally different question. It might be worth playing
with in its own right, but I doubt there will much point, unless you
also could modify all software to actually use this. That might be hard,
so I'm not sure it would lead anywhere.
Anyway, for such a thing a proper fork would be right. It's not
emulating any existing machine.
> On, on this latest piece, I agree with Johnny that creating a bogus
> device to identify what the processor is is more work than needed
> and because such a device would never exist anyway, kind of meaningless.
> Assuming that there is a serious need/desire to be able to identify a
> processor using some external means provided by the operator, why
> not create a pseudo-dongle that can hang off of an unused (or even a
> used one with a little more work) serial port that can be queried to
> identify the processor? Advantage is it requires no architectural
> change to the underlying hardware, emulated or real. It could also
> be created in real hardware with out too much difficulty if one wanted
> to move this from the emulated PDP world to real hardware.
Oh! Yuck! But I guess it depends on what the purpose of that thing
should be. Just a way to identify a machine, or a way to identify a
machine running under E11/Simh/whatever. In the latter case, a serial
dongle would definitely be wrong. In the former case, what would it be
used for at all?
I can, just for curiositys sake, understand that you might want to find
out if you are running under Simh or whatever. But then you need to do
something in Simh which is not possibly under any existing other machine.
As an extension to this, you could also add new features, which would be
used when identified as such a machine, but this seems unlikely in general.
As I said from the start, I'm not sure what the point of all this is. :-)
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-31 20:17 ` Johnny Billquist
@ 2012-01-31 21:39 ` Bill Gunshannon
2012-01-31 23:43 ` glen herrmannsfeldt
` (2 more replies)
0 siblings, 3 replies; 222+ messages in thread
From: Bill Gunshannon @ 2012-01-31 21:39 UTC (permalink / raw)
In article <jg9i9n$n3i$1@iltempo.update.uu.se>,
Johnny Billquist <bqt@softjar.se> writes:
> On 2012-01-31 15.24, Bill Gunshannon wrote:
>> In article<jg8d26$a1d$1@iltempo.update.uu.se>,
>> Johnny Billquist<bqt@softjar.se> writes:
>>> On 2012-01-31 08.14, paramucho wrote:
>>>> On Sun, 29 Jan 2012 21:21:04 -0500, Bob Supnik<bob AT supnik DOT org>
>>>> wrote:
>>>>
>>>>> No. Just no. SimH will never add "features" that didn't exist in the
>>>>> real hardware.
>>>>>
>>>>> The maintenance register (MAINT) is already read/write. After it has
>>>>> been initialized, you can set arbitrary values in it to create "new"
>>>>> models, at least for processors (like the J-11) that implement it.
>>>>>
>>>>> The model emulation in SimH is not perfect, which is why clever
>>>>> software can detect it. But the intent is to mimic real systems. SimH
>>>>> is not a "different" PDP11.
>>>>>
>>>>> /Bob Supnik
>>>>> On Sun, 15 Jan 2012 09:37:21 -0500, "Jerome H. Fine"
>>>>> <everyone@nospam.com> wrote:
>>>>>
>>>>>> I have an interesting hardware question.
>>>> <snip>
>>>>
>>>>>> Thus far, the high order byte of the MFPT instruction always seems
>>>>>> to be zero and is currently ignored by the RESORC.SAV program.
>>>>>> Under SIMH and Ersatz-11, it would be trivial to use the high order
>>>>>> byte of the MFPT instruction to signify which software emulator is
>>>>>> being used.
>>>>>>
>>>>>> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>>>>>> available determine the actual value returned by the MFPT instruction?
>>>>>> As far as I know:
>>>>>>
>>>>>> MFPT Value Hardware
>>>>>> 1 PDP-11/44
>>>>>> 3 PDP-11/24 (should be 2)
>>>>>> 3 PDP-11/23
>>>>>> 4 SBC-11/21
>>>>>> 5 All J11 chips including 11/73, 11/83, 11/93
>>>>>>
>>>>>> I assume that it would be extremely difficult, probably not worth the
>>>>>> effort, to modify the high order byte of the MFPT instruction at this
>>>>>> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>>>>>> Can anyone comment on this assumption? Might there be another
>>>>>> way for hardware to the tell a user which 3rd party board is being
>>>>>> used as a PDP-11?
>>>>>>
>>>>>> The other possibility is to use the Maintenance Register at 177750,
>>>>>> although I suspect that there might not be any more bit available.
>>>>>>
>>>>>> Jerome Fine
>>>>
>>>> Perhaps a better way to implement this functionality, if it is worth
>>>> implementing at all, is in the form of a new custom device, freeing it
>>>> from any dependency on a particular CPU's facilities. The same psuedo-
>>>> device could be implemented for E11 using the E11 plug-in facilities.
>>>> V11 would just add a code module.
>>>>
>>>> Going back to Bob Supnik's comments, the implementation of a new
>>>> "different" device doesn't materially alter the CPU architecture of
>>>> "real" PDP-11 systems. PDP-11s have always supported custom devices.
>>>> Clearly, one would not expect the standard SimH deliverable to include
>>>> this custom device, but there are already specialized versions of SimH
>>>> such as the Pro version.
>>>>
>>>> The PDP-11 client-side interface to the device could be direct
>>>> addressing for bootstrap/kernel code, or via a driver to provide
>>>> access for user-mode processes.
>>>>
>>>> Implementing an emulator device is not as trivial as inserting a new
>>>> instruction for something as simple as a Move-From-Emulator-Type
>>>> instruction. However, a device is a more convenient way of packaging
>>>> the functionality if you want to implement a more complex API (which
>>>> is what I have).
>>>>
>>>> All that said, we need to ask: Do We Really Need This Functionality?
>>>> If we don't, the idea will merely live and flourish for a few months
>>>> only to later wither on the vine... It's a nice idea, but there are
>>>> lots of nice ideas...
>>>
>>> I don't particularly feel we need this at all, but since Jerome asked, I
>>> (and you, and others...) answered.
>>> If one absolutely do want a way, then I still think that a new
>>> instruction is the right way to go. Adding a device is both problematic
>>> since it could very well be implemented in a real machine, and also
>>> because if you are to do it properly, it needs to be defined in the
>>> order of floating CSR space, and adopted properly, or else all kind of
>>> autodetection of devices will fail in spectacular ways. I'm not sure any
>>> room is left around in the fixed CSR space...
>>> And that would mean it needs to move around depending on what other
>>> hardware you have, which in turn will make it very hard for any software
>>> to actually use unless they implement the whole autodetection algorithm,
>>> which in turn also might make it difficult to use under a running OS,
>>> not to mention the fact that if you configure things wrong, it will not
>>> work right at all.
>>>
>>> But, to reiterate my stand, I don't particularly feel the need for this
>>> at all. And I am unclear on what Jerome needs, and why.
>>
>> Let me throw a couple comments out in regards this latest discussion.
>> First, on Bob's comment about what will or will not go into SIMH, I
>> totally agree that the base SIMH needs to remain just what it is, an
>> emulator of real hardware. But I would be in favor of a fork of SIMH
>> for experimenters where the internal engine was used to add or change
>> features of the hardware for the pure academic sake of seeing if the
>> architecture was really at a dead end or if one could have done things
>> with the PDP-11 (and the VAX, for that matter) to extend the architecture
>> while remaining compatable with the old architecture, much like what
>> IBM dod with the 360<-> 390.
>
> Hmm. That is a totally different question. It might be worth playing
> with in its own right, but I doubt there will much point, unless you
> also could modify all software to actually use this. That might be hard,
> so I'm not sure it would lead anywhere.
> Anyway, for such a thing a proper fork would be right. It's not
> emulating any existing machine.
>
>> On, on this latest piece, I agree with Johnny that creating a bogus
>> device to identify what the processor is is more work than needed
>> and because such a device would never exist anyway, kind of meaningless.
>> Assuming that there is a serious need/desire to be able to identify a
>> processor using some external means provided by the operator, why
>> not create a pseudo-dongle that can hang off of an unused (or even a
>> used one with a little more work) serial port that can be queried to
>> identify the processor? Advantage is it requires no architectural
>> change to the underlying hardware, emulated or real. It could also
>> be created in real hardware with out too much difficulty if one wanted
>> to move this from the emulated PDP world to real hardware.
>
> Oh! Yuck!
Yeah, I know...
> But I guess it depends on what the purpose of that thing
> should be. Just a way to identify a machine,
Maybe I just came in late, but that's what I thought people wanted.
> or a way to identify a
> machine running under E11/Simh/whatever.
But isn't the inability to tell you are running on an emulator the
true proof that the emulator works?
> In the latter case, a serial
> dongle would definitely be wrong. In the former case, what would it be
> used for at all?
Again, I think I came in late but I thought someone was looking for
a way to query a machine about what processor it had. Ah for the
days of having software accesable front panel switches. :-)
>
> I can, just for curiositys sake, understand that you might want to find
> out if you are running under Simh or whatever. But then you need to do
> something in Simh which is not possibly under any existing other machine.
See my comment above!! If there is anythjing in the emulator that is not
the same as the real thing, then the emulator needs to be fixed.
>
> As an extension to this, you could also add new features, which would be
> used when identified as such a machine, but this seems unlikely in general.
But I think new features belongs in the fork mentioned above.
>
> As I said from the start, I'm not sure what the point of all this is. :-)
>
Me neither. Maybe I should have stayed out of it. :-)
bill
--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
billg999@cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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 12:14 ` Johnny Billquist
2 siblings, 0 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-01-31 23:43 UTC (permalink / raw)
In vmsnet.pdp-11 Bill Gunshannon <billg999@cs.uofs.edu> wrote:
> In article <jg9i9n$n3i$1@iltempo.update.uu.se>,
> Johnny Billquist <bqt@softjar.se> writes:
(snip)
> Yeah, I know...
>> But I guess it depends on what the purpose of that thing
>> should be. Just a way to identify a machine,
> Maybe I just came in late, but that's what I thought people wanted.
>> or a way to identify a
>> machine running under E11/Simh/whatever.
> But isn't the inability to tell you are running on an emulator the
> true proof that the emulator works?
I suppose, but even in real processors there are leaks.
Maybe instead, doing things that you would normally do on a real
processor, you shouldn't be able to tell. I haven't followed the PDP-11
differences so well, but I remember some of the intel ones.
The 8086 has a six-byte prefetch queue, such that self modifying code
must modify far enough ahead that it hasn't been fetched yet. That is
part of the 8086 definition. The 8088, which came later, only has a four
byte prefetch queue. By careful self-modification, I believe using a
sequence defined by intel, one can tell them apart. If intel was careful
to leave such modification undefined for the 8086, then legal 8086 code,
expecting a specific result, could never execute that sequence.
On the other hand, there is a mistake in the 68020, preventing one from
generating virtual machines. That is, running virtual machines in user
mode, while trapping and simulating privileged instructions. In the
68020 user mode, one can examine the flag bit indicating user/supervisor
mode, such that it would give the wrong value. The flag bit is defined
to be user readable, such that legal programs could depend on it.
(An OS might use it to check what mode a routine is being executed in.)
(snip)
> Again, I think I came in late but I thought someone was looking for
> a way to query a machine about what processor it had. Ah for the
> days of having software accesable front panel switches. :-)
>> I can, just for curiositys sake, understand that you might want to find
>> out if you are running under Simh or whatever. But then you need to do
>> something in Simh which is not possibly under any existing other machine.
> See my comment above!! If there is anythjing in the emulator that is not
> the same as the real thing, then the emulator needs to be fixed.
So the 8088 is a broken 8086? Again, if anything is not the same, and is
defined to be legal on the real machine, then it needs to be fixed.
>> As an extension to this, you could also add new features, which would be
>> used when identified as such a machine, but this seems unlikely in general.
> But I think new features belongs in the fork mentioned above.
The OS/2 emulation of DOS (in 1.0) and Windows (in later versions)
allowed for some specific differences. One of the favorite things to do
in emulated systems is allow I/O outside the emulation. OS/2, at some
point, allowed for a special device driver that would only run in
virtual machines. That allows, at least, faster I/O instead of complete
emulation of the I/O sequence. It also allows, if I remember, long file
names that DOS otherwise wouldn't allow. Exactly what would happen if
you ran that outside OS/2, I don't know.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-29 15:46 ` paramucho
@ 2012-02-01 3:53 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-01 3:53 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 3592 bytes --]
>paramucho wrote:
>On Sat, 28 Jan 2012 20:34:32 -0500, "Jerome H. Fine" wrote:
>
>>>>paramucho wrote:
>>>
>>>
>>>>On Wed, 25 Jan 2012 22:22:05 -0500, "Jerome H. Fine" wrote:
>>>
>>>>I don't think that the about properties (or at least how
>>>>the PDP-11 instructions react to the above code) has
>>>>been documented under Ersatz-11. I would imagine
>>>>that the source code could be used under SIMH to
>>>>figure out why the above code is needed.
>>>>
>>>>I am VERY curious!!!!!!!!! How did you figure out the
>>>>code for Ersatz-11? Did John Wilson help? Does the
>>>>above code still work with V6.0 of E11?
>>>>
>>>I didn't use the source code for SimH. It's often easier to use a
>>>debugger to "read" the system behavior than it is to hunt through
>>>sources. I just experimented until I found a suitable test. I also
>>>tested on real F11 and J11 systems.
>>>
>>>The trick was to find some "undefined" behavior that didn't need
>>>correction. The code above gets different results from an F11 and a
>>>J11 as well as from SimH and E11. The test is far from ideal, but it
>>>works well enough for my purposes.
>>>
>>>The test works with V6.0 of E11.
>>>
>>After you "found" the way that SIMH can be tested for,
>>were you able to verify that from the source code. To
>>say the least, the activity that you found is VERY
>>unexpected!!!!!!!!!
>>
>The source code isn't really relevant. Just the behavior.
>
>
I guess that finding the difference on the F11 and J11 systems
was the key.
>>Also, what led you to attempt to use the hardware
>>in that manner. It does not seem very obvious as
>>to why the hardware registers (software in the case
>>of a software emulator as opposed to a real DEC
>>CPU) would behave in that fashion.
>>
>I spent the first year or so of my PDP-11 career working almost
>entirely at the switch register of an 11/20. You learn to read the
>binary state of the machine as "source code". I remember once during a
>switch register session looking at the clock and noticing it was
>twelve midnight. The next time I looked it was eight in the morning. I
>still enjoy reading binary and making sense of it. I guess others here
>have had similar experiences.
>
>Selecting the MMU registers was initially process of elimination.
>Following that, I knew that E11 doesn't actually attempt to fully
>implement MMU register SR1. I started playing around on a J11 and F11
>to see what happened when I jammed those registers in an illogical
>manner. After a little experimentation I found a test which came out
>differently on the F11 to the J11. Then I played around with E11 and
>SimH. It's not that hard, and it's not the ideal test either.
>
>
While I agree it is not the ideal test, the
fact that it works and is actually quite
simple is what is important.
>>Can anyone else verify what Ian found?
>>
>>
>
>RUST/SJ runs the test everytime it boots. It currently issues a
>message when its booted under SimH or E11. Actually, the message is a
>bit annoying and needs to be muted except in verbose boot mode.
>
>I also have a little ENV.SAV utility which runs the test. I'll try to
>find the time to put it on my upload site (where I still have to find
>the time to package and upload the RUST driver sources).
>
>Ian
>
Thank you very much for sharing the code
for SIMH and E11. While I agree with
Johnny that using an instruction code which
is presently unused would be a clean solution,
the code which you show is certainly a good
substitute.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 4603 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-30 2:21 ` Bob Supnik
2012-01-31 7:14 ` paramucho
@ 2012-02-01 3:54 ` Jerome H. Fine
2012-02-01 12:09 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-01 3:54 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1545 bytes --]
>Bob Supnik wrote:
>No. Just no. SimH will never add "features" that didn't exist in the
>real hardware.
>
I understand and I agree that SimH should conform to that
goal.
However, I do have a question about a real hardware
CPU from Mentec? The M11 and N11 are capable
of being detected under RSX-11 and have the code
to display that CPU type as PDP-11/95 and PDP-11/97,
respectively - if I understand the code from RSX-11
correctly which does the identification.
Does SimH presently emulate these two Mentec boards
and if not, might that be a future addition to the code?
If the goal is to emulate only DEC PDP-11 CPUs,
then it would be reasonable to ignore the Mentec
CPUs. Otherwise, since Mentec seems to have sold
many such CPUs, it would seem reasonable to
include them. However, it might not be possible
given that it does not seem possible to locate any
manuals for the Mentec CPUs. bitsavers was negative
and a Google search was equally unproductive.
Google Search
http://www.google.ca/search?q=mentec+CPU+manuals&hl=en&source=hp&gbv=2&gs_sm=e&gs_upl=1219l16860l0l17063l30l30l0l21l21l0l250l1545l0.5.4l9l0&oq=mentec+CPU+manuals&aq=f&aqi=&aql
<http://www.google.ca/search?q=mentec+CPU+manuals&hl=en&source=hp&gbv=2&gs_sm=e&gs_upl=1219l16860l0l17063l30l30l0l21l21l0l250l1545l0.5.4l9l0&oq=mentec+CPU+manuals&aq=f&aqi=&aql>=
Mentec CPUs
http://en.wikipedia.org/wiki/Mentec_PDP-11
Sales Figures
http://www.fuse-network.com/fuse/demonstration/30/24675/24675.pdf
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 3601 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-31 9:42 ` Johnny Billquist
2012-01-31 14:24 ` Bill Gunshannon
@ 2012-02-01 3:55 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
2 siblings, 0 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-01 3:55 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]
>Johnny Billquist wrote:
> But, to reiterate my stand, I don't particularly feel the need for
> this at all. And I am unclear on what Jerome needs, and why.
Actually, it was because I have always wanted
to run RESORC.SAV as a virtual system job
so that I could see the memory being used
by the background job under RT-11. I initially
found a difficult way to do this until I stumbled
on a very easy method that only depended on
some initialization code when RESORC.SAV
was being initialized for the first time after which
that code was no longer needed.
Of course, one thing tends to lead to another
and I finally wondered about the hardware
environment. It seemed reasonable to find
out if RT-11 was running under an emulator,
so I decided to ask my question on usenet.
I agree that my initial suggestion of using the
value returned by MFPT is definitely not the
way to go.
And this has been one of the longer threads at
this point. Thank you everyone who has responded
and especially those who have offered their
help and advice.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 1613 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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 12:14 ` Johnny Billquist
2 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-01 3:56 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 2149 bytes --]
>Bill Gunshannon wrote:
>>As an extension to this, you could also add new features, which would be
>>used when identified as such a machine, but this seems unlikely in general.
>>
>But I think new features belongs in the fork mentioned above.
>
Actually, there is one feature that is in E11 which might
be interesting enough to use as an additional device, as
Johnny has mentioned, which is entirely compatible
with all real and other emulated PDP-11s if anyone
wants to write the code for SimH or produce the
actual hardware for a real DEC PDP-11.
I think I have mentioned what E11 uses as EMEM.DLL
which provides direct access to extremely large numbers
of bytes of PC memory. The DLL activates 4 IOPAGE
registers and when the user program references those
registers (or uses a device driver to reference them), E11
allows the user program to read and write the words.
Under Windows 98SE, I only have 768 MB of memory
on the system, but EMEM.DLL (I modified my version
supplied by John Wilson) allows me to allocate and access
up to 600 MB of PC memory. When I tested E11 on
a Windows XP system with 3 GB of physical memory,
EMEM.DLL allows me to access 1280 MB of PC
memory.
Since accessing the memory needed assembler subroutines
when I used FORTRAN 77, I wrote some that changed
to code the first time each subroutine was used to be inline
code instead of having the overhead of the CALL.
For those interested in the details, the 4 IOPAGE registers
are used as follows:
CSR+0: Read or Write the word - Mov @#CSR,R0 // Mov R0,@#CSR
CSR+2: Read or Write the word, then auto-increment 32 bit address
CSR+4: low order 16 bits of byte offset of PC memory - read/write
CSR+6: high order 16 bits of byte offset of PC memory- read/write
One additional question. E11 has a device called HD: or Hypothetical Disk.
It is very simple and supports GB of disk files as a device. Would anyone
be interested in supporting this hardware under SimH? It is just
as simple as the RK05, probably more so, but I don't use SimH
enough to want to spend the time. Is anyone interested?
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 2878 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-31 14:24 ` Bill Gunshannon
2012-01-31 20:17 ` Johnny Billquist
@ 2012-02-01 5:28 ` Charles Richmond
2012-02-01 11:54 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: Charles Richmond @ 2012-02-01 5:28 UTC (permalink / raw)
"Bill Gunshannon" <billg999@cs.uofs.edu> wrote in message
news:9oqbt8F9ipU1@mid.individual.net...
>
> [snip...] [snip...]
> [snip...]
>
> Let me throw a couple comments out in regards this latest discussion.
> First, on Bob's comment about what will or will not go into SIMH, I
> totally agree that the base SIMH needs to remain just what it is, an
> emulator of real hardware. But I would be in favor of a fork of SIMH
> for experimenters where the internal engine was used to add or change
> features of the hardware for the pure academic sake of seeing if the
> architecture was really at a dead end or if one could have done things
> with the PDP-11 (and the VAX, for that matter) to extend the architecture
> while remaining compatable with the old architecture, much like what
> IBM dod with the 360 <-> 390.
>
Although I have been aware of the existance of SIMH for a long time, I plead
ignorance about the details.
Isn't SIMH released under the GPL or similar license??? I know that anyone
has access to the source. So if a (very) interested party wanted to start
an off-shoot project based on the SIMH code, it seems like anyone could
legally and morally do that. Perhaps it would be called SIM-exp or
something... and *not* advertise or pretend to be a simulation of the real
hardware, but just an experimental platform to see what pie-in-the-sky
things could be built on top of what *was* the original hardware.
Could everyone (even Bob Supnik) be happy with such an off-shoot??? (*Not*
that Bob Supnik would want to contribute to the development of the SIM-exp
directly.)
--
+<><><><><><><><><><><><><><><><><><><>+
| Charles Richmond numerist@aquaporin4.com |
+<><><><><><><><><><><><><><><><><><><>+
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-01-31 9:42 ` Johnny Billquist
2012-01-31 14:24 ` Bill Gunshannon
2012-02-01 3:55 ` Jerome H. Fine
@ 2012-02-01 11:22 ` paramucho
2012-02-01 12:03 ` Johnny Billquist
2 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-01 11:22 UTC (permalink / raw)
On Tue, 31 Jan 2012 10:42:30 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>>>> Can anyone who has a DEC (or non-DEC) PDP-11 system easily
>>>> available determine the actual value returned by the MFPT instruction?
>>>> As far as I know:
>>>>
>>>> MFPT Value Hardware
>>>> 1 PDP-11/44
>>>> 3 PDP-11/24 (should be 2)
>>>> 3 PDP-11/23
>>>> 4 SBC-11/21
>>>> 5 All J11 chips including 11/73, 11/83, 11/93
>>>>
>>>> I assume that it would be extremely difficult, probably not worth the
>>>> effort, to modify the high order byte of the MFPT instruction at this
>>>> point for the 3rd party PDP-11 CPU boards, such as from Mentec.
>>>> Can anyone comment on this assumption? Might there be another
>>>> way for hardware to the tell a user which 3rd party board is being
>>>> used as a PDP-11?
>>>>
>>>> The other possibility is to use the Maintenance Register at 177750,
>>>> although I suspect that there might not be any more bit available.
>>>>
>>>> Jerome Fine
>>
>> Perhaps a better way to implement this functionality, if it is worth
>> implementing at all, is in the form of a new custom device, freeing it
>> from any dependency on a particular CPU's facilities. The same psuedo-
>> device could be implemented for E11 using the E11 plug-in facilities.
>> V11 would just add a code module.
>>
>> Going back to Bob Supnik's comments, the implementation of a new
>> "different" device doesn't materially alter the CPU architecture of
>> "real" PDP-11 systems. PDP-11s have always supported custom devices.
>> Clearly, one would not expect the standard SimH deliverable to include
>> this custom device, but there are already specialized versions of SimH
>> such as the Pro version.
>>
>> The PDP-11 client-side interface to the device could be direct
>> addressing for bootstrap/kernel code, or via a driver to provide
>> access for user-mode processes.
>>
>> Implementing an emulator device is not as trivial as inserting a new
>> instruction for something as simple as a Move-From-Emulator-Type
>> instruction. However, a device is a more convenient way of packaging
>> the functionality if you want to implement a more complex API (which
>> is what I have).
>>
>> All that said, we need to ask: Do We Really Need This Functionality?
>> If we don't, the idea will merely live and flourish for a few months
>> only to later wither on the vine... It's a nice idea, but there are
>> lots of nice ideas...
>
>I don't particularly feel we need this at all, but since Jerome asked, I
>(and you, and others...) answered.
>If one absolutely do want a way, then I still think that a new
>instruction is the right way to go. Adding a device is both problematic
>since it could very well be implemented in a real machine, and also
>because if you are to do it properly, it needs to be defined in the
>order of floating CSR space, and adopted properly, or else all kind of
>autodetection of devices will fail in spectacular ways. I'm not sure any
>room is left around in the fixed CSR space...
>And that would mean it needs to move around depending on what other
>hardware you have, which in turn will make it very hard for any software
>to actually use unless they implement the whole autodetection algorithm,
>which in turn also might make it difficult to use under a running OS,
>not to mention the fact that if you configure things wrong, it will not
>work right at all.
It's a jungle out there :-)
Any general purpose PDP-11 system should be able to support custom
devices, and what we are adding is "custom" functionality. In the real
world we'd use a device (mainly because, with a couple of exceptions,
we can't alter the architecture of a real PDP-11). That doesn't mean
we can't go into the custom CPU business, but the analogy does hold.
I suppose we could use a hidden register, like the TOY clock, but I
guess that would have it's own emulator nasties.
It occurs to me that I don't know if there is a definitive listing of
the fixed addresses... I guess there has to be a list somewhere???
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 3:53 ` Jerome H. Fine
@ 2012-02-01 11:22 ` paramucho
2012-02-01 11:48 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-01 11:22 UTC (permalink / raw)
On Tue, 31 Jan 2012 22:53:32 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
<snip>
>>
>>Selecting the MMU registers was initially process of elimination.
>>Following that, I knew that E11 doesn't actually attempt to fully
>>implement MMU register SR1. I started playing around on a J11 and F11
>>to see what happened when I jammed those registers in an illogical
>>manner. After a little experimentation I found a test which came out
>>differently on the F11 to the J11. Then I played around with E11 and
>>SimH. It's not that hard, and it's not the ideal test either.
>>
>>
>While I agree it is not the ideal test, the
>fact that it works and is actually quite
>simple is what is important.
The reason that it's not ideal is that it doesn't handle CPU
configurations that don't have memory management, e.g. LSI's and early
unmapped PDP-11s. I haven't tested it on all the different MMU
configurations either.
However, these days I could probably use the clock/terminal timing
loop to detect an emulator more generally (it used to fail in the past
because nulls were output as spaces on SimH). Once I knew I was on an
emulator I might be able to come up with some basic difference between
SimH and E11.
I'm not sure what else is available however. Early PDP-11s leave
little which is undefined (mostly because there's very little in the
way of CPU registers). One might look at the handling of double bus
errors, stack underflow, trace traps and the like, but all of these
tests have a higher risk of ending in a pile of goo with a halted CPU.
(Aside: I was checking out some potential tests tonight and noticed
that SimH seems to read Ctrl-H as octal 127. I'm not sure where the
conversion takes place though).
<snip>
>Thank you very much for sharing the code
>for SIMH and E11. While I agree with
>Johnny that using an instruction code which
>is presently unused would be a clean solution,
>the code which you show is certainly a good
>substitute.
The advantage of the register behavior test is that it tests SimH and
E11 out-of-the-box, as delivered. Any test which is based on custom
versions of SimH and E11 has exactly the disadvantage that it won't
test the standard deliverables, which is what most people use. Thus,
it makes sense to use my register test, or something equivalent when
the custom instruction/device is not present.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 11:22 ` paramucho
@ 2012-02-01 11:48 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-01 11:48 UTC (permalink / raw)
On 2012-02-01 12:22, paramucho wrote:
> On Tue, 31 Jan 2012 22:53:32 -0500, "Jerome H. Fine"
> <everyone@nospam.com> wrote:
>
> <snip>
>>>
>>> Selecting the MMU registers was initially process of elimination.
>>> Following that, I knew that E11 doesn't actually attempt to fully
>>> implement MMU register SR1. I started playing around on a J11 and F11
>>> to see what happened when I jammed those registers in an illogical
>>> manner. After a little experimentation I found a test which came out
>>> differently on the F11 to the J11. Then I played around with E11 and
>>> SimH. It's not that hard, and it's not the ideal test either.
>>>
>>>
>> While I agree it is not the ideal test, the
>> fact that it works and is actually quite
>> simple is what is important.
>
> The reason that it's not ideal is that it doesn't handle CPU
> configurations that don't have memory management, e.g. LSI's and early
> unmapped PDP-11s. I haven't tested it on all the different MMU
> configurations either.
I think a bigger reason that it's not ideal is that at least Bob Supnik
have the explicitly stated goal that it should not work. Any current
differences from the real machine are bugs, and are subject to be fixed
at any time, at which point the test wont work anymore.
> However, these days I could probably use the clock/terminal timing
> loop to detect an emulator more generally (it used to fail in the past
> because nulls were output as spaces on SimH). Once I knew I was on an
> emulator I might be able to come up with some basic difference between
> SimH and E11.
Timing might be the only thing that Simh in general will have a hard
time hiding.
> (Aside: I was checking out some potential tests tonight and noticed
> that SimH seems to read Ctrl-H as octal 127. I'm not sure where the
> conversion takes place though).
That could a whole number of different places. Most common is that
terminal emulators actually mess with this. (I hate this, and go to
great lengths to make stuff behave the way I want, which seems to be
very different from what most people nowadays think is right.)
> <snip>
>> Thank you very much for sharing the code
>> for SIMH and E11. While I agree with
>> Johnny that using an instruction code which
>> is presently unused would be a clean solution,
>> the code which you show is certainly a good
>> substitute.
>
> The advantage of the register behavior test is that it tests SimH and
> E11 out-of-the-box, as delivered. Any test which is based on custom
> versions of SimH and E11 has exactly the disadvantage that it won't
> test the standard deliverables, which is what most people use. Thus,
> it makes sense to use my register test, or something equivalent when
> the custom instruction/device is not present.
Right. The only addition being that at least SimH should not be
identifiable this way either. It's a bug that you are using at the
moment. Expect it to go away sooner or later.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 3:56 ` Jerome H. Fine
@ 2012-02-01 11:53 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
2012-02-02 2:22 ` Jerome H. Fine
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-01 11:53 UTC (permalink / raw)
On 2012-02-01 04:56, Jerome H. Fine wrote:
> >Bill Gunshannon wrote:
>>> As an extension to this, you could also add new features, which would be
>>> used when identified as such a machine, but this seems unlikely in general.
>> But I think new features belongs in the fork mentioned above.
> Actually, there is one feature that is in E11 which might
> be interesting enough to use as an additional device, as
> Johnny has mentioned, which is entirely compatible
> with all real and other emulated PDP-11s if anyone
> wants to write the code for SimH or produce the
> actual hardware for a real DEC PDP-11.
>
> I think I have mentioned what E11 uses as EMEM.DLL
> which provides direct access to extremely large numbers
> of bytes of PC memory. The DLL activates 4 IOPAGE
> registers and when the user program references those
> registers (or uses a device driver to reference them), E11
> allows the user program to read and write the words.
>
> Under Windows 98SE, I only have 768 MB of memory
> on the system, but EMEM.DLL (I modified my version
> supplied by John Wilson) allows me to allocate and access
> up to 600 MB of PC memory. When I tested E11 on
> a Windows XP system with 3 GB of physical memory,
> EMEM.DLL allows me to access 1280 MB of PC
> memory.
>
> Since accessing the memory needed assembler subroutines
> when I used FORTRAN 77, I wrote some that changed
> to code the first time each subroutine was used to be inline
> code instead of having the overhead of the CALL.
>
> For those interested in the details, the 4 IOPAGE registers
> are used as follows:
> CSR+0: Read or Write the word - Mov @#CSR,R0 // Mov R0,@#CSR
> CSR+2: Read or Write the word, then auto-increment 32 bit address
> CSR+4: low order 16 bits of byte offset of PC memory - read/write
> CSR+6: high order 16 bits of byte offset of PC memory- read/write
>
> One additional question. E11 has a device called HD: or Hypothetical Disk.
> It is very simple and supports GB of disk files as a device. Would anyone
> be interested in supporting this hardware under SimH? It is just
> as simple as the RK05, probably more so, but I don't use SimH
> enough to want to spend the time. Is anyone interested?
But this is not E11 specific. It's a device. You just need to inform the
system if this device exist or not, no matter what machine you have.
It's not an E11-unique thing.
This is my objection. You are assuming that a device that you
(currently) have on an E11 for some reason must be an E11-specific
thing, and thus you are willing to jump to the conclusion that you can
figure out if this device exist on the basis of if you are running under
E11 or not. I think this is totally wrong.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 5:28 ` Charles Richmond
@ 2012-02-01 11:54 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-01 11:54 UTC (permalink / raw)
On 2012-02-01 06:28, Charles Richmond wrote:
> "Bill Gunshannon" <billg999@cs.uofs.edu> wrote in message
> news:9oqbt8F9ipU1@mid.individual.net...
>>
>> [snip...] [snip...] [snip...]
>>
>> Let me throw a couple comments out in regards this latest discussion.
>> First, on Bob's comment about what will or will not go into SIMH, I
>> totally agree that the base SIMH needs to remain just what it is, an
>> emulator of real hardware. But I would be in favor of a fork of SIMH
>> for experimenters where the internal engine was used to add or change
>> features of the hardware for the pure academic sake of seeing if the
>> architecture was really at a dead end or if one could have done things
>> with the PDP-11 (and the VAX, for that matter) to extend the architecture
>> while remaining compatable with the old architecture, much like what
>> IBM dod with the 360 <-> 390.
>>
>
> Although I have been aware of the existance of SIMH for a long time, I
> plead ignorance about the details.
>
> Isn't SIMH released under the GPL or similar license??? I know that
> anyone has access to the source. So if a (very) interested party wanted
> to start an off-shoot project based on the SIMH code, it seems like
> anyone could legally and morally do that. Perhaps it would be called
> SIM-exp or something... and *not* advertise or pretend to be a
> simulation of the real hardware, but just an experimental platform to
> see what pie-in-the-sky things could be built on top of what *was* the
> original hardware.
>
> Could everyone (even Bob Supnik) be happy with such an off-shoot???
> (*Not* that Bob Supnik would want to contribute to the development of
> the SIM-exp directly.)
Yeah. SimH is available with source, and yes, you could definitely fork
it off and do other stuff in there.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 11:22 ` paramucho
@ 2012-02-01 12:03 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-01 12:03 UTC (permalink / raw)
On 2012-02-01 12:22, paramucho wrote:
> It's a jungle out there :-)
Indeed. :-)
> Any general purpose PDP-11 system should be able to support custom
> devices, and what we are adding is "custom" functionality. In the real
> world we'd use a device (mainly because, with a couple of exceptions,
> we can't alter the architecture of a real PDP-11). That doesn't mean
> we can't go into the custom CPU business, but the analogy does hold.
Right. But if the purpose is just to identify which machine you are
running on, the a device is not a good solution. A device is basically
never specific to one machine.
> I suppose we could use a hidden register, like the TOY clock, but I
> guess that would have it's own emulator nasties.
Apart from still not being a good way to identify a machine.
> It occurs to me that I don't know if there is a definitive listing of
> the fixed addresses... I guess there has to be a list somewhere???
I actually don't know. I know of lots of sources, but I have not seen a
definitive list, as far as I know.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 3:54 ` Jerome H. Fine
@ 2012-02-01 12:09 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-01 12:09 UTC (permalink / raw)
On 2012-02-01 04:54, Jerome H. Fine wrote:
> >Bob Supnik wrote:
>> No. Just no. SimH will never add "features" that didn't exist in the
>> real hardware.
> I understand and I agree that SimH should conform to that
> goal.
>
> However, I do have a question about a real hardware
> CPU from Mentec? The M11 and N11 are capable
> of being detected under RSX-11 and have the code
> to display that CPU type as PDP-11/95 and PDP-11/97,
> respectively - if I understand the code from RSX-11
> correctly which does the identification.
Note that 11/95 and 11/97 are not "official" designations. It's just
that RSX stores the system model number in core, and since it's an
integer, M11 and N11 are not possible to store as such. So developers
chose to call the M11 the 11/95 and N11 the 11/97 pretty arbitrary.
> Does SimH presently emulate these two Mentec boards
> and if not, might that be a future addition to the code?
Without being Bob, I'd say that yes, it might very well be an addition
in the future. SimH aims to emulate existing machines. I don't see a
problem with adding a few more models to the (already) long list of
machines emulated.
Going even further, I'd say that adding another CPU, which does not even
exist as a physical product, would not be against SimH either (even if
it isn't exactly within the goal either). If you decide to emulate a
machine that does not currently exist, there is nothing preventing SimH
from, for this machine, have new features and possibilities.
> If the goal is to emulate only DEC PDP-11 CPUs,
> then it would be reasonable to ignore the Mentec
> CPUs. Otherwise, since Mentec seems to have sold
> many such CPUs, it would seem reasonable to
> include them. However, it might not be possible
> given that it does not seem possible to locate any
> manuals for the Mentec CPUs. bitsavers was negative
> and a Google search was equally unproductive.
SimH does not only emulate DEC machines in general. So I fail to see
that it should restrict itself to only DEC models of the PDP-11 out of
some principle.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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 12:14 ` Johnny Billquist
2012-02-01 16:27 ` glen herrmannsfeldt
2 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-01 12:14 UTC (permalink / raw)
On 2012-01-31 22:39, Bill Gunshannon wrote:
> In article<jg9i9n$n3i$1@iltempo.update.uu.se>,
> Johnny Billquist<bqt@softjar.se> writes:
>> On 2012-01-31 15.24, Bill Gunshannon wrote:
>>> In article<jg8d26$a1d$1@iltempo.update.uu.se>,
>>> Johnny Billquist<bqt@softjar.se> writes:
>>>> But, to reiterate my stand, I don't particularly feel the need for this
>>>> at all. And I am unclear on what Jerome needs, and why.
>>>
>>> Let me throw a couple comments out in regards this latest discussion.
>>> First, on Bob's comment about what will or will not go into SIMH, I
>>> totally agree that the base SIMH needs to remain just what it is, an
>>> emulator of real hardware. But I would be in favor of a fork of SIMH
>>> for experimenters where the internal engine was used to add or change
>>> features of the hardware for the pure academic sake of seeing if the
>>> architecture was really at a dead end or if one could have done things
>>> with the PDP-11 (and the VAX, for that matter) to extend the architecture
>>> while remaining compatable with the old architecture, much like what
>>> IBM dod with the 360<-> 390.
>>
>> Hmm. That is a totally different question. It might be worth playing
>> with in its own right, but I doubt there will much point, unless you
>> also could modify all software to actually use this. That might be hard,
>> so I'm not sure it would lead anywhere.
>> Anyway, for such a thing a proper fork would be right. It's not
>> emulating any existing machine.
>>
>>> On, on this latest piece, I agree with Johnny that creating a bogus
>>> device to identify what the processor is is more work than needed
>>> and because such a device would never exist anyway, kind of meaningless.
>>> Assuming that there is a serious need/desire to be able to identify a
>>> processor using some external means provided by the operator, why
>>> not create a pseudo-dongle that can hang off of an unused (or even a
>>> used one with a little more work) serial port that can be queried to
>>> identify the processor? Advantage is it requires no architectural
>>> change to the underlying hardware, emulated or real. It could also
>>> be created in real hardware with out too much difficulty if one wanted
>>> to move this from the emulated PDP world to real hardware.
>>
>> Oh! Yuck!
>
> Yeah, I know...
>
>> But I guess it depends on what the purpose of that thing
>> should be. Just a way to identify a machine,
>
> Maybe I just came in late, but that's what I thought people wanted.
Not totally clear, and I actually think Jerome was looking for something
else...
>> or a way to identify a
>> machine running under E11/Simh/whatever.
>
> But isn't the inability to tell you are running on an emulator the
> true proof that the emulator works?
Right. But Jerome, for some reason, wants to do just this, if I
understand him correctly.
>> In the latter case, a serial
>> dongle would definitely be wrong. In the former case, what would it be
>> used for at all?
>
> Again, I think I came in late but I thought someone was looking for
> a way to query a machine about what processor it had. Ah for the
> days of having software accesable front panel switches. :-)
Jerome want SimH, setup to emulate an 11/93, to still be identifiable as
a SimH emulated 11/93, as opposed to a real 11/93.
Don't ask me why. I'm trying to figure out what he wants... I have no
idea why.
>> I can, just for curiositys sake, understand that you might want to find
>> out if you are running under Simh or whatever. But then you need to do
>> something in Simh which is not possibly under any existing other machine.
>
> See my comment above!! If there is anythjing in the emulator that is not
> the same as the real thing, then the emulator needs to be fixed.
Right. I agree.
>> As an extension to this, you could also add new features, which would be
>> used when identified as such a machine, but this seems unlikely in general.
>
> But I think new features belongs in the fork mentioned above.
I would agree with that. If we want new features or whatever, we should
really design/designate a new system, and not try to piggyback it on an
existing model.
>> As I said from the start, I'm not sure what the point of all this is. :-)
>>
>
> Me neither. Maybe I should have stayed out of it. :-)
No. It's more fun with you in it. :-)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 11:48 ` Johnny Billquist
@ 2012-02-01 13:48 ` paramucho
2012-02-01 14:43 ` stan
2012-02-02 0:14 ` Johnny Billquist
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-01 13:48 UTC (permalink / raw)
On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-01 12:22, paramucho wrote:
>> On Tue, 31 Jan 2012 22:53:32 -0500, "Jerome H. Fine"
>> <everyone@nospam.com> wrote:
>>
>> <snip>
>>>>
>>>> Selecting the MMU registers was initially process of elimination.
>>>> Following that, I knew that E11 doesn't actually attempt to fully
>>>> implement MMU register SR1. I started playing around on a J11 and F11
>>>> to see what happened when I jammed those registers in an illogical
>>>> manner. After a little experimentation I found a test which came out
>>>> differently on the F11 to the J11. Then I played around with E11 and
>>>> SimH. It's not that hard, and it's not the ideal test either.
>>>>
>>>>
>>> While I agree it is not the ideal test, the
>>> fact that it works and is actually quite
>>> simple is what is important.
>>
>> The reason that it's not ideal is that it doesn't handle CPU
>> configurations that don't have memory management, e.g. LSI's and early
>> unmapped PDP-11s. I haven't tested it on all the different MMU
>> configurations either.
>
>I think a bigger reason that it's not ideal is that at least Bob Supnik
>have the explicitly stated goal that it should not work. Any current
>differences from the real machine are bugs, and are subject to be fixed
>at any time, at which point the test wont work anymore.
That's not exactly what was stated. Without wishing to put words into
anyone's mouth, BobS wrote this:
The model emulation in SimH is not perfect, which is why clever
software can detect it. But the intent is to mimic real systems.
SimH is not a "different" PDP11.
And what I wrote earlier was this:
The trick was to find some "undefined" behavior that didn't need
correction. The code above gets different results from an F11 and a
J11 as well as from SimH and E11. The test is far from ideal, but it
works well enough for my purposes.
My point being, that I'm not sure that the behavior I'm using needs to
be "corrected" in the sense that I'm not sure it's actually "defined".
I'm not even sure that the behavior I'm using can be corrected without
a considerable effort. (One reason I'm not sure is that I wrote the
code years ago and I've forgotten whether the result values could be
computed or would need to be (at least partially) enumerated).
>> However, these days I could probably use the clock/terminal timing
>> loop to detect an emulator more generally (it used to fail in the past
>> because nulls were output as spaces on SimH). Once I knew I was on an
>> emulator I might be able to come up with some basic difference between
>> SimH and E11.
>
>Timing might be the only thing that Simh in general will have a hard
>time hiding.
The problem is that timing is hard to measure in an emulated machine
because one doesn't know how busy the machine is. An emulated machine
might be getting anywhere between 1% and 100% of the hosts actual CPU
time. That variability itself could be measured in some, but not all
circumstances.
Disk I/O provides another opportunity for testing. I guess that SimH
disk I/O is synchronous, i.e. is always actually completed before
control is returned to the emulated CPU after the interrupt servicve
routine delay cycles. But to test that you'd probably need to use
direct access to the device registers and that in turn would require
per-device tests. I'm likewise not sure if E11 is synchronous. V11
certainly is.
<snip>
>> The advantage of the register behavior test is that it tests SimH and
>> E11 out-of-the-box, as delivered. Any test which is based on custom
>> versions of SimH and E11 has exactly the disadvantage that it won't
>> test the standard deliverables, which is what most people use. Thus,
>> it makes sense to use my register test, or something equivalent when
>> the custom instruction/device is not present.
>
>Right. The only addition being that at least SimH should not be
>identifiable this way either. It's a bug that you are using at the
>moment. Expect it to go away sooner or later.
See above. It may go away, but not necessarily. It would be fun if it
did 'cos I'd have to scratch my head and look for something else.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-01 13:48 UTC (permalink / raw)
On Wed, 01 Feb 2012 12:53:17 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>> One additional question. E11 has a device called HD: or Hypothetical Disk.
>> It is very simple and supports GB of disk files as a device. Would anyone
>> be interested in supporting this hardware under SimH? It is just
>> as simple as the RK05, probably more so, but I don't use SimH
>> enough to want to spend the time. Is anyone interested?
>
>But this is not E11 specific. It's a device. You just need to inform the
>system if this device exist or not, no matter what machine you have.
>It's not an E11-unique thing.
If you're talking about HD: then you've lost me. There is no HD:
emulation under SimH.
John Wilson implemented his "hypothetical disk" (aka russian disk) in
the early days of E11 before he'd done his MSCP code IIRC because it
gave him a variable size disk. He also supplied an RT-11 driver for
HD:. I did a compatible implementation of HD: along with a driver for
V11 for exactly the same reason. But there is no HD: emulation for
SimH. That's what Jerome is looking for.
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 13:48 ` paramucho
@ 2012-02-01 14:43 ` stan
2012-02-01 16:37 ` paramucho
2012-02-02 0:14 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: stan @ 2012-02-01 14:43 UTC (permalink / raw)
paramucho wrote:
> On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist <bqt@softjar.se>
> wrote:
>>On 2012-02-01 12:22, paramucho wrote:
>>> On Tue, 31 Jan 2012 22:53:32 -0500, "Jerome H. Fine"
>>> <everyone@nospam.com> wrote:
>>>
>>> <snip>
>>I think a bigger reason that it's not ideal is that at least Bob Supnik
>>have the explicitly stated goal that it should not work. Any current
>>differences from the real machine are bugs, and are subject to be fixed
>>at any time, at which point the test wont work anymore.
>
> That's not exactly what was stated. Without wishing to put words into
> anyone's mouth, BobS wrote this:
>
> The model emulation in SimH is not perfect, which is why clever
> software can detect it. But the intent is to mimic real systems.
> SimH is not a "different" PDP11.
>
> And what I wrote earlier was this:
>
> The trick was to find some "undefined" behavior that didn't need
> correction. The code above gets different results from an F11 and a
> J11 as well as from SimH and E11. The test is far from ideal, but it
> works well enough for my purposes.
>
> My point being, that I'm not sure that the behavior I'm using needs to
> be "corrected" in the sense that I'm not sure it's actually "defined".
> I'm not even sure that the behavior I'm using can be corrected without
> a considerable effort. (One reason I'm not sure is that I wrote the
> code years ago and I've forgotten whether the result values could be
> computed or would need to be (at least partially) enumerated).
Seems like a distinction without a difference. Changing behavior with
a purpose (correcting) and changing undefined behavior with or without
a purpose seems to have the same result. I would agree the risk of a
relatively mature simulator changing significantly seems acceptable,
but relying on undefined behavior is still building your house on
sand.
In the back of my mind I have warning bells going off screaming "how
hard will this be to debug if the undefined behavior changes?"
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 12:14 ` Johnny Billquist
@ 2012-02-01 16:27 ` glen herrmannsfeldt
0 siblings, 0 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-01 16:27 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip, someone wrote)
>> But isn't the inability to tell you are running on an emulator the
>> true proof that the emulator works?
> Right. But Jerome, for some reason, wants to do just this, if I
> understand him correctly.
There is a tradition of emulators (or virtual machines) at least
back to VM/370, of allowing the guest to do things no real machine
allows. That is, talk to the emulator. To do that, there should
be a way to tell if that feature is available.
Now, one can always put it in the configuration file for the guest.
As I previously mentioned, there were DOS device drivers for the
OS/2 emulation of DOS that allowed for this.
There is a feature for OS/VS1 running under VM/370 to avoid
delays due to paging. As both OS/VS1 and VM/370 are virtual
memory system, paging when needed, it is possible for OS/VS1
to be waiting for a page from VM when it has other tasks that
could run. Also, it is most efficient to let VM/370 do all the
paging. Using the special feature, VM/370 can notify OS/VS1 that
it should run another task while VM pages in the first one.
All in all, there are many cases where having the emulator
allow things that real hardware never did can be useful.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-01 16:37 UTC (permalink / raw)
On Wed, 1 Feb 2012 09:43:36 -0500, stan <smoore@exis.net> wrote:
>paramucho wrote:
>> On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist <bqt@softjar.se>
>> wrote:
>>>On 2012-02-01 12:22, paramucho wrote:
>>>> On Tue, 31 Jan 2012 22:53:32 -0500, "Jerome H. Fine"
>>>> <everyone@nospam.com> wrote:
>>>>
>>>> <snip>
>
>>>I think a bigger reason that it's not ideal is that at least Bob Supnik
>>>have the explicitly stated goal that it should not work. Any current
>>>differences from the real machine are bugs, and are subject to be fixed
>>>at any time, at which point the test wont work anymore.
>>
>> That's not exactly what was stated. Without wishing to put words into
>> anyone's mouth, BobS wrote this:
>>
>> The model emulation in SimH is not perfect, which is why clever
>> software can detect it. But the intent is to mimic real systems.
>> SimH is not a "different" PDP11.
>>
>> And what I wrote earlier was this:
>>
>> The trick was to find some "undefined" behavior that didn't need
>> correction. The code above gets different results from an F11 and a
>> J11 as well as from SimH and E11. The test is far from ideal, but it
>> works well enough for my purposes.
>>
>> My point being, that I'm not sure that the behavior I'm using needs to
>> be "corrected" in the sense that I'm not sure it's actually "defined".
>> I'm not even sure that the behavior I'm using can be corrected without
>> a considerable effort. (One reason I'm not sure is that I wrote the
>> code years ago and I've forgotten whether the result values could be
>> computed or would need to be (at least partially) enumerated).
>
>Seems like a distinction without a difference. Changing behavior with
>a purpose (correcting) and changing undefined behavior with or without
>a purpose seems to have the same result. I would agree the risk of a
>relatively mature simulator changing significantly seems acceptable,
>but relying on undefined behavior is still building your house on
>sand.
>
>In the back of my mind I have warning bells going off screaming "how
>hard will this be to debug if the undefined behavior changes?"
You raise an interesting distinction between real PDP-11s and emulated
PDP-11s. The behavior, defined or undefined, of a real PDP-11 does not
change. Thus, one might also claim that a goal of a emulator should be
also be to remain constant.
To follow your point to its logical conclusion would mean that I would
have to simply give up on trying to detect an emulator in its standard
deliverable form. I don't want to do that.
Clearly, building my house on an error in defined behavior would be
utterly ridiculous because, being a good citizen, I would
simultaneously advise the author of an emulator of the error, which
would usually lead to an alteration. Thus "risk" doesn't really apply
here as failure is a near certainty.
In the case of undefined behavior the situation changes: there is no
compelling reason for undefined behavior to be altered unless such a
change leads to a material improvement in the emulation, particularly
when the emulator is mature.
As to your screaming bells: no critical functionality currently relies
on the outcome of the test. The only decision made on the basis of the
test is whether or whether not to proceed with a further timing loop
test, and that test also fails benignly. I would need to add further
detection and sanity tests, or to be satisfied that the emulator would
not change, before I would rely on the functionality significantly.
I am currently considering basing one bit of functionality on the E11
and SimH tests and that's to use a WAIT instruction to reduce CPU
hogging. But I would consider that change to be non-critical (after
the appropriate testing).
By way of comparison, I also do a detection test for the V11 emulator
using the V11 emulator API (based on an instruction, not a device :-).
That test is definitive and does lead to altered behavior of the
system.
Thus, the current E11/SimH detection functionality is largely
exploratory and envisaged as long-term settling-in process. One value
of the tests is to raise the issue that we are discussing in this
thread: should emulators be detectable or not. Clearly, I think that
they should be, but I accept that those who see emulators entirely as
historical vehicles would have another opinion.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 16:37 ` paramucho
@ 2012-02-01 18:05 ` stan
2012-02-02 2:24 ` Jerome H. Fine
1 sibling, 0 replies; 222+ messages in thread
From: stan @ 2012-02-01 18:05 UTC (permalink / raw)
paramucho wrote:
> On Wed, 1 Feb 2012 09:43:36 -0500, stan <smoore@exis.net> wrote:
<snip>
> In the case of undefined behavior the situation changes: there is no
> compelling reason for undefined behavior to be altered unless such a
> change leads to a material improvement in the emulation, particularly
> when the emulator is mature.
Agreed, but on the other side of the coin there's no reason to leave
undefined behavior the same either. Microsoft has a track record for
at least considering backwards compatibility even when it comes to
undefined or undocumented behavior.
>
> As to your screaming bells: no critical functionality currently relies
> on the outcome of the test. The only decision made on the basis of the
> test is whether or whether not to proceed with a further timing loop
> test, and that test also fails benignly. I would need to add further
> detection and sanity tests, or to be satisfied that the emulator would
> not change, before I would rely on the functionality significantly.
I actually figured you had considered the big picture, I was only
pointing out that my internal "Stan, you've done this before" system
was going crazy. There are times when you silence the alarm and move
forward. I tend to leave myself an interesting comment in the code; it
never seems to help matters after I've debugged back to the comment
but it does help remind me that one day I'll choose to make an
original mistake versus repeating things I've been doing for years. I
HOPE!
> Thus, the current E11/SimH detection functionality is largely
> exploratory and envisaged as long-term settling-in process. One value
> of the tests is to raise the issue that we are discussing in this
> thread: should emulators be detectable or not. Clearly, I think that
> they should be, but I accept that those who see emulators entirely as
> historical vehicles would have another opinion.
In general I guess I go with no: emulators should not be generally
identified. I think I would focus on the relevant behavior. If the sim
has a characteristic such as speed that is materially different I
would simply test and work around the speed issue. The identity of the
sim seems to be a symptom rather than a problem for the app.
But I understand the other side of the issue and clearly detecting
hardware and sim has been happening since the first program so it's
certainly not wrong or impossible.
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 13:48 ` paramucho
2012-02-01 14:43 ` stan
@ 2012-02-02 0:14 ` Johnny Billquist
2012-02-02 2:25 ` Jerome H. Fine
2012-02-02 13:31 ` paramucho
1 sibling, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-02 0:14 UTC (permalink / raw)
On 2012-02-01 14:48, paramucho wrote:
> On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-01 12:22, paramucho wrote:
>>> On Tue, 31 Jan 2012 22:53:32 -0500, "Jerome H. Fine"
>>> <everyone@nospam.com> wrote:
>>>
>>> <snip>
>>>>>
>>>>> Selecting the MMU registers was initially process of elimination.
>>>>> Following that, I knew that E11 doesn't actually attempt to fully
>>>>> implement MMU register SR1. I started playing around on a J11 and F11
>>>>> to see what happened when I jammed those registers in an illogical
>>>>> manner. After a little experimentation I found a test which came out
>>>>> differently on the F11 to the J11. Then I played around with E11 and
>>>>> SimH. It's not that hard, and it's not the ideal test either.
>>>>>
>>>>>
>>>> While I agree it is not the ideal test, the
>>>> fact that it works and is actually quite
>>>> simple is what is important.
>>>
>>> The reason that it's not ideal is that it doesn't handle CPU
>>> configurations that don't have memory management, e.g. LSI's and early
>>> unmapped PDP-11s. I haven't tested it on all the different MMU
>>> configurations either.
>>
>> I think a bigger reason that it's not ideal is that at least Bob Supnik
>> have the explicitly stated goal that it should not work. Any current
>> differences from the real machine are bugs, and are subject to be fixed
>> at any time, at which point the test wont work anymore.
>
> That's not exactly what was stated. Without wishing to put words into
> anyone's mouth, BobS wrote this:
>
> The model emulation in SimH is not perfect, which is why clever
> software can detect it. But the intent is to mimic real systems.
> SimH is not a "different" PDP11.
>
> And what I wrote earlier was this:
>
> The trick was to find some "undefined" behavior that didn't need
> correction. The code above gets different results from an F11 and a
> J11 as well as from SimH and E11. The test is far from ideal, but it
> works well enough for my purposes.
>
> My point being, that I'm not sure that the behavior I'm using needs to
> be "corrected" in the sense that I'm not sure it's actually "defined".
> I'm not even sure that the behavior I'm using can be corrected without
> a considerable effort. (One reason I'm not sure is that I wrote the
> code years ago and I've forgotten whether the result values could be
> computed or would need to be (at least partially) enumerated).
We might read things in a different way. "Undefined" is, in this
circumstance, as far as I can tell, only something that is valid as far
as a general view of a PDP-11 is concerned. If you emulate a specific
implementation, the behavior is not undefined. And Simh aims to
implement the same twists as the machine it pretends to emulate. You
have found a case where it does not behave the same way as the machine
it claims to emulate. I'd say that this means Simh have a bug.
Undefined generally only means that different implementations of a
PDP-11 are free to do this as they see fit, and no program should depend
on a specific behavior.
However, a specific implementation will only do it one way or another.
A lot of the "undefined" behavior is in fact things that are used to
identify one CPU from another.
>>> However, these days I could probably use the clock/terminal timing
>>> loop to detect an emulator more generally (it used to fail in the past
>>> because nulls were output as spaces on SimH). Once I knew I was on an
>>> emulator I might be able to come up with some basic difference between
>>> SimH and E11.
>>
>> Timing might be the only thing that Simh in general will have a hard
>> time hiding.
>
> The problem is that timing is hard to measure in an emulated machine
> because one doesn't know how busy the machine is. An emulated machine
> might be getting anywhere between 1% and 100% of the hosts actual CPU
> time. That variability itself could be measured in some, but not all
> circumstances.
Right.
> Disk I/O provides another opportunity for testing. I guess that SimH
> disk I/O is synchronous, i.e. is always actually completed before
> control is returned to the emulated CPU after the interrupt servicve
> routine delay cycles. But to test that you'd probably need to use
> direct access to the device registers and that in turn would require
> per-device tests. I'm likewise not sure if E11 is synchronous. V11
> certainly is.
E11 does not do it synchronously. It's done in different threads, that
can complete asynchronously to each other. Which is nice. It means that
your CPU does not stand still just because you issued an operation to a
device. Especially if you have a multi-cpu host machine.
>>> The advantage of the register behavior test is that it tests SimH and
>>> E11 out-of-the-box, as delivered. Any test which is based on custom
>>> versions of SimH and E11 has exactly the disadvantage that it won't
>>> test the standard deliverables, which is what most people use. Thus,
>>> it makes sense to use my register test, or something equivalent when
>>> the custom instruction/device is not present.
>>
>> Right. The only addition being that at least SimH should not be
>> identifiable this way either. It's a bug that you are using at the
>> moment. Expect it to go away sooner or later.
>
> See above. It may go away, but not necessarily. It would be fun if it
> did 'cos I'd have to scratch my head and look for something else.
I think the aim of Simh is that there shouldn't be a way. When there is
a way, the emulation have failed.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 13:48 ` paramucho
@ 2012-02-02 0:20 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-02 0:20 UTC (permalink / raw)
On 2012-02-01 14:48, paramucho wrote:
> On Wed, 01 Feb 2012 12:53:17 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>
>>> One additional question. E11 has a device called HD: or Hypothetical Disk.
>>> It is very simple and supports GB of disk files as a device. Would anyone
>>> be interested in supporting this hardware under SimH? It is just
>>> as simple as the RK05, probably more so, but I don't use SimH
>>> enough to want to spend the time. Is anyone interested?
>>
>> But this is not E11 specific. It's a device. You just need to inform the
>> system if this device exist or not, no matter what machine you have.
>> It's not an E11-unique thing.
>
> If you're talking about HD: then you've lost me. There is no HD:
> emulation under SimH.
Maybe not now, but I bet I could whip it up in a couple of hours. And
correct me if I'm wrong, but wasn't this based on an actual hardware
implementation done by some russian? Thus, it already exists for other
machines than E11.
> John Wilson implemented his "hypothetical disk" (aka russian disk) in
> the early days of E11 before he'd done his MSCP code IIRC because it
> gave him a variable size disk. He also supplied an RT-11 driver for
> HD:. I did a compatible implementation of HD: along with a driver for
> V11 for exactly the same reason. But there is no HD: emulation for
> SimH. That's what Jerome is looking for.
I'm still not totally clear what Jerome is looking for. But making
assumptions about what devices that might exist, based on a machine type
is wrong. There is never anything preventing someone from implementing
that same device for another machine, including real, physical machines.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 11:53 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
@ 2012-02-02 2:22 ` Jerome H. Fine
1 sibling, 0 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-02 2:22 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 4136 bytes --]
>Johnny Billquist wrote:
> On 2012-02-01 04:56, Jerome H. Fine wrote:
>
>> >Bill Gunshannon wrote:
>>
>>>> As an extension to this, you could also add new features, which
>>>> would be
>>>> used when identified as such a machine, but this seems unlikely in
>>>> general.
>>>
>>> But I think new features belongs in the fork mentioned above.
>>
>> Actually, there is one feature that is in E11 which might
>> be interesting enough to use as an additional device, as
>> Johnny has mentioned, which is entirely compatible
>> with all real and other emulated PDP-11s if anyone
>> wants to write the code for SimH or produce the
>> actual hardware for a real DEC PDP-11.
>>
>> I think I have mentioned what E11 uses as EMEM.DLL
>> which provides direct access to extremely large numbers
>> of bytes of PC memory. The DLL activates 4 IOPAGE
>> registers and when the user program references those
>> registers (or uses a device driver to reference them), E11
>> allows the user program to read and write the words.
>>
>> Under Windows 98SE, I only have 768 MB of memory
>> on the system, but EMEM.DLL (I modified my version
>> supplied by John Wilson) allows me to allocate and access
>> up to 600 MB of PC memory. When I tested E11 on
>> a Windows XP system with 3 GB of physical memory,
>> EMEM.DLL allows me to access 1280 MB of PC
>> memory.
>>
>> Since accessing the memory needed assembler subroutines
>> when I used FORTRAN 77, I wrote some that changed
>> to code the first time each subroutine was used to be inline
>> code instead of having the overhead of the CALL.
>>
>> For those interested in the details, the 4 IOPAGE registers
>> are used as follows:
>> CSR+0: Read or Write the word - Mov @#CSR,R0 // Mov R0,@#CSR
>> CSR+2: Read or Write the word, then auto-increment 32 bit address
>> CSR+4: low order 16 bits of byte offset of PC memory - read/write
>> CSR+6: high order 16 bits of byte offset of PC memory- read/write
>>
>> One additional question. E11 has a device called HD: or Hypothetical
>> Disk.
>> It is very simple and supports GB of disk files as a device. Would
>> anyone
>> be interested in supporting this hardware under SimH? It is just
>> as simple as the RK05, probably more so, but I don't use SimH
>> enough to want to spend the time. Is anyone interested?
>
>
> But this is not E11 specific. It's a device. You just need to inform
> the system if this device exist or not, no matter what machine you
> have. It's not an E11-unique thing.
>
> This is my objection. You are assuming that a device that you
> (currently) have on an E11 for some reason must be an E11-specific
> thing, and thus you are willing to jump to the conclusion that you can
> figure out if this device exist on the basis of if you are running
> under E11 or not. I think this is totally wrong.
I did not make my interest in HD: clear enough.
The ONLY reason I am suggesting it is because
under E11, when only disk I/O is taking place in
RT-11, the transfer rate is about twice the speed
of the MSCP device. I can only assume that the
slower transfer rate is because the overhead of the
code to perform MSCP emulation is so much
higher than the HD: interface emulation.
Plus, the HD: device driver requires much less
code than the DU: device driver.
I have partially finished two additional versions
to use under E11:
(a) One which substitute for the VM: device so
that emulated memory is not used up - plus this
VM: device driver can have as large a "disk
drive" as the user wants since it is not limited
to a maximum of the 4 MB of the emulated
PDP-11 memory.
(b) Another which supports extended device
drivers or up to 64 RT-11 partitions.
Both have code to support a software READ
ONLY setting of the whole device - something
which I seem to remember that DEC used to
have, perhaps with the RX02 floppy..
So being able to have an HD: under SIMH would
NOT in any way be used to test if E11 or SimH
was running.
However, as I said, I don't use SimH enough to
justify having HD: code for SimH.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 5016 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-01 16:37 ` paramucho
2012-02-01 18:05 ` stan
@ 2012-02-02 2:24 ` Jerome H. Fine
1 sibling, 0 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-02 2:24 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1260 bytes --]
>paramucho wrote:
>[Snip]
>
>Thus, the current E11/SimH detection functionality is largely
>exploratory and envisaged as long-term settling-in process. One value
>of the tests is to raise the issue that we are discussing in this
>thread: should emulators be detectable or not. Clearly, I think that
>they should be, but I accept that those who see emulators entirely as
>historical vehicles would have another opinion.
>
>Ian
>
While I am also obviously on the side of making the emulator
detectable, I also do accept that other users will disagree.
That is why finding a solution with does not impact normal
functions is essential. Note that at the moment, it was only
curiosity which led me to be interested in being able to
distinguish which emulator is being used as opposed to a
real PDP-11 of some kind. This was when I was adding
code to RESORC.SAV so that it could run as a virtual
system job - which the DEC distributed version can't do.
Then Johnny pointed out that there are PDP-11/95 and
PDP-11/97 CPUs from Mentec which RSX-11 can detect,
but for which RT-11 does not have the extra code.
So in short the ONLY reason (Johnny does this answer
your question) is curiosity and letting the user know.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 1946 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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 13:31 ` paramucho
1 sibling, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-02 2:25 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]
>Johnny Billquist wrote:
> [Snip]
> E11 does not do it synchronously. It's done in different threads, that
> can complete asynchronously to each other. Which is nice. It means
> that your CPU does not stand still just because you issued an
> operation to a device. Especially if you have a multi-cpu host machine.
My discussions with John Wilson suggest that the different
versions of E11 are different for I/O.
At the moment, the DOS version is still synchronous (as
far as I remember).
The Win32 version may still be synchronous, but there
is definitely the intention to all for non-synchronous
disk I/O since there is more than one thread and the
disk I/O can be done in one thread while the CPU is
able to proceed (being executed) in the other thread.
Please do NOT rely on this information!! It is meant
FYI (for your information) and may be incorrect.
I just wanted to correct the suggestion by Johnny that
E11 definitely supports non-sychronous disk I/O
like both RT-11 and RSX-11 does on native DEC
CPUs.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 1745 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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 15:00 ` paramucho
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-02 9:29 UTC (permalink / raw)
On 2012-02-02 03:25, Jerome H. Fine wrote:
> >Johnny Billquist wrote:
>> [Snip]
>> E11 does not do it synchronously. It's done in different threads, that
>> can complete asynchronously to each other. Which is nice. It means
>> that your CPU does not stand still just because you issued an
>> operation to a device. Especially if you have a multi-cpu host machine.
> My discussions with John Wilson suggest that the different
> versions of E11 are different for I/O.
Ah, sorry. Yes, I should probably point out that all my experience is
with E11 under Linux...
Other versions of E11 might be synchronous. However, for the topic, that
is not really relevant. The important thing is/was that there are
emulators that will not do I/O operation synchronously, so that can not
be used as a criteria to detect them in general.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 0:14 ` Johnny Billquist
2012-02-02 2:25 ` Jerome H. Fine
@ 2012-02-02 13:31 ` paramucho
2012-02-02 19:07 ` glen herrmannsfeldt
2012-02-03 11:24 ` Johnny Billquist
1 sibling, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-02 13:31 UTC (permalink / raw)
On Thu, 02 Feb 2012 01:14:39 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-01 14:48, paramucho wrote:
>> On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
<snip>
>>>> The reason that it's not ideal is that it doesn't handle CPU
>>>> configurations that don't have memory management, e.g. LSI's and early
>>>> unmapped PDP-11s. I haven't tested it on all the different MMU
>>>> configurations either.
>>>
>>> I think a bigger reason that it's not ideal is that at least Bob Supnik
>>> have the explicitly stated goal that it should not work. Any current
>>> differences from the real machine are bugs, and are subject to be fixed
>>> at any time, at which point the test wont work anymore.
>>
>> That's not exactly what was stated. Without wishing to put words into
>> anyone's mouth, BobS wrote this:
>>
>> The model emulation in SimH is not perfect, which is why clever
>> software can detect it. But the intent is to mimic real systems.
>> SimH is not a "different" PDP11.
>>
>> And what I wrote earlier was this:
>>
>> The trick was to find some "undefined" behavior that didn't need
>> correction. The code above gets different results from an F11 and a
>> J11 as well as from SimH and E11. The test is far from ideal, but it
>> works well enough for my purposes.
>>
>> My point being, that I'm not sure that the behavior I'm using needs to
>> be "corrected" in the sense that I'm not sure it's actually "defined".
>> I'm not even sure that the behavior I'm using can be corrected without
>> a considerable effort. (One reason I'm not sure is that I wrote the
>> code years ago and I've forgotten whether the result values could be
>> computed or would need to be (at least partially) enumerated).
>
>We might read things in a different way. "Undefined" is, in this
>circumstance, as far as I can tell, only something that is valid as far
>as a general view of a PDP-11 is concerned. If you emulate a specific
>implementation, the behavior is not undefined. And Simh aims to
>implement the same twists as the machine it pretends to emulate. You
>have found a case where it does not behave the same way as the machine
>it claims to emulate. I'd say that this means Simh have a bug.
>
>Undefined generally only means that different implementations of a
>PDP-11 are free to do this as they see fit, and no program should depend
>on a specific behavior.
>However, a specific implementation will only do it one way or another.
I have been using "undefined" in the architectural sense, that is,
behavior which is not specified by the *architecture* or explicitly
specified as "undefined". That's fairly well-known terminology.
Clearly, there can be *no* undefined *implementation* behavior and
thus the distinction between "defined" and "undefined" is meaningless
if applied to the implementation.
But to take your point that an emulation could avoid "undefined"
architecture states by referring to "unspecified implementation
behavior" I'd make two arguments.
First, "unspecified implementation behavior" can be significantly more
difficult to emulate. An *architectural definition* will usually
propose relatively simple deterministic algorithms, explicitly or
implicitly, but unspecified implementation behavior can potentially be
tied to any machine state. It might be necessary to run extensive
tests on many different CPU types just to work out what the behavior
is. In some cases it simply won't be worth the effort.
Second, I don't think that emulator authors are as strict as you
imply. For example, consider the following "programming difference"
from one of the J11 architecture documents:
30. If a register contains an odd value in mode 2 and a [11/73]
bus error occurs, the register will be incremented
If a register contains an odd value in mode 2 and a [11/34]
bus error occurs, the register will be unchanged.
SimH gets it right for its default J11 CPU, where it increments
and wrong for an 11/34, where it should be unchanged. E11 is the other
way around: right for its default 11/34 CPU, where it's unchanged and
wrong for the J11 where it should increment. Now these are examples of
incorrect implementation differences (that I would never rely on for a
detection test), however, there's no screaming need for SimH or E11 to
fix them.
Whenever I write a new RUST driver I first get it up and running under
V11, and then on couple of different real PDP-11s. Then I test E11 and
SimH, where I often have to make changes to the driver to get it work.
Likewise, I have a debugger which uses the trace trap to store an
execution history. It works well under E11 but is a bit wierd under
SimH.
Neither SimH or E11 attempt to mimic the instruction times of the
original computers. Does this represent a failure? There is at least
one gaming PDP-11 emulation which does mimic the instruction times.
As noted, the emulators don't mimic the typical speeds of PDP-11
terminals either. That was fixed behavior I could rely on a real
PDP-11.
One of the key strengths of SimH is its portability across different
systems, and in to the future since it sticks pretty much to
straightforward C code. This portability may well be one reason that
SimH doesn't mimic asynchronous I/O. There are always trade-offs.
The emulations are not exact or complete and it would be unrealistic
to expect them to be and they're only as good as the testing they've
had. There is always going to be a gap between the emulation and the
original. Some of the behavior that lies in the gap is worth fixing,
some behavior isn't. That's true of most software. Emulators are no
different.
>A lot of the "undefined" behavior is in fact things that are used to
>identify one CPU from another.
Which is exactly what I've used in the past and that's what I'm using
with the emulators. I made the point elsewhere: that software often
relies on the unchanging behavior of an implementation. One could make
the case that an emulation should likewise strive to be unchanging
whenever possible if it wants to emulate real machines.
<snip>
>> Disk I/O provides another opportunity for testing. I guess that SimH
>> disk I/O is synchronous, i.e. is always actually completed before
>> control is returned to the emulated CPU after the interrupt servicve
>> routine delay cycles. But to test that you'd probably need to use
>> direct access to the device registers and that in turn would require
>> per-device tests. I'm likewise not sure if E11 is synchronous. V11
>> certainly is.
>
>E11 does not do it synchronously. It's done in different threads, that
>can complete asynchronously to each other. Which is nice. It means that
>your CPU does not stand still just because you issued an operation to a
>device. Especially if you have a multi-cpu host machine.
That's cool (the only thing I thread in V11 is the terminal). E11 aims
at high performance and I guess that's *one* reason that John Wilson
didn't bother to implement MMU register SR1--it would have adversely
affected performance (since it requires a 2-part calculation and store
for every register/mode access).
My detection tests involve SR1. The shakiest part of my approach is
that it would be quite reasonable for E11 to improve SR1 emulation at
some point (regardless of my tests), although since no system actually
uses the functionality there's no real incentive to do so.
>>>> The advantage of the register behavior test is that it tests SimH and
>>>> E11 out-of-the-box, as delivered. Any test which is based on custom
>>>> versions of SimH and E11 has exactly the disadvantage that it won't
>>>> test the standard deliverables, which is what most people use. Thus,
>>>> it makes sense to use my register test, or something equivalent when
>>>> the custom instruction/device is not present.
>>>
>>> Right. The only addition being that at least SimH should not be
>>> identifiable this way either. It's a bug that you are using at the
>>> moment. Expect it to go away sooner or later.
>>
>> See above. It may go away, but not necessarily. It would be fun if it
>> did 'cos I'd have to scratch my head and look for something else.
>
>I think the aim of Simh is that there shouldn't be a way. When there is
>a way, the emulation have failed.
I think it is accepted that there will always be a gap between the
emulation and the original. I don't think the emulations aim at being
utterly exact. Life is too short. To quote BobS again:
The model emulation in SimH is not perfect, which is why clever
software can detect it. <snip>
The presence of a gap doesn't mean that an emulation has failed. In
any case SimH and E11 are quite amazing, with or without gaps.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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 15:00 ` paramucho
1 sibling, 2 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-02 18:52 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip)
> Ah, sorry. Yes, I should probably point out that all my experience is
> with E11 under Linux...
> Other versions of E11 might be synchronous. However, for the topic, that
> is not really relevant. The important thing is/was that there are
> emulators that will not do I/O operation synchronously, so that can not
> be used as a criteria to detect them in general.
Well, even if not synchronous, an I/O operations might still
complete faster than on a real processor with an appropriate I/O
device.
It seems, though, that there are multiple uses for the word
synchronous when describing I/O.
In the I/O system used by IBM for S/360, S/370, and even later,
there was pretty much no buffering between the I/O device and
storage. As with floppy disk controllers now, one byte would be
assembled from the serial bit stream and written to memory.
Later, that might have increased to 16 bits or 32 bits,
but not much more. That is what IBM calls synchronous I/O.
Among others, this allowed for self-modifying channel programs
where recently read I/O commands were then executed.
Later on, control units with block or track sized buffers allowed
for 'asynchronous I/O', such that the contents of memory did
not change while bits were coming off disk.
For SCSI, it is related to the timing on the SCSI bus,
with synchronous timing allowing for faster transfers.
(Asynchronous SCSI requries a two-way handshake for each byte.)
The low-end S/360 and S/370 models used the same logic,
through microprogramming, for both CPU and I/O operations,
such that I/O was pretty much, in the sense here, synchronous.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 13:31 ` paramucho
@ 2012-02-02 19:07 ` glen herrmannsfeldt
2012-02-03 0:16 ` Johnny Billquist
` (2 more replies)
2012-02-03 11:24 ` Johnny Billquist
1 sibling, 3 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-02 19:07 UTC (permalink / raw)
In vmsnet.pdp-11 paramucho <paramucho@hotmail.com> wrote:
(snip)
> I have been using "undefined" in the architectural sense, that is,
> behavior which is not specified by the *architecture* or explicitly
> specified as "undefined". That's fairly well-known terminology.
> Clearly, there can be *no* undefined *implementation* behavior and
> thus the distinction between "defined" and "undefined" is meaningless
> if applied to the implementation.
I am not convinced. It might be, for example, that conditions
not specified could expose logic race conditions that would not
be seen using only the specified operations.
Many smaller processors weren't so good at testing for
illegal opcodes, or other bit combinations not specified
to work.
I believe many of the auto-increment and autodecrement
operations on PC were defined for the PDP-11, but maybe
not all of them. Many are illegal on VAX, and I believe
tested for.
I would not be surprised to see some of the undefined ones
for the PDP-11 turn out not to be deterministic.
> But to take your point that an emulation could avoid "undefined"
> architecture states by referring to "unspecified implementation
> behavior" I'd make two arguments.
> First, "unspecified implementation behavior" can be significantly more
> difficult to emulate. An *architectural definition* will usually
> propose relatively simple deterministic algorithms, explicitly or
> implicitly, but unspecified implementation behavior can potentially be
> tied to any machine state. It might be necessary to run extensive
> tests on many different CPU types just to work out what the behavior
> is. In some cases it simply won't be worth the effort.
I believe that throughout history there have been a number
of cases where emulators had to emulate bugs in the original
machine. In some, the documentation was wrong and users
expected software that depended on those bugs to work.
> Second, I don't think that emulator authors are as strict as you
> imply. For example, consider the following "programming difference"
> from one of the J11 architecture documents:
> 30. If a register contains an odd value in mode 2 and a [11/73]
> bus error occurs, the register will be incremented
> If a register contains an odd value in mode 2 and a [11/34]
> bus error occurs, the register will be unchanged.
> SimH gets it right for its default J11 CPU, where it increments
> and wrong for an 11/34, where it should be unchanged. E11 is the other
> way around: right for its default 11/34 CPU, where it's unchanged and
> wrong for the J11 where it should increment. Now these are examples of
> incorrect implementation differences (that I would never rely on for a
> detection test), however, there's no screaming need for SimH or E11 to
> fix them.
There might be if there were system test programs that tested
for those cases. When processors were less reliable, the need
to test that one performed to specifications was important.
(snip)
> Neither SimH or E11 attempt to mimic the instruction times of the
> original computers. Does this represent a failure? There is at least
> one gaming PDP-11 emulation which does mimic the instruction times.
> As noted, the emulators don't mimic the typical speeds of PDP-11
> terminals either. That was fixed behavior I could rely on a real
> PDP-11.
Certainly that has been a problem for games on emulated
systems, or even real systems, for many years.
> One of the key strengths of SimH is its portability across different
> systems, and in to the future since it sticks pretty much to
> straightforward C code. This portability may well be one reason that
> SimH doesn't mimic asynchronous I/O. There are always trade-offs.
> The emulations are not exact or complete and it would be unrealistic
> to expect them to be and they're only as good as the testing they've
> had. There is always going to be a gap between the emulation and the
> original. Some of the behavior that lies in the gap is worth fixing,
> some behavior isn't. That's true of most software. Emulators are no
> different.
(snip)
>>I think the aim of Simh is that there shouldn't be a way. When there is
>>a way, the emulation have failed.
> I think it is accepted that there will always be a gap between the
> emulation and the original. I don't think the emulations aim at being
> utterly exact. Life is too short. To quote BobS again:
> The model emulation in SimH is not perfect, which is why clever
> software can detect it. <snip>
> The presence of a gap doesn't mean that an emulation has failed. In
> any case SimH and E11 are quite amazing, with or without gaps.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 18:52 ` glen herrmannsfeldt
@ 2012-02-03 0:12 ` Johnny Billquist
2012-02-03 4:07 ` Jerome H. Fine
1 sibling, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-03 0:12 UTC (permalink / raw)
On 2012-02-02 19:52, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 Johnny Billquist<bqt@softjar.se> wrote:
>
> (snip)
>> Ah, sorry. Yes, I should probably point out that all my experience is
>> with E11 under Linux...
>> Other versions of E11 might be synchronous. However, for the topic, that
>> is not really relevant. The important thing is/was that there are
>> emulators that will not do I/O operation synchronously, so that can not
>> be used as a criteria to detect them in general.
>
> Well, even if not synchronous, an I/O operations might still
> complete faster than on a real processor with an appropriate I/O
> device.
Certainly. And the emulator might manage to do way more instructions in
that shorter time than a real machine with a slower device.
Not only I/O have gotten faster. CPUs have too...
> It seems, though, that there are multiple uses for the word
> synchronous when describing I/O.
Maybe. I'm using it in the meaning that from the PDP-11 point of view,
the completion of an I/O request does not happen in a predetermined
(often instant) amount of time. It is asynchronous to the execution of
instructions in the emulator. I/O completes at a later, undefined time.
Did that specify it enough, or did I manage to fuddle it up?
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 19:07 ` glen herrmannsfeldt
@ 2012-02-03 0:16 ` Johnny Billquist
2012-02-03 4:23 ` glen herrmannsfeldt
2012-02-03 15:36 ` Joe Oswald
2012-02-03 4:29 ` Jerome H. Fine
2012-02-03 10:48 ` paramucho
2 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-03 0:16 UTC (permalink / raw)
On 2012-02-02 20:07, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 paramucho<paramucho@hotmail.com> wrote:
>
> (snip)
>
>> I have been using "undefined" in the architectural sense, that is,
>> behavior which is not specified by the *architecture* or explicitly
>> specified as "undefined". That's fairly well-known terminology.
>
>> Clearly, there can be *no* undefined *implementation* behavior and
>> thus the distinction between "defined" and "undefined" is meaningless
>> if applied to the implementation.
>
> I am not convinced. It might be, for example, that conditions
> not specified could expose logic race conditions that would not
> be seen using only the specified operations.
>
> Many smaller processors weren't so good at testing for
> illegal opcodes, or other bit combinations not specified
> to work.
>
> I believe many of the auto-increment and autodecrement
> operations on PC were defined for the PDP-11, but maybe
> not all of them. Many are illegal on VAX, and I believe
> tested for.
>
> I would not be surprised to see some of the undefined ones
> for the PDP-11 turn out not to be deterministic.
I would be extremely surprised. That would essentially mean that you'd
actually have a perfect random number generator. Something noone have
managed to invent in a computer yet.
It might be that the determinism of the whole things is rather complex,
but it is deterministic. A CPU is, after all, just a finite state
machine. There is nothing undeterministic when you go down to the bottom
of it all. There are ones and zeroes. There are gates, with functions
like "AND", "OR", "NOT" and so on. And they are all behaving in a very
deterministic way.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-03 4:07 UTC (permalink / raw)
>glen herrmannsfeldt wrote:
>>Ah, sorry. Yes, I should probably point out that all my experience is
>>with E11 under Linux...
>>Other versions of E11 might be synchronous. However, for the topic, that
>>is not really relevant. The important thing is/was that there are
>>emulators that will not do I/O operation synchronously, so that can not
>>be used as a criteria to detect them in general.
>>
>Well, even if not synchronous, an I/O operations might still
>complete faster than on a real processor with an appropriate I/O
>device.
>
>
Just in case you are interested, on a real DEC PDP-11/83, I generally find
that it takes about 240 seconds (4 minutes) to copy an RT-11 partition of
32 MB from one SCSI hard drive to another. ESDI drives are about the
same and RD53 drives take over 300 seconds (5 minutes).
Under Ersatz-11 with synchronous I/O, it takes about 2 seconds on my
Pentium III running Windows 98SE and less than 1 second on a core 2 quad
at 2.8 GH running Windows XP.
I have probably mentioned these numbers before, but a 200 to 1 ratio is
quite impressive. I imagine that with SATA III drives on even faster
systems, the ratio is even larger.
Jerome Fine
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 1 reply; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-03 4:23 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip)
> I would be extremely surprised. That would essentially mean that you'd
> actually have a perfect random number generator. Something noone have
> managed to invent in a computer yet.
Intel was making one for a while, though maybe not anymore.
It isn't all that hard to do.
> It might be that the determinism of the whole things is rather complex,
> but it is deterministic. A CPU is, after all, just a finite state
> machine. There is nothing undeterministic when you go down to the bottom
> of it all. There are ones and zeroes. There are gates, with functions
> like "AND", "OR", "NOT" and so on. And they are all behaving in a very
> deterministic way.
They behave deterministicaly if you follow the rules.
If not, you might be surprised. Among others, you have to follow
the setup and hold time on flip-flops. If not, non-deterministic
results come out easily.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 19:07 ` glen herrmannsfeldt
2012-02-03 0:16 ` Johnny Billquist
@ 2012-02-03 4:29 ` Jerome H. Fine
2012-02-03 12:50 ` Bill Gunshannon
2012-02-03 10:48 ` paramucho
2 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-03 4:29 UTC (permalink / raw)
>glen herrmannsfeldt wrote:
>I believe that throughout history there have been a number
>of cases where emulators had to emulate bugs in the original
>machine. In some, the documentation was wrong and users
>expected software that depended on those bugs to work.
>
>
Not just emulators!! I seem to remember that FORTRAN IV had
some bugs which were retained in later versions because many smart
users figured out ways to code around them. Whatever the software,
the bugs were retained so the later versions would not be incompatible.
>>Second, I don't think that emulator authors are as strict as you
>>imply. For example, consider the following "programming difference"
>>from one of the J11 architecture documents:
>>
>> 30. If a register contains an odd value in mode 2 and a [11/73]
>> bus error occurs, the register will be incremented
>>
>> If a register contains an odd value in mode 2 and a [11/34]
>> bus error occurs, the register will be unchanged.
>>
>>SimH gets it right for its default J11 CPU, where it increments
>>and wrong for an 11/34, where it should be unchanged. E11 is the other
>>way around: right for its default 11/34 CPU, where it's unchanged and
>>wrong for the J11 where it should increment. Now these are examples of
>>incorrect implementation differences (that I would never rely on for a
>>detection test), however, there's no screaming need for SimH or E11 to
>>fix them.
>>
>There might be if there were system test programs that tested
>for those cases. When processors were less reliable, the need
>to test that one performed to specifications was important.
>
>
I think that what Ian is saying is that when the results of the emulator
(both SimH and
E11) differ from the actual hardware under circumstances when an error
condition
occurs (bus error in this case) and all normal programs just quit since
they do not
care if the register is correct or not, it is likely that both SimH and
E11 will focus
on things that really matter. So it is both unnecessary and unlikely
they will be changed
to conform with the real hardware since it will never make a difference
in any case.
That seems to me to be an excellent approach - fix the bugs that matter
and make
enhancements that are useful.
>>The presence of a gap doesn't mean that an emulation has failed. In
>>any case SimH and E11 are quite amazing, with or without gaps.
>>
I second the motion. I find that E11 in particular handles some situations
so well that I can't quite believe how amazing it is. It is possible to
move
a SCSI hard drive from a SCSI cable in a CQD 220/TM on a real DEC
system (I use a PDP-11/83) to my Pentium III running Windows 98SE
with an Adaptac 2940AU host adapter and attach the hard drive to the
50 pin SCSI cable and run the PDP-11 software directly from the SCSI
hard drive, under E11 of course, including booting the hard drive.
I understand that it is also possible with Windows XP as well, but I can't
confirm that as yet.
Jerome Fine
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 19:07 ` glen herrmannsfeldt
2012-02-03 0:16 ` Johnny Billquist
2012-02-03 4:29 ` Jerome H. Fine
@ 2012-02-03 10:48 ` paramucho
2 siblings, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-03 10:48 UTC (permalink / raw)
On Thu, 2 Feb 2012 19:07:44 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:
>In vmsnet.pdp-11 paramucho <paramucho@hotmail.com> wrote:
>
>(snip)
>
>> I have been using "undefined" in the architectural sense, that is,
>> behavior which is not specified by the *architecture* or explicitly
>> specified as "undefined". That's fairly well-known terminology.
>
>> Clearly, there can be *no* undefined *implementation* behavior and
>> thus the distinction between "defined" and "undefined" is meaningless
>> if applied to the implementation.
>
>I am not convinced. It might be, for example, that conditions
>not specified could expose logic race conditions that would not
>be seen using only the specified operations.
Yes, and I meant to say something similar below when I wrote:
but unspecified implementation behavior can potentially be
tied to any machine state
<snip>
We had a related case here recently. RSX systems utilize an unused
word in the DOS magtape header for the last three characters of a file
name (in Rad50). XXDP treats the last word as "don't care" uses the
last word of the buffer as an internal counter (which happens to
accumulate the total number of data blocks written). Thus RSX listings
of XXDP-created DOS magtapes have seemingly nonsense endings added to
their filenames.
>> But to take your point that an emulation could avoid "undefined"
>> architectures by referring to "unspecified implementation
>> behavior" I'd make two arguments.
>
>> First, "unspecified implementation behavior" can be significantly more
>> difficult to emulate. An *architectural definition* will usually
>> propose relatively simple deterministic algorithms, explicitly or
>> implicitly, but unspecified implementation behavior can potentially be
>> tied to any machine state. It might be necessary to run extensive
>> tests on many different CPU types just to work out what the behavior
>> is. In some cases it simply won't be worth the effort.
>
>I believe that throughout history there have been a number
>of cases where emulators had to emulate bugs in the original
>machine. In some, the documentation was wrong and users
>expected software that depended on those bugs to work.
We've been working around propagated bugs in our systems for millions
of years...
>> Second, I don't think that emulator authors are as strict as you
>> imply. For example, consider the following "programming difference"
>> from one of the J11 architecture documents:
>
>> 30. If a register contains an odd value in mode 2 and a [11/73]
>> bus error occurs, the register will be incremented
>
>> If a register contains an odd value in mode 2 and a [11/34]
>> bus error occurs, the register will be unchanged.
>
>> SimH gets it right for its default J11 CPU, where it increments
>> and wrong for an 11/34, where it should be unchanged. E11 is the other
>> way around: right for its default 11/34 CPU, where it's unchanged and
>> wrong for the J11 where it should increment. Now these are examples of
>> incorrect implementation differences (that I would never rely on for a
>> detection test), however, there's no screaming need for SimH or E11 to
>> fix them.
>
>There might be if there were system test programs that tested
>for those cases. When processors were less reliable, the need
>to test that one performed to specifications was important.
All software systems are based on the "good enough" principle. You
stop developing when the response is that system is "good enough".
>(snip)
>> Neither SimH or E11 attempt to mimic the instruction times of the
>> original computers. Does this represent a failure? There is at least
>> one gaming PDP-11 emulation which does mimic the instruction times.
>> As noted, the emulators don't mimic the typical speeds of PDP-11
>> terminals either. That was fixed behavior I could rely on a real
>> PDP-11.
>
>Certainly that has been a problem for games on emulated
>systems, or even real systems, for many years.
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 13:31 ` paramucho
2012-02-02 19:07 ` glen herrmannsfeldt
@ 2012-02-03 11:24 ` Johnny Billquist
2012-02-04 17:06 ` paramucho
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-03 11:24 UTC (permalink / raw)
On 2012-02-02 14.31, paramucho wrote:
> On Thu, 02 Feb 2012 01:14:39 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-01 14:48, paramucho wrote:
>>> On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
> <snip>
>>>>> The reason that it's not ideal is that it doesn't handle CPU
>>>>> configurations that don't have memory management, e.g. LSI's and early
>>>>> unmapped PDP-11s. I haven't tested it on all the different MMU
>>>>> configurations either.
>>>>
>>>> I think a bigger reason that it's not ideal is that at least Bob Supnik
>>>> have the explicitly stated goal that it should not work. Any current
>>>> differences from the real machine are bugs, and are subject to be fixed
>>>> at any time, at which point the test wont work anymore.
>>>
>>> That's not exactly what was stated. Without wishing to put words into
>>> anyone's mouth, BobS wrote this:
>>>
>>> The model emulation in SimH is not perfect, which is why clever
>>> software can detect it. But the intent is to mimic real systems.
>>> SimH is not a "different" PDP11.
>>>
>>> And what I wrote earlier was this:
>>>
>>> The trick was to find some "undefined" behavior that didn't need
>>> correction. The code above gets different results from an F11 and a
>>> J11 as well as from SimH and E11. The test is far from ideal, but it
>>> works well enough for my purposes.
>>>
>>> My point being, that I'm not sure that the behavior I'm using needs to
>>> be "corrected" in the sense that I'm not sure it's actually "defined".
>>> I'm not even sure that the behavior I'm using can be corrected without
>>> a considerable effort. (One reason I'm not sure is that I wrote the
>>> code years ago and I've forgotten whether the result values could be
>>> computed or would need to be (at least partially) enumerated).
>>
>> We might read things in a different way. "Undefined" is, in this
>> circumstance, as far as I can tell, only something that is valid as far
>> as a general view of a PDP-11 is concerned. If you emulate a specific
>> implementation, the behavior is not undefined. And Simh aims to
>> implement the same twists as the machine it pretends to emulate. You
>> have found a case where it does not behave the same way as the machine
>> it claims to emulate. I'd say that this means Simh have a bug.
>>
>> Undefined generally only means that different implementations of a
>> PDP-11 are free to do this as they see fit, and no program should depend
>> on a specific behavior.
>> However, a specific implementation will only do it one way or another.
>
> I have been using "undefined" in the architectural sense, that is,
> behavior which is not specified by the *architecture* or explicitly
> specified as "undefined". That's fairly well-known terminology.
Excellent. So we are using it the same way.
So when E11 is configured to simulate a J11, it is expected to do things
the same way as a J11, and if you managed to find corner cases where it
doesn't, then it is a bug in E11, since it is expected to behave the
same as a J11. And the same for Simh. That is why all those options in
the config exist - to make the emulator implement all the odd behavior
of that specific implementation.
E11 (or Simh) is not a generic PDP-11 implementation, but aims to
emulate specific models, with all their quirks.
> Clearly, there can be *no* undefined *implementation* behavior and
> thus the distinction between "defined" and "undefined" is meaningless
> if applied to the implementation.
Right.
> But to take your point that an emulation could avoid "undefined"
> architecture states by referring to "unspecified implementation
> behavior" I'd make two arguments.
I'm not sure I made that point. I think my point was that the emulator
don't have any "undefined" behavior. It claims to emulate a specific
system/model, and thus it should (obviously) have the same quirks as the
system it emulates.
Your response that you are exploiting "undefined" behavior to find out
what system it is, is, in my view, invalid for an emulator that aims to
emulate another system. It should not be possible to tell the emulation
apart from the system it emulates. Otherwise the emulation is buggy. So,
any trick you figured out to detect that you are running under Simh is,
by definition, a bug in Simh.
> Second, I don't think that emulator authors are as strict as you
> imply.
I think that Bob definitely are that strict. And I'm pretty sure that
John in general are too, since he have gone to great lengths to
implement the specific behavior of different implementations of the
PDP-11 for these undefined things.
> For example, consider the following "programming difference"
> from one of the J11 architecture documents:
>
> 30. If a register contains an odd value in mode 2 and a [11/73]
> bus error occurs, the register will be incremented
>
> If a register contains an odd value in mode 2 and a [11/34]
> bus error occurs, the register will be unchanged.
>
> SimH gets it right for its default J11 CPU, where it increments
> and wrong for an 11/34, where it should be unchanged. E11 is the other
> way around: right for its default 11/34 CPU, where it's unchanged and
> wrong for the J11 where it should increment. Now these are examples of
> incorrect implementation differences (that I would never rely on for a
> detection test), however, there's no screaming need for SimH or E11 to
> fix them.
Have you tried, for both, to tell that it should be an 11/34 and an
11/73 respectively, and see what the results becomes for both?
E11 can be told to be a whole bunch of different PDP-11 models.
Just reading through the manual, you can specify it to act as a:
PDP-11/03, PDP-11/04, PDP-11/05, PDP-11/20, PDP-11/23, PDP-11/24,
PDP-11/34a, PDP-11/40, PDP- 11/44, PDP-11/45, PDP-11/53, PDP-11/60,
PDP-11/70, PDP-11/73, PDP-11/74, PDP-11/83, PDP-11/84, PDP-11/93, or
PDP-11/94 CPU with individually selectable features.
Picking the right CPU model is important, and do change the behavior of E11.
And it's similar in Simh, where there is also a long list of different
PDP-11 models you can choose from to set as the CPU Simh should look like.
But there might be bugs. I think they should be reported in that case.
> Whenever I write a new RUST driver I first get it up and running under
> V11, and then on couple of different real PDP-11s. Then I test E11 and
> SimH, where I often have to make changes to the driver to get it work.
> Likewise, I have a debugger which uses the trace trap to store an
> execution history. It works well under E11 but is a bit wierd under
> SimH.
Maybe a bug in Simh that should be reported? I know it took some working
before the trace trap worked ok in E11.
> Neither SimH or E11 attempt to mimic the instruction times of the
> original computers. Does this represent a failure? There is at least
> one gaming PDP-11 emulation which does mimic the instruction times.
Yes, as I pointed out, the speed is probably the one thing where they
will continue to fail. I am sure some would consider that to also be
bad. I think you can atleast tell Simh to actually try and match the
speed of the real machine it emulates... But it is hard to get exact.
> As noted, the emulators don't mimic the typical speeds of PDP-11
> terminals either. That was fixed behavior I could rely on a real
> PDP-11.
Right.
> One of the key strengths of SimH is its portability across different
> systems, and in to the future since it sticks pretty much to
> straightforward C code. This portability may well be one reason that
> SimH doesn't mimic asynchronous I/O. There are always trade-offs.
I noted another thing that had been sitting in the back of my head, and
which John Wilson documents in the manual for E11. Both RSX and RT-11
sometimes actually requires that I/O takes a little while before it
completes, or else the OS malfunctions.
How much you'd want to call that synchronous, I don't know. E11
basically can do a fixed number of instructions delay before reporting
I/O as complete.
> The emulations are not exact or complete and it would be unrealistic
> to expect them to be and they're only as good as the testing they've
> had. There is always going to be a gap between the emulation and the
> original. Some of the behavior that lies in the gap is worth fixing,
> some behavior isn't. That's true of most software. Emulators are no
> different.
Indeed. And I'm not going to try and fix most of these things, since my
personal interest is not 100% perfect emulations.
>> A lot of the "undefined" behavior is in fact things that are used to
>> identify one CPU from another.
>
> Which is exactly what I've used in the past and that's what I'm using
> with the emulators. I made the point elsewhere: that software often
> relies on the unchanging behavior of an implementation. One could make
> the case that an emulation should likewise strive to be unchanging
> whenever possible if it wants to emulate real machines.
My point is that an emulation should not have a different behavior from
the system it tries to emulate. You are depending on exactly this "error".
>>> Disk I/O provides another opportunity for testing. I guess that SimH
>>> disk I/O is synchronous, i.e. is always actually completed before
>>> control is returned to the emulated CPU after the interrupt servicve
>>> routine delay cycles. But to test that you'd probably need to use
>>> direct access to the device registers and that in turn would require
>>> per-device tests. I'm likewise not sure if E11 is synchronous. V11
>>> certainly is.
>>
>> E11 does not do it synchronously. It's done in different threads, that
>> can complete asynchronously to each other. Which is nice. It means that
>> your CPU does not stand still just because you issued an operation to a
>> device. Especially if you have a multi-cpu host machine.
>
> That's cool (the only thing I thread in V11 is the terminal). E11 aims
> at high performance and I guess that's *one* reason that John Wilson
> didn't bother to implement MMU register SR1--it would have adversely
> affected performance (since it requires a 2-part calculation and store
> for every register/mode access).
Um? Are we talking about MMR1 here? The register used to record
autoincrement/autodecrement of general registers during execution of an
instruction in case the instruction aborts?
Or are you talking about some other register?
Looking in RSX, it don't seem like the kernel use that ever, but it does
get propagated to user programs when you get a trap in the user program,
so potentially it could be needed in RSX.
But it would probably only be useful if you wanted to restart
instructions after page faults, and since no OS that I know of do page
faults, I can see how it is not being used anywhere.
> My detection tests involve SR1. The shakiest part of my approach is
> that it would be quite reasonable for E11 to improve SR1 emulation at
> some point (regardless of my tests), although since no system actually
> uses the functionality there's no real incentive to do so.
I can see that it might be costly to maintain it, but on the other hand,
if trappings never will occur with registers updated that needs
rollback, SR1 can be left zero at all times.
So it might actually be that E11 already does it "right".
>>>>> The advantage of the register behavior test is that it tests SimH and
>>>>> E11 out-of-the-box, as delivered. Any test which is based on custom
>>>>> versions of SimH and E11 has exactly the disadvantage that it won't
>>>>> test the standard deliverables, which is what most people use. Thus,
>>>>> it makes sense to use my register test, or something equivalent when
>>>>> the custom instruction/device is not present.
>>>>
>>>> Right. The only addition being that at least SimH should not be
>>>> identifiable this way either. It's a bug that you are using at the
>>>> moment. Expect it to go away sooner or later.
>>>
>>> See above. It may go away, but not necessarily. It would be fun if it
>>> did 'cos I'd have to scratch my head and look for something else.
>>
>> I think the aim of Simh is that there shouldn't be a way. When there is
>> a way, the emulation have failed.
>
> I think it is accepted that there will always be a gap between the
> emulation and the original. I don't think the emulations aim at being
> utterly exact. Life is too short. To quote BobS again:
>
> The model emulation in SimH is not perfect, which is why clever
> software can detect it.<snip>
I think that the aim of Simh is that it should follow as closely as
possible. As such, any discrepancies detected are subject to being
fixed, if realistic to fix. (Speed being one of those things probably
not realistic to fix perfectly.)
> The presence of a gap doesn't mean that an emulation has failed. In
> any case SimH and E11 are quite amazing, with or without gaps.
I guess it depends on what you want. For me, they are perfectly fine as
they are. For some other persons, they might not be.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-03 4:23 ` glen herrmannsfeldt
@ 2012-02-03 12:01 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-03 12:01 UTC (permalink / raw)
On 2012-02-03 05.23, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 Johnny Billquist<bqt@softjar.se> wrote:
>
> (snip)
>> I would be extremely surprised. That would essentially mean that you'd
>> actually have a perfect random number generator. Something noone have
>> managed to invent in a computer yet.
>
> Intel was making one for a while, though maybe not anymore.
> It isn't all that hard to do.
Are we talking about a real product, or just a joke?
>> It might be that the determinism of the whole things is rather complex,
>> but it is deterministic. A CPU is, after all, just a finite state
>> machine. There is nothing undeterministic when you go down to the bottom
>> of it all. There are ones and zeroes. There are gates, with functions
>> like "AND", "OR", "NOT" and so on. And they are all behaving in a very
>> deterministic way.
>
> They behave deterministicaly if you follow the rules.
> If not, you might be surprised. Among others, you have to follow
> the setup and hold time on flip-flops. If not, non-deterministic
> results come out easily.
That would normally also imply a non-working processor. :-)
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-03 4:29 ` Jerome H. Fine
@ 2012-02-03 12:50 ` Bill Gunshannon
2012-02-04 8:42 ` Charles Richmond
0 siblings, 1 reply; 222+ messages in thread
From: Bill Gunshannon @ 2012-02-03 12:50 UTC (permalink / raw)
In article <4f2b62c0$0$287$14726298@news.sunsite.dk>,
"Jerome H. Fine" <everyone@nospam.com> writes:
> >glen herrmannsfeldt wrote:
>
>>I believe that throughout history there have been a number
>>of cases where emulators had to emulate bugs in the original
>>machine. In some, the documentation was wrong and users
>>expected software that depended on those bugs to work.
>>
>>
> Not just emulators!! I seem to remember that FORTRAN IV had
> some bugs which were retained in later versions because many smart
> users figured out ways to code around them. Whatever the software,
> the bugs were retained so the later versions would not be incompatible.
And I remember a Fortran compiler (non-DEC) that had a bug fixed by
inserting a Warning that said "Stop doing this, it is wrong and will
never work as you expect!!" (not in those exact words. :-)
As a customer I would be upset if a bug was found, reported and not
fixed wether there was a work around or not. After all, there is a
work-around for all bugs, use a differnt compiler/language!!
bill
--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
billg999@cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-03 4:07 ` Jerome H. Fine
@ 2012-02-03 14:15 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-03 14:15 UTC (permalink / raw)
On 2012-02-03 05.07, Jerome H. Fine wrote:
> >glen herrmannsfeldt wrote:
>
>>> Ah, sorry. Yes, I should probably point out that all my experience is
>>> with E11 under Linux...
>>> Other versions of E11 might be synchronous. However, for the topic,
>>> that is not really relevant. The important thing is/was that there
>>> are emulators that will not do I/O operation synchronously, so that
>>> can not be used as a criteria to detect them in general.
>>>
>> Well, even if not synchronous, an I/O operations might still
>> complete faster than on a real processor with an appropriate I/O
>> device.
>>
>>
> Just in case you are interested, on a real DEC PDP-11/83, I generally find
> that it takes about 240 seconds (4 minutes) to copy an RT-11 partition of
> 32 MB from one SCSI hard drive to another. ESDI drives are about the
> same and RD53 drives take over 300 seconds (5 minutes).
>
> Under Ersatz-11 with synchronous I/O, it takes about 2 seconds on my
> Pentium III running Windows 98SE and less than 1 second on a core 2 quad
> at 2.8 GH running Windows XP.
>
> I have probably mentioned these numbers before, but a 200 to 1 ratio is
> quite impressive. I imagine that with SATA III drives on even faster
> systems, the ratio is even larger.
This is mostly because of disk caching at several levels. Second reason
being much faster busses and third is faster disks. The actual speed of
the CPU have pretty little to do with this.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-02 9:29 ` Johnny Billquist
2012-02-02 18:52 ` glen herrmannsfeldt
@ 2012-02-03 15:00 ` paramucho
1 sibling, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-03 15:00 UTC (permalink / raw)
On Thu, 02 Feb 2012 10:29:48 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-02 03:25, Jerome H. Fine wrote:
>> >Johnny Billquist wrote:
>>> [Snip]
>>> E11 does not do it synchronously. It's done in different threads, that
>>> can complete asynchronously to each other. Which is nice. It means
>>> that your CPU does not stand still just because you issued an
>>> operation to a device. Especially if you have a multi-cpu host machine.
>> My discussions with John Wilson suggest that the different
>> versions of E11 are different for I/O.
>
>Ah, sorry. Yes, I should probably point out that all my experience is
>with E11 under Linux...
>Other versions of E11 might be synchronous. However, for the topic, that
>is not really relevant. The important thing is/was that there are
>emulators that will not do I/O operation synchronously, so that can not
>be used as a criteria to detect them in general.
Linux and Win32 E11 are asynchronous.
DOS E11 is synchronous because DOS *is* synchronous according to John
Wilson: http://www.dbit.com/win32.html
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-03 0:16 ` Johnny Billquist
2012-02-03 4:23 ` glen herrmannsfeldt
@ 2012-02-03 15:36 ` Joe Oswald
2012-02-07 10:46 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: Joe Oswald @ 2012-02-03 15:36 UTC (permalink / raw)
On Thursday, February 2, 2012 7:16:26 PM UTC-5, Johnny Billquist wrote:
> It might be that the determinism of the whole things is rather complex,
> but it is deterministic. A CPU is, after all, just a finite state
> machine. There is nothing undeterministic when you go down to the bottom
> of it all. There are ones and zeroes. There are gates, with functions
> like "AND", "OR", "NOT" and so on. And they are all behaving in a very
> deterministic way.
The logic is not just combinational; there is plenty of register state and internal buses in a CPU. An undefined opcode could definitely trigger micro- or nano-code (aside, I know nothing about PDP-11 internals) that does "bad" things like drive two registers simultaneously onto an internal bus, or latches a value from a bus that is floating. The result of these is "deterministic" in the sense of physics, but not in terms of digital logic. A floating bus might or might not have a valid logic value; that depends on the internal history (the last valid value driven, and what exact voltage that driver used) analog conditions (capacitance & leakage) and timing that are outside the digital definitions. Two outputs fighting one another might have a deterministic outcome, or a fight between driving low & driving high might leave the line in the range of voltages that aren't defined as either low or high, and anything reading from this voltage has no guarantees about what it does.
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-03 12:50 ` Bill Gunshannon
@ 2012-02-04 8:42 ` Charles Richmond
2012-02-04 13:38 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Charles Richmond @ 2012-02-04 8:42 UTC (permalink / raw)
"Bill Gunshannon" <billg999@cs.uofs.edu> wrote in message
news:9p23hhFil0U1@mid.individual.net...
> In article <4f2b62c0$0$287$14726298@news.sunsite.dk>,
> "Jerome H. Fine" <everyone@nospam.com> writes:
>> >glen herrmannsfeldt wrote:
>>
>>>I believe that throughout history there have been a number
>>>of cases where emulators had to emulate bugs in the original
>>>machine. In some, the documentation was wrong and users
>>>expected software that depended on those bugs to work.
>>>
>>>
>> Not just emulators!! I seem to remember that FORTRAN IV had
>> some bugs which were retained in later versions because many smart
>> users figured out ways to code around them. Whatever the software,
>> the bugs were retained so the later versions would not be incompatible.
>
> And I remember a Fortran compiler (non-DEC) that had a bug fixed by
> inserting a Warning that said "Stop doing this, it is wrong and will
> never work as you expect!!" (not in those exact words. :-)
>
> As a customer I would be upset if a bug was found, reported and not
> fixed wether there was a work around or not. After all, there is a
> work-around for all bugs, use a differnt compiler/language!!
>
On the order of "if you can't fix it, pretend it's something you want", here
are "The Twelve Bugs of Christmas":
For the twelfth bug of Christmas my manager said to me:
Tell them it's a feature,
Say it's not supported,
Change the documentation,
Blame it on the hardware,
Find a way around it,
Say they need an upgrade,
Reinstall the software,
Ask for a dump,
Run it with the debugger,
Try to reproduce it,
Ask them how they did it,
and see if they can do it again.
--
+<><><><><><><><><><><><><><><><><><><>+
| Charles Richmond numerist@aquaporin4.com |
+<><><><><><><><><><><><><><><><><><><>+
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 8:42 ` Charles Richmond
@ 2012-02-04 13:38 ` paramucho
2012-02-04 16:03 ` Bill Gunshannon
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-04 13:38 UTC (permalink / raw)
On Sat, 4 Feb 2012 02:42:36 -0600, "Charles Richmond"
<netnews@aquaporin4.com> wrote:
>"Bill Gunshannon" <billg999@cs.uofs.edu> wrote in message
>news:9p23hhFil0U1@mid.individual.net...
>> In article <4f2b62c0$0$287$14726298@news.sunsite.dk>,
>> "Jerome H. Fine" <everyone@nospam.com> writes:
>>> >glen herrmannsfeldt wrote:
>>>
>>>>I believe that throughout history there have been a number
>>>>of cases where emulators had to emulate bugs in the original
>>>>machine. In some, the documentation was wrong and users
>>>>expected software that depended on those bugs to work.
>>>>
>>>>
>>> Not just emulators!! I seem to remember that FORTRAN IV had
>>> some bugs which were retained in later versions because many smart
>>> users figured out ways to code around them. Whatever the software,
>>> the bugs were retained so the later versions would not be incompatible.
>>
>> And I remember a Fortran compiler (non-DEC) that had a bug fixed by
>> inserting a Warning that said "Stop doing this, it is wrong and will
>> never work as you expect!!" (not in those exact words. :-)
>>
>> As a customer I would be upset if a bug was found, reported and not
>> fixed wether there was a work around or not. After all, there is a
>> work-around for all bugs, use a differnt compiler/language!!
>>
>
>On the order of "if you can't fix it, pretend it's something you want", here
>are "The Twelve Bugs of Christmas":
>
>For the twelfth bug of Christmas my manager said to me:
>
>Tell them it's a feature,
>Say it's not supported,
>Change the documentation,
>Blame it on the hardware,
>Find a way around it,
>Say they need an upgrade,
>Reinstall the software,
>Ask for a dump,
>Run it with the debugger,
>Try to reproduce it,
>Ask them how they did it,
>and see if they can do it again.
And tell them they need V.M.S.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 13:38 ` paramucho
@ 2012-02-04 16:03 ` Bill Gunshannon
2012-02-04 16:39 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Bill Gunshannon @ 2012-02-04 16:03 UTC (permalink / raw)
In article <4f2d3451.54499011@nntp.aioe.org>,
paramucho@hotmail.com (paramucho) writes:
> On Sat, 4 Feb 2012 02:42:36 -0600, "Charles Richmond"
> <netnews@aquaporin4.com> wrote:
>
>>"Bill Gunshannon" <billg999@cs.uofs.edu> wrote in message
>>news:9p23hhFil0U1@mid.individual.net...
>>> In article <4f2b62c0$0$287$14726298@news.sunsite.dk>,
>>> "Jerome H. Fine" <everyone@nospam.com> writes:
>>>> >glen herrmannsfeldt wrote:
>>>>
>>>>>I believe that throughout history there have been a number
>>>>>of cases where emulators had to emulate bugs in the original
>>>>>machine. In some, the documentation was wrong and users
>>>>>expected software that depended on those bugs to work.
>>>>>
>>>>>
>>>> Not just emulators!! I seem to remember that FORTRAN IV had
>>>> some bugs which were retained in later versions because many smart
>>>> users figured out ways to code around them. Whatever the software,
>>>> the bugs were retained so the later versions would not be incompatible.
>>>
>>> And I remember a Fortran compiler (non-DEC) that had a bug fixed by
>>> inserting a Warning that said "Stop doing this, it is wrong and will
>>> never work as you expect!!" (not in those exact words. :-)
>>>
>>> As a customer I would be upset if a bug was found, reported and not
>>> fixed wether there was a work around or not. After all, there is a
>>> work-around for all bugs, use a differnt compiler/language!!
>>>
>>
>>On the order of "if you can't fix it, pretend it's something you want", here
>>are "The Twelve Bugs of Christmas":
>>
>>For the twelfth bug of Christmas my manager said to me:
>>
>>Tell them it's a feature,
>>Say it's not supported,
>>Change the documentation,
>>Blame it on the hardware,
>>Find a way around it,
>>Say they need an upgrade,
>>Reinstall the software,
>>Ask for a dump,
>>Run it with the debugger,
>>Try to reproduce it,
>>Ask them how they did it,
>>and see if they can do it again.
>
> And tell them they need V.M.S.
Your in the wrong group. Nobody here needs VMS.
bill
--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
billg999@cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 16:03 ` Bill Gunshannon
@ 2012-02-04 16:39 ` paramucho
0 siblings, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-04 16:39 UTC (permalink / raw)
On 4 Feb 2012 16:03:18 GMT, billg999@cs.uofs.edu (Bill Gunshannon)
wrote:
>In article <4f2d3451.54499011@nntp.aioe.org>,
> paramucho@hotmail.com (paramucho) writes:
>> On Sat, 4 Feb 2012 02:42:36 -0600, "Charles Richmond"
>> <netnews@aquaporin4.com> wrote:
>>
>>>"Bill Gunshannon" <billg999@cs.uofs.edu> wrote in message
>>>news:9p23hhFil0U1@mid.individual.net...
>>>> In article <4f2b62c0$0$287$14726298@news.sunsite.dk>,
>>>> "Jerome H. Fine" <everyone@nospam.com> writes:
>>>>> >glen herrmannsfeldt wrote:
>>>>>
>>>>>>I believe that throughout history there have been a number
>>>>>>of cases where emulators had to emulate bugs in the original
>>>>>>machine. In some, the documentation was wrong and users
>>>>>>expected software that depended on those bugs to work.
>>>>>>
>>>>>>
>>>>> Not just emulators!! I seem to remember that FORTRAN IV had
>>>>> some bugs which were retained in later versions because many smart
>>>>> users figured out ways to code around them. Whatever the software,
>>>>> the bugs were retained so the later versions would not be incompatible.
>>>>
>>>> And I remember a Fortran compiler (non-DEC) that had a bug fixed by
>>>> inserting a Warning that said "Stop doing this, it is wrong and will
>>>> never work as you expect!!" (not in those exact words. :-)
>>>>
>>>> As a customer I would be upset if a bug was found, reported and not
>>>> fixed wether there was a work around or not. After all, there is a
>>>> work-around for all bugs, use a differnt compiler/language!!
>>>>
>>>
>>>On the order of "if you can't fix it, pretend it's something you want", here
>>>are "The Twelve Bugs of Christmas":
>>>
>>>For the twelfth bug of Christmas my manager said to me:
>>>
>>>Tell them it's a feature,
>>>Say it's not supported,
>>>Change the documentation,
>>>Blame it on the hardware,
>>>Find a way around it,
>>>Say they need an upgrade,
>>>Reinstall the software,
>>>Ask for a dump,
>>>Run it with the debugger,
>>>Try to reproduce it,
>>>Ask them how they did it,
>>>and see if they can do it again.
>>
>> And tell them they need V.M.S.
>
>Your in the wrong group. Nobody here needs VMS.
It was intended to be ironic. I was recalling what DEC told us back in
the 80s when their reps would deal with any question with:
"Okay, the answer is VMS. Now, what's the question?"
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-03 11:24 ` Johnny Billquist
@ 2012-02-04 17:06 ` paramucho
2012-02-04 18:22 ` paramucho
2012-02-04 18:51 ` Johnny Billquist
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-04 17:06 UTC (permalink / raw)
On Fri, 03 Feb 2012 12:24:15 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-02 14.31, paramucho wrote:
>> On Thu, 02 Feb 2012 01:14:39 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>>> On 2012-02-01 14:48, paramucho wrote:
>>>> On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist<bqt@softjar.se>
>>>> wrote:
<snip>
>>> We might read things in a different way. "Undefined" is, in this
>>> circumstance, as far as I can tell, only something that is valid as far
>>> as a general view of a PDP-11 is concerned. If you emulate a specific
>>> implementation, the behavior is not undefined. And Simh aims to
>>> implement the same twists as the machine it pretends to emulate. You
>>> have found a case where it does not behave the same way as the machine
>>> it claims to emulate. I'd say that this means Simh have a bug.
>>>
>>> Undefined generally only means that different implementations of a
>>> PDP-11 are free to do this as they see fit, and no program should depend
>>> on a specific behavior.
>>> However, a specific implementation will only do it one way or another.
>>
>> I have been using "undefined" in the architectural sense, that is,
>> behavior which is not specified by the *architecture* or explicitly
>> specified as "undefined". That's fairly well-known terminology.
>
>Excellent. So we are using it the same way.
No, we ain't!
>So when E11 is configured to simulate a J11, it is expected to do things
>the same way as a J11, and if you managed to find corner cases where it
>doesn't, then it is a bug in E11, since it is expected to behave the
>same as a J11. And the same for Simh. That is why all those options in
>the config exist - to make the emulator implement all the odd behavior
>of that specific implementation.
I'm talking about the architecture:
By "architecture" I mean the specification of the system in the
relevant documents. For example, the 11/73 is specified by the
documents in http://www.bitsavers.org/pdf/dec/pdp11/1173/. The
relevant XXDP processor tests provide further clarification of the
architecture. In some cases it may be necessary to refer to the actual
hardware if the specification is fuzzy.
You're talking about the implementation:
By "implementation" I mean the behavior of the actual machine. It may
have behaviors which are not part of the architecture or which are
specified by the architecture "undefined" or "unpredictable".
The implementation behavior may contain "don't care" states which are
not specified or defined by the architecture.
>E11 (or Simh) is not a generic PDP-11 implementation, but aims to
>emulate specific models, with all their quirks.
That doesn't have to be an issue as we can consider each emulated
model separately.
>> Clearly, there can be *no* undefined *implementation* behavior and
>> thus the distinction between "defined" and "undefined" is meaningless
>> if applied to the implementation.
>
>Right.
>
>> But to take your point that an emulation could avoid "undefined"
>> architecture states by referring to "unspecified implementation
>> behavior" I'd make two arguments.
>
>I'm not sure I made that point. I think my point was that the emulator
>don't have any "undefined" behavior. It claims to emulate a specific
>system/model, and thus it should (obviously) have the same quirks as the
>system it emulates.
>Your response that you are exploiting "undefined" behavior to find out
>what system it is, is, in my view, invalid for an emulator that aims to
>emulate another system. It should not be possible to tell the emulation
>apart from the system it emulates. Otherwise the emulation is buggy. So,
>any trick you figured out to detect that you are running under Simh is,
>by definition, a bug in Simh.
The point depends on the distinction between "architecture" and
"implementation" made above...
>> Second, I don't think that emulator authors are as strict as you
>> imply.
>
>I think that Bob definitely are that strict. And I'm pretty sure that
>John in general are too, since he have gone to great lengths to
>implement the specific behavior of different implementations of the
>PDP-11 for these undefined things.
But I don't think you're consistent in your expectations. See below.
>> For example, consider the following "programming difference"
>> from one of the J11 architecture documents:
>>
>> 30. If a register contains an odd value in mode 2 and a [11/73]
>> bus error occurs, the register will be incremented
>>
>> If a register contains an odd value in mode 2 and a [11/34]
>> bus error occurs, the register will be unchanged.
>>
>> SimH gets it right for its default J11 CPU, where it increments
>> and wrong for an 11/34, where it should be unchanged. E11 is the other
>> way around: right for its default 11/34 CPU, where it's unchanged and
>> wrong for the J11 where it should increment. Now these are examples of
>> incorrect implementation differences (that I would never rely on for a
>> detection test), however, there's no screaming need for SimH or E11 to
>> fix them.
>
>Have you tried, for both, to tell that it should be an 11/34 and an
>11/73 respectively, and see what the results becomes for both?
Yikes, that's *exactly* how I did the tests. I ran the test on the
11/73 and 11/34 models on both SimH and E11. I put part of the display
in a response to Al Kossow.
>E11 can be told to be a whole bunch of different PDP-11 models.
>Just reading through the manual, you can specify it to act as a:
>PDP-11/03, PDP-11/04, PDP-11/05, PDP-11/20, PDP-11/23, PDP-11/24,
>PDP-11/34a, PDP-11/40, PDP- 11/44, PDP-11/45, PDP-11/53, PDP-11/60,
>PDP-11/70, PDP-11/73, PDP-11/74, PDP-11/83, PDP-11/84, PDP-11/93, or
>PDP-11/94 CPU with individually selectable features.
>Picking the right CPU model is important, and do change the behavior of E11.
>
>And it's similar in Simh, where there is also a long list of different
>PDP-11 models you can choose from to set as the CPU Simh should look like.
>
>But there might be bugs. I think they should be reported in that case.
I'll upload the utility for anyone who wants to do that (I just got
back from a two month visit down south and hope to upload the stuff
I've been promising in the next week or so--I need to reorganise some
directories so that the development tree I upload looks sensible and
like what I use locally).
>> Whenever I write a new RUST driver I first get it up and running under
>> V11, and then on couple of different real PDP-11s. Then I test E11 and
>> SimH, where I often have to make changes to the driver to get it work.
>> Likewise, I have a debugger which uses the trace trap to store an
>> execution history. It works well under E11 but is a bit wierd under
>> SimH.
>
>Maybe a bug in Simh that should be reported? I know it took some working
>before the trace trap worked ok in E11.
I have a (short) TODO list for SimH things that need reporting, but
trace isn't on it. Although I wrote the code a long time ago I didn't
test it under E11 or SimH until this week. I wouldn't know what to
report other than "it fails". I saw John Wilson's acknowledgement of
your effort in helping get the T-bit work in E11, so you're probably
better equipped than I to work on SimH :-) Just about the only time I
use SimH is when I test stuff for these threads.
>> One of the key strengths of SimH is its portability across different
>> systems, and in to the future since it sticks pretty much to
>> straightforward C code. This portability may well be one reason that
>> SimH doesn't mimic asynchronous I/O. There are always trade-offs.
>
>I noted another thing that had been sitting in the back of my head, and
>which John Wilson documents in the manual for E11. Both RSX and RT-11
>sometimes actually requires that I/O takes a little while before it
>completes, or else the OS malfunctions.
>How much you'd want to call that synchronous, I don't know. E11
>basically can do a fixed number of instructions delay before reporting
>I/O as complete.
It's more a fudge than an asynchronous service, but I know what you
mean. V11 has the same kind of thing (because there's no choice).
John Wilson describes it thus (with RT-11 and RSX both guilty :-)
In my testing, RSX appeared to issue WAIT instructions for TTY
output which was assumed not to have completed yet a few dozen
instructions after writing a character to a DL11 (thus hanging the
system), and similarly the RT-11 SJ (but not FB/XM) keyboard
interrupt service routine runs with interrupts enabled on the
assumption that another keyboard interrupt couldn't possibly happen
before the current ISR finishes (when this does happen the ISR
recurses and the characters are put in the bu\ver in reverse order,
which was happening with VT100 keypad keys in E11). The solution to
these problems was to put in a queueing system, so that the
interrupt (and in most cases the transfer itself) doesn't occur
until a pre-set number of instruction fetches after the instruction
that started the transfer.
Ersatz-11 demo guide, notes/interrupts
The default settings for SimH and E11 are a 100 instruction delay for
console output.
E11: show delay dl0 => 1:100. (0:200. is for input)
SimH: examine tto time => TIME 100
On a real PDP-11 DL11 terminal interface there is no additional delay
(unless output is suspended with ([ctrl/s]). Indeed, a good DLx11 is
double buffered so the first character completes immediately. The
following test counts instructions for four output characters. The
counts are in octal and need to be multipled by three (there are three
instructions in the counting loop).
1st 2nd ...
DL11 1 144 144 144 Double-buffered (DLV11J actually)
SimH 42 42 42 42 Constant delay
E11 42 42 42 42 Constant delay
V11 1 1 1 1 "Ready" is immediate. Interrupt is delayed.
I haven't used this delay test for detection in the past because SimH
used to display nulls as spaces on Windows. Since that problem no
longer exists (AFAIK) I can now use the delay test as part of the
detection process.
<snip>
>>> A lot of the "undefined" behavior is in fact things that are used to
>>> identify one CPU from another.
>>
>> Which is exactly what I've used in the past and that's what I'm using
>> with the emulators. I made the point elsewhere: that software often
>> relies on the unchanging behavior of an implementation. One could make
>> the case that an emulation should likewise strive to be unchanging
>> whenever possible if it wants to emulate real machines.
>
>My point is that an emulation should not have a different behavior from
>the system it tries to emulate. You are depending on exactly this "error".
You can call it an "error" if you want to. For me it's a "difference",
one among many, and one which is much less likely to be corrected.
The only way I can detect an emulator in its standard deliverable form
is to locate distinctive behavior (which you call "errors"). The trick
is to find behavior which is not worth correcting, for whatever
reason. The only other alternative I have is to give up on detection,
and I'm not going to do that.
We're going round in circles. At this point in the post you expect the
emulation to correct differences ("errors"). At other points you
accept differences, such as timing. You even seem to accept
differences in the architecturally defined MMU SR1 register in E11 as
"right"!
<snip>
>> That's cool (the only thing I thread in V11 is the terminal). E11 aims
>> at high performance and I guess that's *one* reason that John Wilson
>> didn't bother to implement MMU register SR1--it would have adversely
>> affected performance (since it requires a 2-part calculation and store
>> for every register/mode access).
>
>Um? Are we talking about MMR1 here? The register used to record
>autoincrement/autodecrement of general registers during execution of an
>instruction in case the instruction aborts?
Yes
>Or are you talking about some other register?
>Looking in RSX, it don't seem like the kernel use that ever, but it does
>get propagated to user programs when you get a trap in the user program,
>so potentially it could be needed in RSX.
>
>But it would probably only be useful if you wanted to restart
>instructions after page faults, and since no OS that I know of do page
>faults, I can see how it is not being used anywhere.
It was an architectural flop. It was never used. We discussed it
recently. My typing hands get itchy when I think about it. At some
point in the next twenty years I plan to write a system which does use
it. The problem is that you really need to start from scratch--it
would be messy to add that functionality into an existing system.
>> My detection tests involve SR1. The shakiest part of my approach is
>> that it would be quite reasonable for E11 to improve SR1 emulation at
>> some point (regardless of my tests), although since no system actually
>> uses the functionality there's no real incentive to do so.
On closer inspection I find that I'm not using SR1 for E11 detection
tests at all. In fact, my E11 test checks whether bits 5 and 6 of MMU
SR0 are writeable. These bits are not writeable on the F11 or J11, but
a closer inspection of the 11/34 architecture documents indicates they
may well be writeable on a real 11/34, and that's the default E11 CPU.
I may have to find a different E11 test (see further below).
If anyone with an 11/34 is still reading this long post the test that
needs to be performed is something like this:
1000 012737 mov #177776,@#177572 ; see all in SR0 except MMU enable
1002 177776
1004 177572
1006 013700 mov @#177572,r0 ; get the result in R0
1010 177572
1012 000000 halt
The requisite result value will be in R0.
Now, on a separate note, consider the SimH SR0 implementation as well:
SimH 11/34 MMU SR0 bits 5&6 Not writeable. Always zero.
E11 11/34 MMU SR0 bits 5&6 (Perhaps) Writeable.
SimH simply retains the architectural J11 state which defines the bits
as read-only.
Which implementation is correct? Which is in error?
The 11/34 architecture document 11/34 says that the state any SR0 bits
other than 0 and 8 are not meaningful if set by the user (but doesn't
say which can be set). In terms of the 11/34 architecture the state of
bits 5 and 6 is irrelevant if set by the user and thus neither E11 or
SimH is *architecturally* incorrect (or in "error") as the state is
"meaningless".
>I can see that it might be costly to maintain it, but on the other hand,
>if trappings never will occur with registers updated that needs
>rollback, SR1 can be left zero at all times.
>So it might actually be that E11 already does it "right".
I admire the flexibility you have with the definitions of "error"
above and "right" here :-) Earlier any "difference" was an
"error". Now a difference which clearly doesn't match the architecture
can be considered "right"!
This thread has forced me to get a real PDP-11 working again so that I
can realistically test some of the code on real iron. The hardware
came up pretty well, but it took a couple of days to figure out that
winpcap (which I use to network RUST to my Windows box) had changed
some of its behavior significantly. It's nice to hear the hum of
PDP-11 again and to have a VT220 on my desk (which still looks cool).
During the course of this thread I've worked out roughly how to go
forward with E11 and SimH detection.
1. If it's V11, exit
2. If a boot rom is present at 173000, exit.
i
I haven't mentioned this sanity test, but it is currently
performed and is good emulator test. Most sensible real PDP-11
systems that would run RUST would have a boot rom. SimH and E11
don't have it. But it's not enough of a test on its own (and I'm
not sure about real 11/9x's).
3. If a terminal output delay is present then it's probably an
emulator. (See discussion above)
4. If the clock/terminal baud rate test result exceeds a maximum then
it's probably an emulator. (As previously discussed)
5. Reuse the existing MMU tests to *discriminate* between SimH and
E11 rather than to *detect* the emulators.
The resulting test uses multiple types of evidence and that's probably
the best way to go rather than having a single critical point. I still
need a non-MMU method to discriminate between E11 and SimH though.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 17:06 ` paramucho
@ 2012-02-04 18:22 ` paramucho
2012-02-04 18:55 ` Johnny Billquist
2012-02-04 18:51 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-04 18:22 UTC (permalink / raw)
On Sat, 04 Feb 2012 17:06:57 GMT, paramucho@hotmail.com (paramucho)
wrote:
>During the course of this thread I've worked out roughly how to go
>forward with E11 and SimH detection.
>
>1. If it's V11, exit
>
>2. If a boot rom is present at 173000, exit.
>i
> I haven't mentioned this sanity test, but it is currently
> performed and is good emulator test. Most sensible real PDP-11
> systems that would run RUST would have a boot rom. SimH and E11
> don't have it. But it's not enough of a test on its own (and I'm
> not sure about real 11/9x's).
>
>3. If a terminal output delay is present then it's probably an
> emulator. (See discussion above)
>
>4. If the clock/terminal baud rate test result exceeds a maximum then
> it's probably an emulator. (As previously discussed)
>
>5. Reuse the existing MMU tests to *discriminate* between SimH and
> E11 rather than to *detect* the emulators.
>
>The resulting test uses multiple types of evidence and that's probably
>the best way to go rather than having a single critical point. I still
>need a non-MMU method to discriminate between E11 and SimH though.
I got a better idea just after I pushed SEND (by mistake).
The idea is to do the "terminal delay" test twice, counting the number
of instructions for each of four output characters.
Loop 1: The first time through the instruction counting loop looks
like this:
10$: inc (r0) ; count instructions
tstb (r1) ; r1 -> TPS
bne 10$ ; more
; 5 memory references
Loop 2: The second loop looks like this:
20$: add @one,@cnt ; inc (r0)
bitb @rdy,@sts ; tstb tps
bne 20$ ; more
; 11 memory references
one: .word .+2,1
cnt: etc
The difference in the number of memory references should affect the
counts for a real PDP-11 but have no affect on E11 or SimH.
The first loop has five memory references per iteration. The second
has eleven. On a real PDP-11 more than twice as many instructions will
occur in the first loop than in the second. Under E11 or SimH the loop
counts will be constant.
Loop 1 Loop2
157 155 156 155 56 57 56 55 Real PDP-1
42 42 42 42 42 42 42 42 SimH or E11
This test is reasonably short and fairly definitive in testing the
difference between a standard "real" PDP-11 system and an emulated
system running under SimH or E11.
The test doesn't discriminate between E11 and SimH; that's a separate
task.
Here's the rough test program I put together and which I ran on an
11/23, E11 and SimH. The second line of the source is modified for
non-RUST systems. You have to examine the table c$utab using the
console debugger to get the results.
.title ttnulx - detect emulator via TT nulls
;.include "lib:rust.mac" ; RUST
.mcall .mtps ; RT-11
; %build
; macro ets:ttnulx/object:etb:
; link etb:ttnulx/exe:etb:
; %end
tps = 177564
tpb = 177566
c$utab: .word 0, 0, 0, 0
.word 0, 0, 0, 0
start: .mtps #340
10$: mov #c$utab,r0
mov #4,r1
mov #tps,r2
call synch
20$: clr (r0)
clrb @#tpb
30$: inc (r0)
tstb (r2)
bpl 30$
tst (r0)+
dec r1
bne 20$
call synch
mov #4,r1
40$: clr (r0)
mov r0,c$upnt
clrb @#tpb
50$: add @c$uone,@c$upnt
bitb @c$u200,@c$utps
beq 50$
tst (r0)+
dec r1
bne 40$
halt
mov #c$utab,r0
br 10$
c$uone: .word .+2,1
c$u200: .word .+2,200
c$upnt: .word 0
c$utps: .word tps
synch:
10$: tstb @#tps
bpl 10$
clr @#tpb
20$: tstb @#tps
bpl 20$
return
.end start
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 17:06 ` paramucho
2012-02-04 18:22 ` paramucho
@ 2012-02-04 18:51 ` Johnny Billquist
2012-02-04 23:09 ` glen herrmannsfeldt
2012-02-05 13:57 ` paramucho
1 sibling, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-04 18:51 UTC (permalink / raw)
On 2012-02-04 18.06, paramucho wrote:
> On Fri, 03 Feb 2012 12:24:15 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-02 14.31, paramucho wrote:
>>> On Thu, 02 Feb 2012 01:14:39 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>>> On 2012-02-01 14:48, paramucho wrote:
>>>>> On Wed, 01 Feb 2012 12:48:42 +0100, Johnny Billquist<bqt@softjar.se>
>>>>> wrote:
> <snip>
>
>>>> We might read things in a different way. "Undefined" is, in this
>>>> circumstance, as far as I can tell, only something that is valid as far
>>>> as a general view of a PDP-11 is concerned. If you emulate a specific
>>>> implementation, the behavior is not undefined. And Simh aims to
>>>> implement the same twists as the machine it pretends to emulate. You
>>>> have found a case where it does not behave the same way as the machine
>>>> it claims to emulate. I'd say that this means Simh have a bug.
>>>>
>>>> Undefined generally only means that different implementations of a
>>>> PDP-11 are free to do this as they see fit, and no program should depend
>>>> on a specific behavior.
>>>> However, a specific implementation will only do it one way or another.
>>>
>>> I have been using "undefined" in the architectural sense, that is,
>>> behavior which is not specified by the *architecture* or explicitly
>>> specified as "undefined". That's fairly well-known terminology.
>>
>> Excellent. So we are using it the same way.
>
> No, we ain't!
Really? You could have fooled me.
>> So when E11 is configured to simulate a J11, it is expected to do things
>> the same way as a J11, and if you managed to find corner cases where it
>> doesn't, then it is a bug in E11, since it is expected to behave the
>> same as a J11. And the same for Simh. That is why all those options in
>> the config exist - to make the emulator implement all the odd behavior
>> of that specific implementation.
>
> I'm talking about the architecture:
But the J11 is not the architecture. It is a specific implementation.
Thus, "undefined" does not make sense when we talk about the J11
specifically. "Undefined" is only meaningful when we talk about the
architecture.
So, you using instructions, or behavior, that you claim are undefined,
is to me an illegal use of the word "undefined". As it is only undefined
for the architecture. Any implementation will have a defined behavior.
> By "architecture" I mean the specification of the system in the
> relevant documents. For example, the 11/73 is specified by the
> documents in http://www.bitsavers.org/pdf/dec/pdp11/1173/. The
> relevant XXDP processor tests provide further clarification of the
> architecture. In some cases it may be necessary to refer to the actual
> hardware if the specification is fuzzy.
>
> You're talking about the implementation:
Right. And the 11/73 is a specific implementation, not an
"architecture". The PDP-11 is the architecture.
> By "implementation" I mean the behavior of the actual machine. It may
> have behaviors which are not part of the architecture or which are
> specified by the architecture "undefined" or "unpredictable".
> The implementation behavior may contain "don't care" states which are
> not specified or defined by the architecture.
Right. But a specific implementation will have a deterministic behavior
with regard to these details.
Thus, it is not "undefined".
>> E11 (or Simh) is not a generic PDP-11 implementation, but aims to
>> emulate specific models, with all their quirks.
>
> That doesn't have to be an issue as we can consider each emulated
> model separately.
We in fact must. As Simh does not implement any PDP-11 based on the
architecture, but instead just tries to simulate a number of existing
implementations.
>>> Clearly, there can be *no* undefined *implementation* behavior and
>>> thus the distinction between "defined" and "undefined" is meaningless
>>> if applied to the implementation.
>>
>> Right.
>>
>>> But to take your point that an emulation could avoid "undefined"
>>> architecture states by referring to "unspecified implementation
>>> behavior" I'd make two arguments.
>>
>> I'm not sure I made that point. I think my point was that the emulator
>> don't have any "undefined" behavior. It claims to emulate a specific
>> system/model, and thus it should (obviously) have the same quirks as the
>> system it emulates.
>> Your response that you are exploiting "undefined" behavior to find out
>> what system it is, is, in my view, invalid for an emulator that aims to
>> emulate another system. It should not be possible to tell the emulation
>> apart from the system it emulates. Otherwise the emulation is buggy. So,
>> any trick you figured out to detect that you are running under Simh is,
>> by definition, a bug in Simh.
>
> The point depends on the distinction between "architecture" and
> "implementation" made above...
I think you are using the term "architecture" wrong, if you think that a
PDP-11/73 is an architecture.
>>> Second, I don't think that emulator authors are as strict as you
>>> imply.
>>
>> I think that Bob definitely are that strict. And I'm pretty sure that
>> John in general are too, since he have gone to great lengths to
>> implement the specific behavior of different implementations of the
>> PDP-11 for these undefined things.
>
> But I don't think you're consistent in your expectations. See below.
I think you are jumping to wrong conclusions, but I can partly agree
with you. However, I should also point out (which I've done in other
posts as well) that I am not looking for such strict simulation. I'm
also perfectly comfortable with adding an instruction that don't exist
in any other existing implementation of the PDP-11. But that is my view.
I use PDP-11s (both real and simulated) as a way to develop software.
Not to act as a museum, nor as a collector.
>>> For example, consider the following "programming difference"
>>> from one of the J11 architecture documents:
>>>
>>> 30. If a register contains an odd value in mode 2 and a [11/73]
>>> bus error occurs, the register will be incremented
>>>
>>> If a register contains an odd value in mode 2 and a [11/34]
>>> bus error occurs, the register will be unchanged.
>>>
>>> SimH gets it right for its default J11 CPU, where it increments
>>> and wrong for an 11/34, where it should be unchanged. E11 is the other
>>> way around: right for its default 11/34 CPU, where it's unchanged and
>>> wrong for the J11 where it should increment. Now these are examples of
>>> incorrect implementation differences (that I would never rely on for a
>>> detection test), however, there's no screaming need for SimH or E11 to
>>> fix them.
>>
>> Have you tried, for both, to tell that it should be an 11/34 and an
>> 11/73 respectively, and see what the results becomes for both?
>
> Yikes, that's *exactly* how I did the tests. I ran the test on the
> 11/73 and 11/34 models on both SimH and E11. I put part of the display
> in a response to Al Kossow.
But your comments are confusing. If you are talking about the J11 (which
is an implementation and not an architecture, by the way), then the
11/34 comments make no sense. The 11/34 does not use the J11
(implementation), but have another implementation of the PDP-11
architecture. And if you find a note in a J11 manual that tells how the
11/34 is expected to behave, it's a nice piece of information, but I
would prefer to check the documentation for the 11/34 instead, if I want
information on that machine.
Also, I'm not sure I get the "default" reference. Any simulator probably
have a default machine they will do if you don't specify anything else,
but if you change the model it should simulate, the "default" should be
irrelevant. However, different simulators can (and probably will) have
different bugs. One doing things wrong one way, and the other in another
way.
Unless both produce the correct results for both selected models, I'd
say both have a bug here.
>> But there might be bugs. I think they should be reported in that case.
>
> I'll upload the utility for anyone who wants to do that (I just got
> back from a two month visit down south and hope to upload the stuff
> I've been promising in the next week or so--I need to reorganise some
> directories so that the development tree I upload looks sensible and
> like what I use locally).
I'll happily look at, and play with that code.
>>> Whenever I write a new RUST driver I first get it up and running under
>>> V11, and then on couple of different real PDP-11s. Then I test E11 and
>>> SimH, where I often have to make changes to the driver to get it work.
>>> Likewise, I have a debugger which uses the trace trap to store an
>>> execution history. It works well under E11 but is a bit wierd under
>>> SimH.
>>
>> Maybe a bug in Simh that should be reported? I know it took some working
>> before the trace trap worked ok in E11.
>
> I have a (short) TODO list for SimH things that need reporting, but
> trace isn't on it. Although I wrote the code a long time ago I didn't
> test it under E11 or SimH until this week. I wouldn't know what to
> report other than "it fails". I saw John Wilson's acknowledgement of
> your effort in helping get the T-bit work in E11, so you're probably
> better equipped than I to work on SimH :-) Just about the only time I
> use SimH is when I test stuff for these threads.
I very seldom use Simh as well. I use E11 a lot more, but I have my
trusty 11/93 sitting right next to my desk, and that is actually my
preferred machine.
Simh is mostly for small experiments for me.
>>> One of the key strengths of SimH is its portability across different
>>> systems, and in to the future since it sticks pretty much to
>>> straightforward C code. This portability may well be one reason that
>>> SimH doesn't mimic asynchronous I/O. There are always trade-offs.
>>
>> I noted another thing that had been sitting in the back of my head, and
>> which John Wilson documents in the manual for E11. Both RSX and RT-11
>> sometimes actually requires that I/O takes a little while before it
>> completes, or else the OS malfunctions.
>> How much you'd want to call that synchronous, I don't know. E11
>> basically can do a fixed number of instructions delay before reporting
>> I/O as complete.
>
> It's more a fudge than an asynchronous service, but I know what you
> mean. V11 has the same kind of thing (because there's no choice).
Right
> On a real PDP-11 DL11 terminal interface there is no additional delay
> (unless output is suspended with ([ctrl/s]). Indeed, a good DLx11 is
> double buffered so the first character completes immediately. The
> following test counts instructions for four output characters. The
> counts are in octal and need to be multipled by three (there are three
> instructions in the counting loop).
I think the bugs that John noted were for input, not output. So having
an output device being able to swallow several characters is not a
problem for either OS.
> I haven't used this delay test for detection in the past because SimH
> used to display nulls as spaces on Windows. Since that problem no
> longer exists (AFAIK) I can now use the delay test as part of the
> detection process.
Probably not something to blame Simh for, though.
>>>> A lot of the "undefined" behavior is in fact things that are used to
>>>> identify one CPU from another.
>>>
>>> Which is exactly what I've used in the past and that's what I'm using
>>> with the emulators. I made the point elsewhere: that software often
>>> relies on the unchanging behavior of an implementation. One could make
>>> the case that an emulation should likewise strive to be unchanging
>>> whenever possible if it wants to emulate real machines.
>>
>> My point is that an emulation should not have a different behavior from
>> the system it tries to emulate. You are depending on exactly this "error".
>
> You can call it an "error" if you want to. For me it's a "difference",
> one among many, and one which is much less likely to be corrected.
But the stated aim for these simulators is that they should truthfully
emulate an existing machine! Thus, you are using bugs where they don't
truthfully emulate these machines to tell this.
I think that would imply that it is bugs in the simulation, and as such,
I would think they should go away.
> The only way I can detect an emulator in its standard deliverable form
> is to locate distinctive behavior (which you call "errors"). The trick
> is to find behavior which is not worth correcting, for whatever
> reason. The only other alternative I have is to give up on detection,
> and I'm not going to do that.
Well. You are on a potential collision course with some simulation
implementers in that case. But that is not my problem. :-)
> We're going round in circles. At this point in the post you expect the
> emulation to correct differences ("errors"). At other points you
> accept differences, such as timing. You even seem to accept
> differences in the architecturally defined MMU SR1 register in E11 as
> "right"!
You are failing to separate my personal opinions from what I perceive
are the goals of the simulators (and their implementers).
However, to point something out. Architectually, the SR1 register is
defined to store the values needed to adjust registers modified from an
instruction only partially executed. As such, the architecture leaves
the exact usage and implementation up to the implementer. If you do a
PDP-11 implementation which never will leave registers in an updated
state for an aborted instruction, the correct value in SR1 (by the
architectural definition) is always zero.
However, if we talk about other, already existing implementations, they
might very well do something else, which leaves non-zero values in SR1.
So, from an architectural point of view, I'm totally adhering to the
architecture. From a specific implementations point of view, this is not
a valid approach. If you want to emulate an implementation truthfully,
you also need to do that for this aspect (of course).
>>> That's cool (the only thing I thread in V11 is the terminal). E11 aims
>>> at high performance and I guess that's *one* reason that John Wilson
>>> didn't bother to implement MMU register SR1--it would have adversely
>>> affected performance (since it requires a 2-part calculation and store
>>> for every register/mode access).
>>
>> Um? Are we talking about MMR1 here? The register used to record
>> autoincrement/autodecrement of general registers during execution of an
>> instruction in case the instruction aborts?
>
> Yes
So I guess JW did not implement it correctly. I guess you are also right
on why.
>> Or are you talking about some other register?
>> Looking in RSX, it don't seem like the kernel use that ever, but it does
>> get propagated to user programs when you get a trap in the user program,
>> so potentially it could be needed in RSX.
>>
>> But it would probably only be useful if you wanted to restart
>> instructions after page faults, and since no OS that I know of do page
>> faults, I can see how it is not being used anywhere.
>
> It was an architectural flop. It was never used. We discussed it
> recently. My typing hands get itchy when I think about it. At some
> point in the next twenty years I plan to write a system which does use
> it. The problem is that you really need to start from scratch--it
> would be messy to add that functionality into an existing system.
I know we talked about paging not long ago. I wouldn't call it a flop.
I'd call the MARK instruction a flop. There are some other unused
features in some machines as well. Wouldn't necessarily call them flops
either, just because they weren't used. But of course, this depends on
your definition of flop, which might differ from mine. :-)
One good reason why no software use SR1 is that not all machines capable
of running RSX, RT11, Unix and so on, have SR1 at all. You'd either have
to write an OS specifically for machines with this feature, or else it
is not usable. I think DEC just didn't feel motivated for such a
restricted set of machines, at the time they were still pondering new
OSes for the PDP-11, and the range of machines that were available back
then.
>>> My detection tests involve SR1. The shakiest part of my approach is
>>> that it would be quite reasonable for E11 to improve SR1 emulation at
>>> some point (regardless of my tests), although since no system actually
>>> uses the functionality there's no real incentive to do so.
>
> On closer inspection I find that I'm not using SR1 for E11 detection
> tests at all. In fact, my E11 test checks whether bits 5 and 6 of MMU
> SR0 are writeable. These bits are not writeable on the F11 or J11, but
> a closer inspection of the 11/34 architecture documents indicates they
> may well be writeable on a real 11/34, and that's the default E11 CPU.
> I may have to find a different E11 test (see further below).
Ah. Next question (obviously) is if you tested SR1 in E11 and found it
failing, or if it actually works right?
> If anyone with an 11/34 is still reading this long post the test that
> needs to be performed is something like this:
Not me. Been over 10 years since I last were around an 11/34.
> Now, on a separate note, consider the SimH SR0 implementation as well:
>
> SimH 11/34 MMU SR0 bits 5&6 Not writeable. Always zero.
> E11 11/34 MMU SR0 bits 5&6 (Perhaps) Writeable.
>
> SimH simply retains the architectural J11 state which defines the bits
> as read-only.
>
> Which implementation is correct? Which is in error?
We would need to check a real PDP-11/34 for the answer which one is
correct (if any), obviously.
>> I can see that it might be costly to maintain it, but on the other hand,
>> if trappings never will occur with registers updated that needs
>> rollback, SR1 can be left zero at all times.
>> So it might actually be that E11 already does it "right".
>
> I admire the flexibility you have with the definitions of "error"
> above and "right" here :-) Earlier any "difference" was an
> "error". Now a difference which clearly doesn't match the architecture
> can be considered "right"!
You are right that from a strict following the implementation it should
simulate, this would not be correct. From an architectural point of
view, however, it would be perfectly valid.
Since I'm not in the strict simulation camp anyway, I wouldn't mind
someone taking that freedom. However, for someone who wants a truthful
simulation, this would be wrong.
> This thread has forced me to get a real PDP-11 working again so that I
> can realistically test some of the code on real iron. The hardware
> came up pretty well, but it took a couple of days to figure out that
> winpcap (which I use to network RUST to my Windows box) had changed
> some of its behavior significantly. It's nice to hear the hum of
> PDP-11 again and to have a VT220 on my desk (which still looks cool).
That is a good thing. :-)
> During the course of this thread I've worked out roughly how to go
> forward with E11 and SimH detection.
>
> 1. If it's V11, exit
>
> 2. If a boot rom is present at 173000, exit.
> i
> I haven't mentioned this sanity test, but it is currently
> performed and is good emulator test. Most sensible real PDP-11
> systems that would run RUST would have a boot rom. SimH and E11
> don't have it. But it's not enough of a test on its own (and I'm
> not sure about real 11/9x's).
The E11 machines I run have a boot rom, which I believe I mentioned earlier.
Real 11/9x machines also have a boot rom at 173000.
> 3. If a terminal output delay is present then it's probably an
> emulator. (See discussion above)
>
> 4. If the clock/terminal baud rate test result exceeds a maximum then
> it's probably an emulator. (As previously discussed)
>
> 5. Reuse the existing MMU tests to *discriminate* between SimH and
> E11 rather than to *detect* the emulators.
>
> The resulting test uses multiple types of evidence and that's probably
> the best way to go rather than having a single critical point. I still
> need a non-MMU method to discriminate between E11 and SimH though.
Have fun. :-)
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 18:22 ` paramucho
@ 2012-02-04 18:55 ` Johnny Billquist
2012-02-04 19:13 ` Bill Gunshannon
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-04 18:55 UTC (permalink / raw)
On 2012-02-04 19.22, paramucho wrote:
> On Sat, 04 Feb 2012 17:06:57 GMT, paramucho@hotmail.com (paramucho)
> wrote:
>
>> During the course of this thread I've worked out roughly how to go
>> forward with E11 and SimH detection.
>>
>> 1. If it's V11, exit
>>
>> 2. If a boot rom is present at 173000, exit.
>> i
>> I haven't mentioned this sanity test, but it is currently
>> performed and is good emulator test. Most sensible real PDP-11
>> systems that would run RUST would have a boot rom. SimH and E11
>> don't have it. But it's not enough of a test on its own (and I'm
>> not sure about real 11/9x's).
>>
>> 3. If a terminal output delay is present then it's probably an
>> emulator. (See discussion above)
>>
>> 4. If the clock/terminal baud rate test result exceeds a maximum then
>> it's probably an emulator. (As previously discussed)
>>
>> 5. Reuse the existing MMU tests to *discriminate* between SimH and
>> E11 rather than to *detect* the emulators.
>>
>> The resulting test uses multiple types of evidence and that's probably
>> the best way to go rather than having a single critical point. I still
>> need a non-MMU method to discriminate between E11 and SimH though.
>
> I got a better idea just after I pushed SEND (by mistake).
>
> The idea is to do the "terminal delay" test twice, counting the number
> of instructions for each of four output characters.
[...]
> The difference in the number of memory references should affect the
> counts for a real PDP-11 but have no affect on E11 or SimH.
Good point, and very valid. Speed issues are the hardest to simulate
correctly. (And the ones I in general expect will almost never be "fixed".)
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 18:55 ` Johnny Billquist
@ 2012-02-04 19:13 ` Bill Gunshannon
2012-02-05 13:28 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Bill Gunshannon @ 2012-02-04 19:13 UTC (permalink / raw)
In article <jgjuvq$8am$1@iltempo.update.uu.se>,
Johnny Billquist <bqt@softjar.se> writes:
>
> Good point, and very valid. Speed issues are the hardest to simulate
> correctly. (And the ones I in general expect will almost never be "fixed".)
Actually, they can be. It's rather easy to slow the system down. Many
other emulators of old microcomputers do this because many of the games
relied on the speed of the machine and when sped up 500 times the games
got rather difficult to play. :-)
But then, the question might be, except for the example above, why would
anyone want to slow it down?
And, no, I don't consider the fact that they run faster than the original
to be a flaw in the emulation. They are just running as if the original
was over-clocked.
bill
--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
billg999@cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 18:51 ` Johnny Billquist
@ 2012-02-04 23:09 ` glen herrmannsfeldt
2012-02-05 14:01 ` paramucho
2012-02-05 14:27 ` Johnny Billquist
2012-02-05 13:57 ` paramucho
1 sibling, 2 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-04 23:09 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip)
>> I'm talking about the architecture:
> But the J11 is not the architecture. It is a specific implementation.
> Thus, "undefined" does not make sense when we talk about the J11
> specifically. "Undefined" is only meaningful when we talk about the
> architecture.
I probably agree, but one might make a case the other way.
> So, you using instructions, or behavior, that you claim are undefined,
> is to me an illegal use of the word "undefined". As it is only undefined
> for the architecture. Any implementation will have a defined behavior.
Implementations might also have undefined behavior. If you clock a
J11 at 500MHz, its behavior is likely undefined. If you run it
outside any of the specifications, voltage, temperature, clock
rate, setup and hold times, etc., it is undefined.
Many newer processors (or their support chips) have timing
based on the contents of registers, such that for some values
the operation is undefined.
(snip)
>> You're talking about the implementation:
> Right. And the 11/73 is a specific implementation, not an
> "architecture". The PDP-11 is the architecture.
>> By "implementation" I mean the behavior of the actual machine. It may
>> have behaviors which are not part of the architecture or which are
>> specified by the architecture "undefined" or "unpredictable".
>> The implementation behavior may contain "don't care" states which are
>> not specified or defined by the architecture.
> Right. But a specific implementation will have a deterministic
> behavior with regard to these details. Thus, it is not "undefined".
Often, but not required. For one, minor changes may be made
within an implementation, small enough not to give it a
new number. Sometimes a die shrink is done that way. That may
change some timing that doesn't affect the operations as
defined, but might affect ones that either the architecture
or implementation left undefined.
(snip)
> We in fact must. As Simh does not implement any PDP-11 based on the
> architecture, but instead just tries to simulate a number of existing
> implementations.
As there isn't, as far as I know, a reference architecture
for the PDP-11. Even in system that do have a defined architecture,
they may change it. There are 11 different versions of the IBM
S/370 Principles of Operation, not to mention the many optional
features. Also, implementations of S/370 have optional features,
and so the use of those could be undefined.
As I previously mentioned, S/370 has a "diagnose" instruction,
specifically defined to have undefined properties, including the
reporting of faults in the machine. Some might be documented for
the specific implementation, but not all.
(snip)
>> The point depends on the distinction between "architecture" and
>> "implementation" made above...
> I think you are using the term "architecture" wrong, if you think
> that a PDP-11/73 is an architecture.
Probably. DEC defined an architecture for VAX, I have the book
that says so. If they didn't for the PDP-11, then it isn't so
obvious.
(snip)
> I think you are jumping to wrong conclusions, but I can partly agree
> with you. However, I should also point out (which I've done in other
> posts as well) that I am not looking for such strict simulation. I'm
> also perfectly comfortable with adding an instruction that don't exist
> in any other existing implementation of the PDP-11. But that is my view.
> I use PDP-11s (both real and simulated) as a way to develop software.
> Not to act as a museum, nor as a collector.
(snip)
> Also, I'm not sure I get the "default" reference. Any simulator probably
> have a default machine they will do if you don't specify anything else,
> but if you change the model it should simulate, the "default" should be
> irrelevant. However, different simulators can (and probably will) have
> different bugs. One doing things wrong one way, and the other in another
> way.
(snip)
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 19:13 ` Bill Gunshannon
@ 2012-02-05 13:28 ` Johnny Billquist
2012-02-05 18:15 ` glen herrmannsfeldt
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-05 13:28 UTC (permalink / raw)
On 2012-02-04 20:13, Bill Gunshannon wrote:
> In article<jgjuvq$8am$1@iltempo.update.uu.se>,
> Johnny Billquist<bqt@softjar.se> writes:
>>
>> Good point, and very valid. Speed issues are the hardest to simulate
>> correctly. (And the ones I in general expect will almost never be "fixed".)
>
> Actually, they can be. It's rather easy to slow the system down. Many
> other emulators of old microcomputers do this because many of the games
> relied on the speed of the machine and when sped up 500 times the games
> got rather difficult to play. :-)
Right. You can slow it down. However, at some point this becomes a
problem anyway. If you run your simulator on a host system, you are
subject to the host operating system scheduling. Which means you cannot
have a consistent clock, as with real hardware. Now, how do you solve that?
> But then, the question might be, except for the example above, why would
> anyone want to slow it down?
That is another good question.
> And, no, I don't consider the fact that they run faster than the original
> to be a flaw in the emulation. They are just running as if the original
> was over-clocked.
Right. Actually, I think that Simh can slow the system down to the
actual speed of the real machine, but as mentioned above, that will not
be perfect, and in fact would be rather hard to get perfect on a generic
timesharing system like Unix. Something with realtime behavior might be
able to do it better, but those kind of systems are almost gone
nowadays. You just throw Unix at it, with some semi-realtime extension,
and then instead make sure you have such a fast CPU that you get away
with the system actually not doing realtime at all. And then people can
claim that Unix can do realtime. :-)
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 18:51 ` Johnny Billquist
2012-02-04 23:09 ` glen herrmannsfeldt
@ 2012-02-05 13:57 ` paramucho
2012-02-05 15:44 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-05 13:57 UTC (permalink / raw)
On Sat, 04 Feb 2012 19:51:50 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-04 18.06, paramucho wrote:
>> On Fri, 03 Feb 2012 12:24:15 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>> Excellent. So we are using it the same way.
>>
>> No, we ain't!
>
>Really? You could have fooled me.
It's not hard to fool me. Blinking red and yellow lights will do it.
In the interests of global sanity I've moved all my responses to the
architecture/implementation issue to a response to Glenn's post.
>Also, I'm not sure I get the "default" reference. Any simulator probably
>have a default machine they will do if you don't specify anything else,
>but if you change the model it should simulate, the "default" should be
>irrelevant. However, different simulators can (and probably will) have
>different bugs. One doing things wrong one way, and the other in another
>way.
I have a historic penchant for giving special attention to system
default behavior. I like the idea if that if you just install and "Go"
things will work out well. I think that gives a user time to work out
the details and nuances of more advanced use.
Ideally I'd like to support ever E11/SimH model, but if I can't do
that then I'd like to at least support the default model.
And then its for me: I almost always just use the defaults. I've never
done a SYSGEN in my life for my own purposes (and RUST doesn't have
SYSGEN either--it's all dynamic with DCL commands).
>Unless both produce the correct results for both selected models, I'd
>say both have a bug here.
>
<snip>
>Simh is mostly for small experiments for me.
Likewise. V11 is my workhorse, although I am getting a bit tired of
its limitations.
<snip>
>One good reason why no software use SR1 is that not all machines capable
>of running RSX, RT11, Unix and so on, have SR1 at all. You'd either have
>to write an OS specifically for machines with this feature, or else it
>is not usable. I think DEC just didn't feel motivated for such a
>restricted set of machines, at the time they were still pondering new
>OSes for the PDP-11, and the range of machines that were available back
>then.
Not all machines have I/D separation, but we use that. And I think
that most machines that have I/D also have SR1 functional.
>> On closer inspection I find that I'm not using SR1 for E11 detection
>> tests at all. In fact, my E11 test checks whether bits 5 and 6 of MMU
>> SR0 are writeable. These bits are not writeable on the F11 or J11, but
>> a closer inspection of the 11/34 architecture documents indicates they
>> may well be writeable on a real 11/34, and that's the default E11 CPU.
>> I may have to find a different E11 test (see further below).
>
>Ah. Next question (obviously) is if you tested SR1 in E11 and found it
>failing, or if it actually works right?
I knew it wasn't there in my other tests but I wrote a program to
create an MMU fault to see if it was triggered under that condition.
But it weren't and so I think it just ain't thar.
SR0 SR1 SR2
?MMU2-I-MMU: 100003 27 1014 SimH
?MMU2-I-MMU: 100003 0 1014 E11
<snip>
>> 2. If a boot rom is present at 173000, exit.
>> i
>> I haven't mentioned this sanity test, but it is currently
>> performed and is good emulator test. Most sensible real PDP-11
>> systems that would run RUST would have a boot rom. SimH and E11
>> don't have it. But it's not enough of a test on its own (and I'm
>> not sure about real 11/9x's).
>
>The E11 machines I run have a boot rom, which I believe I mentioned earlier.
I had vague bells ringing in the back of my head about that--but it
was a long post. Emulator boot roms are a rarity I think--you have to
a lot of work to set them up. I am actually very cautious about
releasing this kind of code out into the wilderness, that's why the
boot rom test will stay for a while. Or maybe I just have to used to
the idea of the new test.
And if I might enquire, why do you have boot roms on an emulated
machine?
>Real 11/9x machines also have a boot rom at 173000.
That's what I expected, but the documentation is a bit fuzzy. It talks
about the "B" device [sic] as an "option".
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 23:09 ` glen herrmannsfeldt
@ 2012-02-05 14:01 ` paramucho
2012-02-05 15:31 ` Johnny Billquist
2012-02-05 14:27 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-05 14:01 UTC (permalink / raw)
On Sat, 4 Feb 2012 23:09:41 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:
>In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
>
>(snip)
>>> I'm talking about the architecture:
>
>> But the J11 is not the architecture. It is a specific implementation.
>> Thus, "undefined" does not make sense when we talk about the J11
>> specifically. "Undefined" is only meaningful when we talk about the
>> architecture.
>
>I probably agree, but one might make a case the other way.
>
>> So, you using instructions, or behavior, that you claim are undefined,
>> is to me an illegal use of the word "undefined". As it is only undefined
>> for the architecture. Any implementation will have a defined behavior.
>
>Implementations might also have undefined behavior. If you clock a
>J11 at 500MHz, its behavior is likely undefined. If you run it
>outside any of the specifications, voltage, temperature, clock
>rate, setup and hold times, etc., it is undefined.
>
>Many newer processors (or their support chips) have timing
>based on the contents of registers, such that for some values
>the operation is undefined.
>
>(snip)
>>> You're talking about the implementation:
>
>> Right. And the 11/73 is a specific implementation, not an
>> "architecture". The PDP-11 is the architecture.
>
>>> By "implementation" I mean the behavior of the actual machine. It may
>>> have behaviors which are not part of the architecture or which are
>>> specified by the architecture "undefined" or "unpredictable".
>>> The implementation behavior may contain "don't care" states which are
>>> not specified or defined by the architecture.
>
>> Right. But a specific implementation will have a deterministic
>> behavior with regard to these details. Thus, it is not "undefined".
>
>Often, but not required. For one, minor changes may be made
>within an implementation, small enough not to give it a
>new number. Sometimes a die shrink is done that way. That may
>change some timing that doesn't affect the operations as
>defined, but might affect ones that either the architecture
>or implementation left undefined.
>
>(snip)
>> We in fact must. As Simh does not implement any PDP-11 based on the
>> architecture, but instead just tries to simulate a number of existing
>> implementations.
>
>As there isn't, as far as I know, a reference architecture
>for the PDP-11. Even in system that do have a defined architecture,
>they may change it. There are 11 different versions of the IBM
>S/370 Principles of Operation, not to mention the many optional
>features. Also, implementations of S/370 have optional features,
>and so the use of those could be undefined.
<snip>
>>> The point depends on the distinction between "architecture" and
>>> "implementation" made above...
>
>> I think you are using the term "architecture" wrong, if you think
>> that a PDP-11/73 is an architecture.
>
>Probably. DEC defined an architecture for VAX, I have the book
>that says so. If they didn't for the PDP-11, then it isn't so
>obvious.
We seem to have gotten into a tangle about words here, so I'm going
back to the beginning.
For me, the PDP-11 is not simply an "architecture" but rather a family
of models whose model architectures share features of a common,
evolving base architecture. As Glenn points out, there is no PDP-11
architecture specification as we have for the VAX. Each significant
PDP-11 model is described separately.
It's not possible to characterise differences between the significant
PDP-11 models as "implementation differences". Memory Management was
not part of the original architecture, but we can't call MMU an
"implementation" difference. MMU "extends" the architecture.
Likewise removing odd address traps is more than an implementation
difference: it "alters" the architecture. FIS and FPU aren't
implementation differences, they're architectural differences.
Each significant model includes an architectural specification. The
last of the PDP-11 models, the 11/9x
KDJII-E CPU Module User Guide
http://www.bitsavers.org/pdf/dec/pdp11/1193/
This user guide contains descriptions of the KDJ11-E CPU module
architecture, configuration, system requirements, and programming.
Chapter 1, titled "Architecture" and describes the 11/9x architecture.
A later chapter describes the (common) "base instruction set".
For me, the "implementation" is the hardware expression of an
"architecture". An "implementation" doesn't create, extend or delete
the architecture, it "implements" a written specification.
I guess we're not going to agree on this point, so I offer an
alternative, which I think would cover the points that Glenn (I think)
and I are trying to make, and that is that we instead talk about the
"(written) specification" and the "(hardware) actualization".
In the example above the "KDJII-E CPU Module User Guide" and perhaps
the related XXDP tests constitute the specification. The actual
hardware is the actualization.
The point that I, and I think Glenn, have been trying to make is that
you can't accurately reverse engineer the specification from the
actualization because the actualization may have behaviors which were
left undefined by the specification, either implicitly or explicitly.
Some of those behaviors may be deterministic, some may be
"unpredictable" (the 11/9x programming differences section ends with
an "unpredictable" case).
My interest in undefined behavior is simple: it's the best kind of
behavior to use in identifying emulators because there's less need for
the emulation to slavishly follow the "actualized" behavior in such
cases, giving my detection tests a greater chance of survival in that
jungle out there.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-04 23:09 ` glen herrmannsfeldt
2012-02-05 14:01 ` paramucho
@ 2012-02-05 14:27 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-05 14:27 UTC (permalink / raw)
On 2012-02-05 00:09, glen herrmannsfeldt wrote:
> In vmsnet.pdp-11 Johnny Billquist<bqt@softjar.se> wrote:
>
> (snip)
>>> I'm talking about the architecture:
>
>> But the J11 is not the architecture. It is a specific implementation.
>> Thus, "undefined" does not make sense when we talk about the J11
>> specifically. "Undefined" is only meaningful when we talk about the
>> architecture.
>
> I probably agree, but one might make a case the other way.
>
>> So, you using instructions, or behavior, that you claim are undefined,
>> is to me an illegal use of the word "undefined". As it is only undefined
>> for the architecture. Any implementation will have a defined behavior.
>
> Implementations might also have undefined behavior. If you clock a
> J11 at 500MHz, its behavior is likely undefined. If you run it
> outside any of the specifications, voltage, temperature, clock
> rate, setup and hold times, etc., it is undefined.
Gha! Yes, if you put 500 volts on the CPU, the behavior is undefined. :-)
> Many newer processors (or their support chips) have timing
> based on the contents of registers, such that for some values
> the operation is undefined.
True. If you go outside of the specifications, then behavior becomes
undefined. But at that point, it generally also becomes useless, since
normal operation in general cease to be.
>>> By "implementation" I mean the behavior of the actual machine. It may
>>> have behaviors which are not part of the architecture or which are
>>> specified by the architecture "undefined" or "unpredictable".
>>> The implementation behavior may contain "don't care" states which are
>>> not specified or defined by the architecture.
>
>> Right. But a specific implementation will have a deterministic
>> behavior with regard to these details. Thus, it is not "undefined".
>
> Often, but not required. For one, minor changes may be made
> within an implementation, small enough not to give it a
> new number. Sometimes a die shrink is done that way. That may
> change some timing that doesn't affect the operations as
> defined, but might affect ones that either the architecture
> or implementation left undefined.
Hmm. Good point. There is such a case for the J11 in fact. Early models
can't go as high in frequency, and the FPA is not possible to use. Not
sure if it has any user-visible effects, though.
Another one is (for some machines), microcode updates. The most known
(to me) being the VAX-11/750, which have some bugs in the microcode,
which VMS, Ultrix and NetBSD all patch at boot time. That is definitely
some user-visible change to the CPU by patching the microcode.
However, I believe this is more of fixing bugs rather than doing
something undefined in different ways. And of course, a true simulation
should handle it the same way as the real machine.
>> We in fact must. As Simh does not implement any PDP-11 based on the
>> architecture, but instead just tries to simulate a number of existing
>> implementations.
>
> As there isn't, as far as I know, a reference architecture
> for the PDP-11. Even in system that do have a defined architecture,
> they may change it. There are 11 different versions of the IBM
> S/370 Principles of Operation, not to mention the many optional
> features. Also, implementations of S/370 have optional features,
> and so the use of those could be undefined.
I believe that the processor handbooks are the architecture reference
for the PDP-11.
> As I previously mentioned, S/370 has a "diagnose" instruction,
> specifically defined to have undefined properties, including the
> reporting of faults in the machine. Some might be documented for
> the specific implementation, but not all.
Some PDP-11 models also have diagnose instructions that are very
specific to the model. It is very undefined for the architecture, but
for a specific model, it is very defined.
>>> The point depends on the distinction between "architecture" and
>>> "implementation" made above...
>
>> I think you are using the term "architecture" wrong, if you think
>> that a PDP-11/73 is an architecture.
>
> Probably. DEC defined an architecture for VAX, I have the book
> that says so. If they didn't for the PDP-11, then it isn't so
> obvious.
For the VAX, DEC produced the very obviously named VARM (VAX
Architecture Reference Manual), which outlines the architecture. For the
PDP-11 I know of no such named manual with the same status. I believe
that the processor handbooks in general fulfill that role. I don't know
of any of them giving contradictory information, but later ones have
extensions that didn't exist when the earlier were printed.
Some of the last ones also have tables describing the differences in
actual implementations, which goes beyond the architecture, which just
says it's undefined.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-05 14:01 ` paramucho
@ 2012-02-05 15:31 ` Johnny Billquist
2012-02-06 13:50 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-05 15:31 UTC (permalink / raw)
On 2012-02-05 15:01, paramucho wrote:
>
> We seem to have gotten into a tangle about words here, so I'm going
> back to the beginning.
>
> For me, the PDP-11 is not simply an "architecture" but rather a family
> of models whose model architectures share features of a common,
> evolving base architecture. As Glenn points out, there is no PDP-11
> architecture specification as we have for the VAX. Each significant
> PDP-11 model is described separately.
Of course I disagree. That is what the PDP-11 processor manuals are.
Take the PDP-11 Processor Handbook from 1979 for example
(http://www.bitsavers.org/pdf/dec/pdp11/handbooks/PDP11_Handbook1979.pdf)
It covers the PDP-11/04/34a/44/60/70.
Those are all significant models.
But you have one handbook which describes the PDP-11. And then you have
separate chapters in that book which covers specific differences of that
implementation compared to the basic PDP-11 architecture.
> It's not possible to characterise differences between the significant
> PDP-11 models as "implementation differences". Memory Management was
> not part of the original architecture, but we can't call MMU an
> "implementation" difference. MMU "extends" the architecture.
Yes, I'd agree it extends the basic architecture. Just as EIS does.
> Likewise removing odd address traps is more than an implementation
> difference: it "alters" the architecture. FIS and FPU aren't
> implementation differences, they're architectural differences.
Not having odd address traps is something I consider a deviation from
the architecture, not a new architecture.
And for floating points, they are two different options. Two different
extensions. They extend the architecture in two different ways. I don't
consider them to be something that defines a new architecture.
> Each significant model includes an architectural specification. The
> last of the PDP-11 models, the 11/9x
>
> KDJII-E CPU Module User Guide
> http://www.bitsavers.org/pdf/dec/pdp11/1193/
>
> This user guide contains descriptions of the KDJ11-E CPU module
> architecture, configuration, system requirements, and programming.
The architecture for that module. Yes, it is a different use of the word
"architecture". You also have a processor handbook for the J11, which is
not specific for the 11/53/73/83/84/93/94.
Would you call the J11 a different architecture than the PDP-11/93?
> Chapter 1, titled "Architecture" and describes the 11/9x architecture.
> A later chapter describes the (common) "base instruction set".
>
> For me, the "implementation" is the hardware expression of an
> "architecture". An "implementation" doesn't create, extend or delete
> the architecture, it "implements" a written specification.
The implementation of an architecture very well can have differences
from the architecture itself. This is easier to exemplify with the VAX,
where you have the VARM. There is not a single VAX that implements VARM
100%. They all have deviations, extensions, deletions, and whatnot. But
they still follow the VARM as much as possible, and deviate within
acceptable limits to still pass the definition as being a VAX.
VARM formally acknowledge this and lists instructions and features that
are "mandatory" and others that are "optional" in different subgroups.
I don't see the PDP-11 to be any different. There are PDP-11s without
EIS, and there are those with. There are those without MMU, and those
with. The ones with still have a few different variations. But within
those variants, there are certain things they are required to handle to
be said to follow the architecture. An implementation that follows those
requirements can be expected to be able to run PDP-11 software that make
use of it.
But even after all this, there are implementation differences.
Differences that mostly are irrelevant and not affecting anything, but
which in the architecture are undefined. However, each implementation
will have a defined behavior.
> I guess we're not going to agree on this point, so I offer an
> alternative, which I think would cover the points that Glenn (I think)
> and I are trying to make, and that is that we instead talk about the
> "(written) specification" and the "(hardware) actualization".
>
> In the example above the "KDJII-E CPU Module User Guide" and perhaps
> the related XXDP tests constitute the specification. The actual
> hardware is the actualization.
I think that is backwards. I believe the XXDP tests are written to test
what they know, not what they expected. Ie. XXDP tests were not written
in advance, to test what they had designed on paper, but written after
the hardware existed, to test what they actually had. As such, XXDP is a
poor source for any specification. But a good test for actual machines,
within the limits of what they test.
The KDJ11-E Module User Guide is also not a specification. It's a manual
created from the sources of design docs, drawings and other sources. As
such, it is a manual produced to accompany the module to the customer,
and was not at any stage a source for the actual implementation of the
module.
> The point that I, and I think Glenn, have been trying to make is that
> you can't accurately reverse engineer the specification from the
> actualization because the actualization may have behaviors which were
> left undefined by the specification, either implicitly or explicitly.
Of course you can not reverse engineer the specification from the
implementation. There is actually nothing that guarantees that the
implementation actually fulfills the specification.
What you can do is test the implementation to see what the actual
behavior is, and if you want to simulate that machine, this is the final
source of truth, no matter what a specification says.
> Some of those behaviors may be deterministic, some may be
> "unpredictable" (the 11/9x programming differences section ends with
> an "unpredictable" case).
I know that I've seen a table on differences between different
implementations, but I can't find it in the KDJ11-E manual. So I can't
check that right now. I know it's the the PDP11 Microprocessor Handbook,
which covers the J11, but unfortunately my hard copy is far from me, and
I can't find that handbook on bitsavers. :-(
> My interest in undefined behavior is simple: it's the best kind of
> behavior to use in identifying emulators because there's less need for
> the emulation to slavishly follow the "actualized" behavior in such
> cases, giving my detection tests a greater chance of survival in that
> jungle out there.
I think I understand what your interest is. My point being that if you
take a real physical PDP-11/93, and you run tests on it, you will get
one behavior. Anyone who implements a simulation of a PDP-11/93 should
give the same results. That is what I've been saying the whole time, and
I don't understand why you seem to claim that this would be wrong by the
simulation.
I claim that if a simulation of an 11/93 does not produce the same
results, then it's a bug in the simulation, and one that (probably)
should go away.
That's all I have to say on the topic.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-05 13:57 ` paramucho
@ 2012-02-05 15:44 ` Johnny Billquist
2012-02-06 13:51 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-05 15:44 UTC (permalink / raw)
On 2012-02-05 14:57, paramucho wrote:
> On Sat, 04 Feb 2012 19:51:50 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-04 18.06, paramucho wrote:
>>> On Fri, 03 Feb 2012 12:24:15 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>
>>>> Excellent. So we are using it the same way.
>>>
>>> No, we ain't!
>>
>> Really? You could have fooled me.
>
> It's not hard to fool me. Blinking red and yellow lights will do it.
:-)
> In the interests of global sanity I've moved all my responses to the
> architecture/implementation issue to a response to Glenn's post.
I've responded there.
>> Also, I'm not sure I get the "default" reference. Any simulator probably
>> have a default machine they will do if you don't specify anything else,
>> but if you change the model it should simulate, the "default" should be
>> irrelevant. However, different simulators can (and probably will) have
>> different bugs. One doing things wrong one way, and the other in another
>> way.
>
> I have a historic penchant for giving special attention to system
> default behavior. I like the idea if that if you just install and "Go"
> things will work out well. I think that gives a user time to work out
> the details and nuances of more advanced use.
>
> Ideally I'd like to support ever E11/SimH model, but if I can't do
> that then I'd like to at least support the default model.
E11/Simh models are just the various PDP-11 models. I don't think their
intent or purpose was/is to implement their "own" model. That is an
accident/bug, which is what I'm trying to say.
The problems with the differences are, however, at this point so low
that "normal" software works, which lessens the incitement to fix
remaining differences.
> And then its for me: I almost always just use the defaults. I've never
> done a SYSGEN in my life for my own purposes (and RUST doesn't have
> SYSGEN either--it's all dynamic with DCL commands).
SYSGEN as in the PDP-11 environment? Gah. I've long since lost count of
the number of times I've run the RSX-11M and RSX-11M-PLUS SYSGEN.
And doing RSX-11M SYSGEN on a PDP-11/34 with RM02 takes about 3 hours.
Each time.
>> One good reason why no software use SR1 is that not all machines capable
>> of running RSX, RT11, Unix and so on, have SR1 at all. You'd either have
>> to write an OS specifically for machines with this feature, or else it
>> is not usable. I think DEC just didn't feel motivated for such a
>> restricted set of machines, at the time they were still pondering new
>> OSes for the PDP-11, and the range of machines that were available back
>> then.
>
> Not all machines have I/D separation, but we use that. And I think
> that most machines that have I/D also have SR1 functional.
M+ can use I/D separation if you want. But you need to SYSGEN for it.
The baseline system that boots up initially does not use it, in case you
are booting the system on a machine that does not have it.
RSX-11M cannot ever use it.
>>> On closer inspection I find that I'm not using SR1 for E11 detection
>>> tests at all. In fact, my E11 test checks whether bits 5 and 6 of MMU
>>> SR0 are writeable. These bits are not writeable on the F11 or J11, but
>>> a closer inspection of the 11/34 architecture documents indicates they
>>> may well be writeable on a real 11/34, and that's the default E11 CPU.
>>> I may have to find a different E11 test (see further below).
>>
>> Ah. Next question (obviously) is if you tested SR1 in E11 and found it
>> failing, or if it actually works right?
>
> I knew it wasn't there in my other tests but I wrote a program to
> create an MMU fault to see if it was triggered under that condition.
> But it weren't and so I think it just ain't thar.
>
> SR0 SR1 SR2
> ?MMU2-I-MMU: 100003 27 1014 SimH
> ?MMU2-I-MMU: 100003 0 1014 E11
Obvious follow up questions:
State of the machine before and after the trap? (Ie. relevant processor
registers)
E11 could do it the way I suggested. It would not be a true simulation
of the CPU, but a valid result. But I really don't know for sure at this
point, so I'm asking.
>>> 2. If a boot rom is present at 173000, exit.
>>> i
>>> I haven't mentioned this sanity test, but it is currently
>>> performed and is good emulator test. Most sensible real PDP-11
>>> systems that would run RUST would have a boot rom. SimH and E11
>>> don't have it. But it's not enough of a test on its own (and I'm
>>> not sure about real 11/9x's).
>>
>> The E11 machines I run have a boot rom, which I believe I mentioned earlier.
>
> I had vague bells ringing in the back of my head about that--but it
> was a long post. Emulator boot roms are a rarity I think--you have to
> a lot of work to set them up. I am actually very cautious about
> releasing this kind of code out into the wilderness, that's why the
> boot rom test will stay for a while. Or maybe I just have to used to
> the idea of the new test.
It was basically no work to set them up. The customer have implemented
some additions in RSX, which detects some conditions under which the
system have ceased working right, and does a reboot by jumping to
173000. Thus, we needed the boot roms.
> And if I might enquire, why do you have boot roms on an emulated
> machine?
As mentioned above.
>> Real 11/9x machines also have a boot rom at 173000.
>
> That's what I expected, but the documentation is a bit fuzzy. It talks
> about the "B" device [sic] as an "option".
Heh. Yeah, that is a trick. It disables the CPU module boot rom from
responding, and thus can instead access 173000 from the bus.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-05 13:28 ` Johnny Billquist
@ 2012-02-05 18:15 ` glen herrmannsfeldt
0 siblings, 0 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-05 18:15 UTC (permalink / raw)
In vmsnet.pdp-11 Johnny Billquist <bqt@softjar.se> wrote:
(snip on emulation speed)
> Right. You can slow it down. However, at some point this becomes a
> problem anyway. If you run your simulator on a host system, you are
> subject to the host operating system scheduling. Which means you cannot
> have a consistent clock, as with real hardware. Now, how do you solve that?
Well, the other way, which hasn't been discussed much here,
is hardware emulation, usually in an FPGA. There are cycle-accurate
HDL cores for popular microprocessors. One can choose to clock them
at an appropriate slow rate, or not. One can supply the appropriate
external clock sources, such as a power line frequency clock, or,
popular on some systems, CRT synchronization pulse clock.
(For early IBM PC's, one updated the display memory during the
vertical retrace to avoid snow on the screen.)
>> But then, the question might be, except for the example above, why would
>> anyone want to slow it down?
> That is another good question.
For game programs, it is probably necessary, otherwise usually not.
>> And, no, I don't consider the fact that they run faster than the original
>> to be a flaw in the emulation. They are just running as if the original
>> was over-clocked.
As previously mentioned, some OS won't run on an especially fast
machine. Some use timing loops that fail when the processor
is too fast.
> Right. Actually, I think that Simh can slow the system down to the
> actual speed of the real machine, but as mentioned above, that will not
> be perfect, and in fact would be rather hard to get perfect on a generic
> timesharing system like Unix. Something with realtime behavior might be
> able to do it better, but those kind of systems are almost gone
> nowadays. You just throw Unix at it, with some semi-realtime extension,
> and then instead make sure you have such a fast CPU that you get away
> with the system actually not doing realtime at all. And then people can
> claim that Unix can do realtime. :-)
I believe for Hercules, there are some tricks, such as running it
slow in the beginning, when the OS does some tests, then fast.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-05 15:31 ` Johnny Billquist
@ 2012-02-06 13:50 ` paramucho
2012-02-06 14:45 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-06 13:50 UTC (permalink / raw)
On Sun, 05 Feb 2012 16:31:03 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-05 15:01, paramucho wrote:
>>
>> We seem to have gotten into a tangle about words here, so I'm going
<snip>
> I guess we're not going to agree on this point, so I offer an
<snip>
>> The point that I, and I think Glenn, have been trying to make is that
>> you can't accurately reverse engineer the specification from the
>> actualization because the actualization may have behaviors which were
>> left undefined by the specification, either implicitly or explicitly.
>
>Of course you can not reverse engineer the specification from the
>implementation. There is actually nothing that guarantees that the
>implementation actually fulfills the specification.
>What you can do is test the implementation to see what the actual
>behavior is, and if you want to simulate that machine, this is the final
>source of truth, no matter what a specification says.
Yes, but *I'm* interested in the distinction between specified and
unspecified behaviors.
>> Some of those behaviors may be deterministic, some may be
>> "unpredictable" (the 11/9x programming differences section ends with
>> an "unpredictable" case).
>
>I know that I've seen a table on differences between different
>implementations, but I can't find it in the KDJ11-E manual. So I can't
>check that right now. I know it's the the PDP11 Microprocessor Handbook,
>which covers the J11, but unfortunately my hard copy is far from me, and
>I can't find that handbook on bitsavers. :-(
The 11/73 list is here:
http://www.bitsavers.org/pdf/dec/pdp11/1173/KDJ11-A_UsersManual.pdf
See appendix D of the 11/94 document for probably the last difference
list. It's more extensive, but harder to read.
http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
>> My interest in undefined behavior is simple: it's the best kind of
>> behavior to use in identifying emulators because there's less need for
>> the emulation to slavishly follow the "actualized" behavior in such
>> cases, giving my detection tests a greater chance of survival in that
>> jungle out there.
>
>I think I understand what your interest is. My point being that if you
>take a real physical PDP-11/93, and you run tests on it, you will get
>one behavior. Anyone who implements a simulation of a PDP-11/93 should
>give the same results. That is what I've been saying the whole time, and
>I don't understand why you seem to claim that this would be wrong by the
>simulation.
>I claim that if a simulation of an 11/93 does not produce the same
>results, then it's a bug in the simulation, and one that (probably)
>should go away.
That's a good summation of your view. From my where I stand your
position seems to describe a ideal world in which every difference
will be diligently found and corrected. I don't think that's the case
in the real world. Supnik's point is that the emulation is not exact:
The model emulation in SimH is not perfect, which is why clever
software can detect it.
There are limits to the exactness of an emulation. Perfection is not
the end goal. There are more important tasks.
For me it's a case of looking at the real world. I see different kinds
of categories of behavior. Timing, as discussed, is clearly a low
probability for correction. Next up is unspecified behavior, as
discussed. The highest probability of correction is architecturally
defined behavior. My best shot is to multiply probabilities by running
multiple tests and to use tests with the lowest probability of
correction.
And further, as time goes by the probability of corrections
diminishes. At some time in the future I hope to be able to rely on
the tests. At present they're largely exploratory. To quote the RT-11
sources (quoting Kerouac): "walking on water wasn't built in a day"
>That's all I have to say on the topic.
Thank goodness for that. I'm exhausted.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-05 15:44 ` Johnny Billquist
@ 2012-02-06 13:51 ` paramucho
2012-02-06 14:56 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-06 13:51 UTC (permalink / raw)
On Sun, 05 Feb 2012 16:44:43 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>>>> On closer inspection I find that I'm not using SR1 for E11 detection
>>>> tests at all. In fact, my E11 test checks whether bits 5 and 6 of MMU
>>>> SR0 are writeable. These bits are not writeable on the F11 or J11, but
>>>> a closer inspection of the 11/34 architecture documents indicates they
>>>> may well be writeable on a real 11/34, and that's the default E11 CPU.
>>>> I may have to find a different E11 test (see further below).
>>>
>>> Ah. Next question (obviously) is if you tested SR1 in E11 and found it
>>> failing, or if it actually works right?
>>
>> I knew it wasn't there in my other tests but I wrote a program to
>> create an MMU fault to see if it was triggered under that condition.
>> But it weren't and so I think it just ain't thar.
>>
>> SR0 SR1 SR2
>> ?MMU2-I-MMU: 100003 27 1014 SimH
>> ?MMU2-I-MMU: 100003 0 1014 E11
>
>Obvious follow up questions:
>State of the machine before and after the trap? (Ie. relevant processor
>registers)
>E11 could do it the way I suggested. It would not be a true simulation
>of the CPU, but a valid result. But I really don't know for sure at this
>point, so I'm asking.
I now understand what you meant when you wrote:
I can see that it might be costly to maintain it, but on the other
hand, if trappings never will occur with registers updated that
needs rollback, SR1 can be left zero at all times.
So it might actually be that E11 already does it "right".
And yes, preliminary testing says that you're correct. Rather than
providing the SR1 backout (rollback) information, E11 does the backout
itself, obviating the need for SR1 information.
This explains four things, perhaps:
1. The release note: "MMU. SR1 mechanized".
2. The otherwise cryptic command definition for SET FPBACKOUT (which
I'd noted, but not followed up):
FPBACKOUT J-11 SR1 behavior, autoinc/dec is always undone on
aborted FPP instruction.
I'm not sure how this is supposed to work in the real world.
3. And (now) looking further I note the command SET CPU [NO]SR1. I
tried it out, but it seems to do nothing. Later.
4. Why John once stated that the relevant XXDP diagnostic will fail.
However, I can no longer find the reference.
It seems that E11 also implements this auto-backout for the (default)
11/34 model. However, the 11/34 model itself doesn't implement SR1, so
that's another difference I can check.
What I don't understand is this: if John has the rollback information,
in whatever form, why doesn't he interpret it and apply it to SR1 when
there's an MMU fault. An MMU fault is a relatively rare CPU event,
like any interrupt, and thus doing fixups after an MMU fault is not
going to significantly impact speed performance. Perhaps we should ask
John :-) I haven't seen him here for a long time.
The real problem is apparent: because no software (apart from tests)
uses the software, the mechanism hasn't been tested. I think debuggers
would have to be rewritten to use this technique. Indeed, I think this
particular difference would force code which uses SR1 to be able to
detect E11.
In any case, it is an architectural difference.
I was going to write a more detailed test, which would exercise SimH
as well as E11, but that's going to have to wait. I lost the night
trying to get my 11/73 to work, but the pseudo-RL02 disk seems to have
finally died on me (after decades of neglect). So I took out the quad
11/23 card out of the BA11 tower that is working and put the dual
11/73 along with a DLV11J but now the damn thing acts as if HALT is
asserted. I really don't like hardware. I have boxes of cables, cards
and connectors everywhere.
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-06 13:50 ` paramucho
@ 2012-02-06 14:45 ` Johnny Billquist
2012-02-06 14:58 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-06 14:45 UTC (permalink / raw)
On 2012-02-06 14.50, paramucho wrote:
> On Sun, 05 Feb 2012 16:31:03 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-05 15:01, paramucho wrote:
>>>
>>> The point that I, and I think Glenn, have been trying to make is that
>>> you can't accurately reverse engineer the specification from the
>>> actualization because the actualization may have behaviors which were
>>> left undefined by the specification, either implicitly or explicitly.
>>
>> Of course you can not reverse engineer the specification from the
>> implementation. There is actually nothing that guarantees that the
>> implementation actually fulfills the specification.
>> What you can do is test the implementation to see what the actual
>> behavior is, and if you want to simulate that machine, this is the final
>> source of truth, no matter what a specification says.
>
> Yes, but *I'm* interested in the distinction between specified and
> unspecified behaviors.
Why? That is just a paper product?
>>> Some of those behaviors may be deterministic, some may be
>>> "unpredictable" (the 11/9x programming differences section ends with
>>> an "unpredictable" case).
>>
>> I know that I've seen a table on differences between different
>> implementations, but I can't find it in the KDJ11-E manual. So I can't
>> check that right now. I know it's the the PDP11 Microprocessor Handbook,
>> which covers the J11, but unfortunately my hard copy is far from me, and
>> I can't find that handbook on bitsavers. :-(
>
> The 11/73 list is here:
>
> http://www.bitsavers.org/pdf/dec/pdp11/1173/KDJ11-A_UsersManual.pdf
>
> See appendix D of the 11/94 document for probably the last difference
> list. It's more extensive, but harder to read.
>
> http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
Ah! Thanks. It is the same document/list as in the PDP11 Microprocessor
Handbook. Now I can at least look at it.
But I cannot find the the 11/9x programming differences section with an
"unpredictable case". What are you referring to?
>>> My interest in undefined behavior is simple: it's the best kind of
>>> behavior to use in identifying emulators because there's less need for
>>> the emulation to slavishly follow the "actualized" behavior in such
>>> cases, giving my detection tests a greater chance of survival in that
>>> jungle out there.
>>
>> I think I understand what your interest is. My point being that if you
>> take a real physical PDP-11/93, and you run tests on it, you will get
>> one behavior. Anyone who implements a simulation of a PDP-11/93 should
>> give the same results. That is what I've been saying the whole time, and
>> I don't understand why you seem to claim that this would be wrong by the
>> simulation.
>> I claim that if a simulation of an 11/93 does not produce the same
>> results, then it's a bug in the simulation, and one that (probably)
>> should go away.
>
> That's a good summation of your view. From my where I stand your
> position seems to describe a ideal world in which every difference
> will be diligently found and corrected. I don't think that's the case
> in the real world. Supnik's point is that the emulation is not exact:
>
> The model emulation in SimH is not perfect, which is why clever
> software can detect it.
Of course it is not exact. That would be equivalent to saying that there
are no bugs in your program. I doubt even you would dare say that about
anything you've written that is a bit complex.
But that is not the same as claiming it will keep behavior around which
is incompatible with the system it claims to be simulating.
> There are limits to the exactness of an emulation. Perfection is not
> the end goal. There are more important tasks.
I think it's a bit much to claim the end goal of someone elses project.
But I seem to remember Bob saying that the goal of Simh is to simulate
existing systems as much as possible.
> For me it's a case of looking at the real world. I see different kinds
> of categories of behavior. Timing, as discussed, is clearly a low
> probability for correction. Next up is unspecified behavior, as
> discussed. The highest probability of correction is architecturally
> defined behavior. My best shot is to multiply probabilities by running
> multiple tests and to use tests with the lowest probability of
> correction.
"Unspecified behavior" is irrelevant. Simh has not been implemented
according to some paper document, with the goal only to fulfill that
specification. Simh tries to simulate existing specific implementations,
as far as possible.
Whatever a design document says is not what (as far as I understand)
Simh cares about, tries to implement, or use as a reference.
it's the actual machine that is the reference. Including all bugs and
erratic behavior of that model.
>> That's all I have to say on the topic.
>
> Thank goodness for that. I'm exhausted.
Sorry for filling in some more on this thread, then. But I'm basically
just reiterating what I've said. Except for the curious question about
the documentation you mention, that I can't find.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-06 13:51 ` paramucho
@ 2012-02-06 14:56 ` Johnny Billquist
2012-02-06 16:40 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-06 14:56 UTC (permalink / raw)
On 2012-02-06 14.51, paramucho wrote:
> On Sun, 05 Feb 2012 16:44:43 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
>>>>> On closer inspection I find that I'm not using SR1 for E11 detection
>>>>> tests at all. In fact, my E11 test checks whether bits 5 and 6 of MMU
>>>>> SR0 are writeable. These bits are not writeable on the F11 or J11, but
>>>>> a closer inspection of the 11/34 architecture documents indicates they
>>>>> may well be writeable on a real 11/34, and that's the default E11 CPU.
>>>>> I may have to find a different E11 test (see further below).
>>>>
>>>> Ah. Next question (obviously) is if you tested SR1 in E11 and found it
>>>> failing, or if it actually works right?
>>>
>>> I knew it wasn't there in my other tests but I wrote a program to
>>> create an MMU fault to see if it was triggered under that condition.
>>> But it weren't and so I think it just ain't thar.
>>>
>>> SR0 SR1 SR2
>>> ?MMU2-I-MMU: 100003 27 1014 SimH
>>> ?MMU2-I-MMU: 100003 0 1014 E11
>>
>> Obvious follow up questions:
>> State of the machine before and after the trap? (Ie. relevant processor
>> registers)
>> E11 could do it the way I suggested. It would not be a true simulation
>> of the CPU, but a valid result. But I really don't know for sure at this
>> point, so I'm asking.
>
> I now understand what you meant when you wrote:
>
> I can see that it might be costly to maintain it, but on the other
> hand, if trappings never will occur with registers updated that
> needs rollback, SR1 can be left zero at all times.
> So it might actually be that E11 already does it "right".
>
> And yes, preliminary testing says that you're correct. Rather than
> providing the SR1 backout (rollback) information, E11 does the backout
> itself, obviating the need for SR1 information.
Ok. So it fails in truthfully simulate the machine it claims to
simulate, but it does fulfill the architecture design.
Since I think E11 have had less qualms about being absolutely truthful
in its simulation, I suspect this might stay around. I think Simh have
had a more strict view on this.
> This explains four things, perhaps:
>
> 1. The release note: "MMU. SR1 mechanized".
Right.
> 2. The otherwise cryptic command definition for SET FPBACKOUT (which
> I'd noted, but not followed up):
>
> FPBACKOUT J-11 SR1 behavior, autoinc/dec is always undone on
> aborted FPP instruction.
>
> I'm not sure how this is supposed to work in the real world.
Not sure what that command in E11 do. However, if the changes are backed
out also on FP instructions, then SR1 will still remain zero at all times.
> 3. And (now) looking further I note the command SET CPU [NO]SR1. I
> tried it out, but it seems to do nothing. Later.
No idea about that one. Maybe something in combination with the FPBACKOUT?
> 4. Why John once stated that the relevant XXDP diagnostic will fail.
> However, I can no longer find the reference.
I would seem logical that XXDP would fail if it checks this, yes.
> It seems that E11 also implements this auto-backout for the (default)
> 11/34 model. However, the 11/34 model itself doesn't implement SR1, so
> that's another difference I can check.
Indeed. Somewhat expected that the backout would happen on other CPU
emulations as well, unless he explicitly "fixed" it for certain models.
But I don't think that would be meaningful. So SR1 existing/working or
not is a partly separate question from the backing out on failure.
> What I don't understand is this: if John has the rollback information,
> in whatever form, why doesn't he interpret it and apply it to SR1 when
> there's an MMU fault. An MMU fault is a relatively rare CPU event,
> like any interrupt, and thus doing fixups after an MMU fault is not
> going to significantly impact speed performance. Perhaps we should ask
> John :-) I haven't seen him here for a long time.
Good question. I suspect that could be done.
> The real problem is apparent: because no software (apart from tests)
> uses the software, the mechanism hasn't been tested. I think debuggers
> would have to be rewritten to use this technique. Indeed, I think this
> particular difference would force code which uses SR1 to be able to
> detect E11.
Debuggers? If you have an OS that does page faulting it would need to do
this as well. But yes, debuggers could possibly also use this
information, although I don't think any do today. I think the debugger I
normally use will tell me the contents of SR1 on a memory fault trap,
but will not act upon that information in any way.
> In any case, it is an architectural difference.
Implementation difference. :-)
Architectural, the SR1 is only used to do backouts of register
modifications on partially executed instructions. E11's way fulfills the
architecture just fine, even though it's different than J11. The same
code will do the right thing executing on either processor, without any
changes.
> I was going to write a more detailed test, which would exercise SimH
> as well as E11, but that's going to have to wait. I lost the night
> trying to get my 11/73 to work, but the pseudo-RL02 disk seems to have
> finally died on me (after decades of neglect). So I took out the quad
> 11/23 card out of the BA11 tower that is working and put the dual
> 11/73 along with a DLV11J but now the damn thing acts as if HALT is
> asserted. I really don't like hardware. I have boxes of cables, cards
> and connectors everywhere.
Ouch! :-(
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-06 14:45 ` Johnny Billquist
@ 2012-02-06 14:58 ` paramucho
2012-02-06 16:25 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-06 14:58 UTC (permalink / raw)
On Mon, 06 Feb 2012 15:45:13 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-06 14.50, paramucho wrote:
<snip>
>>>> Some of those behaviors may be deterministic, some may be
>>>> "unpredictable" (the 11/9x programming differences section ends with
>>>> an "unpredictable" case).
>>>
>>> I know that I've seen a table on differences between different
>>> implementations, but I can't find it in the KDJ11-E manual. So I can't
>>> check that right now. I know it's the the PDP11 Microprocessor Handbook,
>>> which covers the J11, but unfortunately my hard copy is far from me, and
>>> I can't find that handbook on bitsavers. :-(
>>
>> The 11/73 list is here:
>>
>> http://www.bitsavers.org/pdf/dec/pdp11/1173/KDJ11-A_UsersManual.pdf
>>
>> See appendix D of the 11/94 document for probably the last difference
>> list. It's more extensive, but harder to read.
>>
>> http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
>
>Ah! Thanks. It is the same document/list as in the PDP11 Microprocessor
>Handbook. Now I can at least look at it.
>
>But I cannot find the the 11/9x programming differences section with an
>"unpredictable case". What are you referring to?
Item 52. Page D-15.
<snip>
>>> That's all I have to say on the topic.
>>
>> Thank goodness for that. I'm exhausted.
>
>Sorry for filling in some more on this thread, then. But I'm basically
>just reiterating what I've said. Except for the curious question about
>the documentation you mention, that I can't find.
I knew you wouldn't be able to stop yourself! :-)
I enjoyed the thread--and I may not have come up with that neat
terminal timing loop without it.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-06 14:58 ` paramucho
@ 2012-02-06 16:25 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-06 16:25 UTC (permalink / raw)
On 2012-02-06 15.58, paramucho wrote:
> On Mon, 06 Feb 2012 15:45:13 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-06 14.50, paramucho wrote:
> <snip>
>
>>>>> Some of those behaviors may be deterministic, some may be
>>>>> "unpredictable" (the 11/9x programming differences section ends with
>>>>> an "unpredictable" case).
>>>>
>>>> I know that I've seen a table on differences between different
>>>> implementations, but I can't find it in the KDJ11-E manual. So I can't
>>>> check that right now. I know it's the the PDP11 Microprocessor Handbook,
>>>> which covers the J11, but unfortunately my hard copy is far from me, and
>>>> I can't find that handbook on bitsavers. :-(
>>>
>>> The 11/73 list is here:
>>>
>>> http://www.bitsavers.org/pdf/dec/pdp11/1173/KDJ11-A_UsersManual.pdf
>>>
>>> See appendix D of the 11/94 document for probably the last difference
>>> list. It's more extensive, but harder to read.
>>>
>>> http://www.bitsavers.org/pdf/dec/pdp11/1194/EK-PDP94-MG-001_Sep90.pdf
>>
>> Ah! Thanks. It is the same document/list as in the PDP11 Microprocessor
>> Handbook. Now I can at least look at it.
>>
>> But I cannot find the the 11/9x programming differences section with an
>> "unpredictable case". What are you referring to?
>
> Item 52. Page D-15.
Ah. I misunderstood you. I thought you meant the last item, not the last
page. And that it was something undefined for the J11.
There are several unpredictable items in that list, by the way. But that
don't mean that you cannot predict them, just that they don't care to go
into that detail in that list. It might very well be rather complex to
predict, and different for every model.
>>>> That's all I have to say on the topic.
>>>
>>> Thank goodness for that. I'm exhausted.
>>
>> Sorry for filling in some more on this thread, then. But I'm basically
>> just reiterating what I've said. Except for the curious question about
>> the documentation you mention, that I can't find.
>
> I knew you wouldn't be able to stop yourself! :-)
:-)
> I enjoyed the thread--and I may not have come up with that neat
> terminal timing loop without it.
Always something positive.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-06 14:56 ` Johnny Billquist
@ 2012-02-06 16:40 ` Johnny Billquist
2012-02-07 14:50 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-06 16:40 UTC (permalink / raw)
On 2012-02-06 15.56, Johnny Billquist wrote:
> On 2012-02-06 14.51, paramucho wrote:
>>
>> This explains four things, perhaps:
>>
>> 1. The release note: "MMU. SR1 mechanized".
>
> Right.
>
>> 2. The otherwise cryptic command definition for SET FPBACKOUT (which
>> I'd noted, but not followed up):
>>
>> FPBACKOUT J-11 SR1 behavior, autoinc/dec is always undone on
>> aborted FPP instruction.
>>
>> I'm not sure how this is supposed to work in the real world.
>
> Not sure what that command in E11 do. However, if the changes are backed
> out also on FP instructions, then SR1 will still remain zero at all times.
>
>> 3. And (now) looking further I note the command SET CPU [NO]SR1. I
>> tried it out, but it seems to do nothing. Later.
>
> No idea about that one. Maybe something in combination with the FPBACKOUT?
Thinking about it, I would possibly have expected this to make SR1 not
even exist.
E11 in general (if I remember right) will just set a whole bunch of
parameters in a predefined way when you say you want a specific model
emulated. You can get the same result (I think), by just setting all the
individual features yourself as well. And some machines don't have an
SR1, so I would have thought this feature would mean just that.
If you do a SET CPU NOSR1 just before booting, can you still access SR1?
By the way, have you tried playing with UNDOAUTO as well?
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-03 15:36 ` Joe Oswald
@ 2012-02-07 10:46 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-07 10:46 UTC (permalink / raw)
On 2012-02-03 16.36, Joe Oswald wrote:
> On Thursday, February 2, 2012 7:16:26 PM UTC-5, Johnny Billquist wrote:
>
>> It might be that the determinism of the whole things is rather complex,
>> but it is deterministic. A CPU is, after all, just a finite state
>> machine. There is nothing undeterministic when you go down to the bottom
>> of it all. There are ones and zeroes. There are gates, with functions
>> like "AND", "OR", "NOT" and so on. And they are all behaving in a very
>> deterministic way.
>
> The logic is not just combinational; there is plenty of register state and internal buses in a CPU. An undefined opcode could definitely trigger micro- or nano-code (aside, I know nothing about PDP-11 internals) that does "bad" things like drive two registers simultaneously onto an internal bus, or latches a value from a bus that is floating. The result of these is "deterministic" in the sense of physics, but not in terms of digital logic. A floating bus might or might not have a valid logic value; that depends on the internal history (the last valid value driven, and what exact voltage that driver used) analog conditions (capacitance& leakage) and timing that are outside the digital definitions. Two outputs fighting one another might have a deterministic outcome, or a fight between driving low& driving high might leave the line in the range of voltages that aren't defined as either low or high, and anything reading from this voltage has no guarantees about what it does.
In general you are right in that there could be states that basically
ends up driving nothing, and reading a floating value.
For opcodes, the PDP-11 traps all of those, for example, so they do not
cause this.
The same with memory references to memory that don't exist. The PDP-11
in general does never "just read" something. It's all handshaking
protocols, which will detect if you try address non-existing memory or
devices.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-06 16:40 ` Johnny Billquist
@ 2012-02-07 14:50 ` paramucho
2012-02-07 16:20 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-07 14:50 UTC (permalink / raw)
On Mon, 06 Feb 2012 17:40:47 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-06 15.56, Johnny Billquist wrote:
>> On 2012-02-06 14.51, paramucho wrote:
>>>
>>> This explains four things, perhaps:
>>>
>>> 1. The release note: "MMU. SR1 mechanized".
>>
>> Right.
>>
>>> 2. The otherwise cryptic command definition for SET FPBACKOUT (which
>>> I'd noted, but not followed up):
>>>
>>> FPBACKOUT J-11 SR1 behavior, autoinc/dec is always undone on
>>> aborted FPP instruction.
>>>
>>> I'm not sure how this is supposed to work in the real world.
>>
>> Not sure what that command in E11 do. However, if the changes are backed
>> out also on FP instructions, then SR1 will still remain zero at all times.
>>
>>> 3. And (now) looking further I note the command SET CPU [NO]SR1. I
>>> tried it out, but it seems to do nothing. Later.
>>
>> No idea about that one. Maybe something in combination with the FPBACKOUT?
>
>Thinking about it, I would possibly have expected this to make SR1 not
>even exist.
>E11 in general (if I remember right) will just set a whole bunch of
>parameters in a predefined way when you say you want a specific model
>emulated. You can get the same result (I think), by just setting all the
>individual features yourself as well. And some machines don't have an
>SR1, so I would have thought this feature would mean just that.
>If you do a SET CPU NOSR1 just before booting, can you still access SR1?
>
>By the way, have you tried playing with UNDOAUTO as well?
Nope, and I'll try to resist as well :-)
I wrote a better SR1 testbed where all I need to for a new test is
fill in a template and insert the new test code.
Kernel and user memory are mapped the same space. Par5 is not mapped.
The tests are designed to fail at location 120000. An asterix marks
the part of the instruction which will cause the trap by trying to
access location 120000.
TEST0:
In the first test, TEST00, we expect the trap to occur after after the
source field. R0 should have advanced by 2 and the low byte of SR1
should hold "20", meaning R0 has been incremented by two.
SIMH:
Test00: mov *(r0)+,(r0)+
Before: R0=120000 SP=744 PC=2064
After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=2064
E11:
Test00: mov *(r0)+,(r0)+
Before: R0=120000 SP=744 PC=2064
After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2064
As you can see E11 doesn't increment R0 and leaves SR1 null.
TEST01:
In TEST02 the trap occurs on the destination field. SimH is expected
to advance R0 by 4, as shown by the [20|20] SR1.
SIMH:
Test01: mov (r0)+,*(r0)+
Before: R0=117776 SP=744 PC=2266
After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|20] SR2=2266
E11:
Test01: mov (r0)+,*(r0)+
Before: R0=117776 SP=744 PC=2266
After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2266
E11 backs the instruction out.
TEST02:
This test is much the same as TEST00 and shows that MTPx doesn't push
anything on the stack in case of an error.
SIMH:
Test02: mfpi *(r0)+
Before: R0=120000 SP=744 PC=2462
After: R0=120002 SP=744 Err=1 SR0=100153 SR1=[0|20] SR2=2462
E11:
Test02: mfpi *(r0)+
Before: R0=120000 SP=744 PC=2462
After: R0=120000 SP=744 Err=1 SR0=100153 SR1=[0|0] SR2=2462
TEST03:
I was thinking about SR1 tests while was out riding my bike in circles
this evening, and I thought, the most likely place that the E11 tactic
would fail with be with MFPx/MTPx. And that's what happens with MTPI.
SimH correctly shows that both R0 and SP have been incremented with
[20|26]. E11 backs R0 out, but fails to backout SP (it should be 744,
not 746). It's a bug, but probably easily fixed.
SIMH:
Test03: mtpi *(r0)+
Before: R0=120000 SP=744 PC=2700
After: R0=120002 SP=746 Err=1 SR0=100153 SR1=[20|26] SR2=2700
E11:
Test03: mtpi *(r0)+
Before: R0=120000 SP=744 PC=2700
After: R0=120000 SP=746 Err=1 SR0=100153 SR1=[0|0] SR2=2700
Now, if only I could my recalcitrant J11 running I could verify all
these tests on real iron.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-07 14:50 ` paramucho
@ 2012-02-07 16:20 ` Johnny Billquist
2012-02-08 13:34 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-07 16:20 UTC (permalink / raw)
On 2012-02-07 15.50, paramucho wrote:
> On Mon, 06 Feb 2012 17:40:47 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-06 15.56, Johnny Billquist wrote:
>>> On 2012-02-06 14.51, paramucho wrote:
>>>>
>>>> This explains four things, perhaps:
>>>>
>>>> 1. The release note: "MMU. SR1 mechanized".
>>>
>>> Right.
>>>
>>>> 2. The otherwise cryptic command definition for SET FPBACKOUT (which
>>>> I'd noted, but not followed up):
>>>>
>>>> FPBACKOUT J-11 SR1 behavior, autoinc/dec is always undone on
>>>> aborted FPP instruction.
>>>>
>>>> I'm not sure how this is supposed to work in the real world.
>>>
>>> Not sure what that command in E11 do. However, if the changes are backed
>>> out also on FP instructions, then SR1 will still remain zero at all times.
>>>
>>>> 3. And (now) looking further I note the command SET CPU [NO]SR1. I
>>>> tried it out, but it seems to do nothing. Later.
>>>
>>> No idea about that one. Maybe something in combination with the FPBACKOUT?
>>
>> Thinking about it, I would possibly have expected this to make SR1 not
>> even exist.
>> E11 in general (if I remember right) will just set a whole bunch of
>> parameters in a predefined way when you say you want a specific model
>> emulated. You can get the same result (I think), by just setting all the
>> individual features yourself as well. And some machines don't have an
>> SR1, so I would have thought this feature would mean just that.
>> If you do a SET CPU NOSR1 just before booting, can you still access SR1?
>>
>> By the way, have you tried playing with UNDOAUTO as well?
>
> Nope, and I'll try to resist as well :-)
>
>
> I wrote a better SR1 testbed where all I need to for a new test is
> fill in a template and insert the new test code.
>
> Kernel and user memory are mapped the same space. Par5 is not mapped.
> The tests are designed to fail at location 120000. An asterix marks
> the part of the instruction which will cause the trap by trying to
> access location 120000.
>
>
> TEST0:
> In the first test, TEST00, we expect the trap to occur after after the
> source field. R0 should have advanced by 2 and the low byte of SR1
> should hold "20", meaning R0 has been incremented by two.
>
> SIMH:
> Test00: mov *(r0)+,(r0)+
> Before: R0=120000 SP=744 PC=2064
> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=2064
>
> E11:
> Test00: mov *(r0)+,(r0)+
> Before: R0=120000 SP=744 PC=2064
> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2064
>
> As you can see E11 doesn't increment R0 and leaves SR1 null.
>
>
>
> TEST01:
> In TEST02 the trap occurs on the destination field. SimH is expected
> to advance R0 by 4, as shown by the [20|20] SR1.
>
> SIMH:
> Test01: mov (r0)+,*(r0)+
> Before: R0=117776 SP=744 PC=2266
> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|20] SR2=2266
>
> E11:
> Test01: mov (r0)+,*(r0)+
> Before: R0=117776 SP=744 PC=2266
> After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2266
>
> E11 backs the instruction out.
>
>
>
> TEST02:
> This test is much the same as TEST00 and shows that MTPx doesn't push
> anything on the stack in case of an error.
>
> SIMH:
> Test02: mfpi *(r0)+
> Before: R0=120000 SP=744 PC=2462
> After: R0=120002 SP=744 Err=1 SR0=100153 SR1=[0|20] SR2=2462
>
> E11:
> Test02: mfpi *(r0)+
> Before: R0=120000 SP=744 PC=2462
> After: R0=120000 SP=744 Err=1 SR0=100153 SR1=[0|0] SR2=2462
>
>
>
> TEST03:
> I was thinking about SR1 tests while was out riding my bike in circles
> this evening, and I thought, the most likely place that the E11 tactic
> would fail with be with MFPx/MTPx. And that's what happens with MTPI.
>
> SimH correctly shows that both R0 and SP have been incremented with
> [20|26]. E11 backs R0 out, but fails to backout SP (it should be 744,
> not 746). It's a bug, but probably easily fixed.
>
> SIMH:
> Test03: mtpi *(r0)+
> Before: R0=120000 SP=744 PC=2700
> After: R0=120002 SP=746 Err=1 SR0=100153 SR1=[20|26] SR2=2700
>
> E11:
> Test03: mtpi *(r0)+
> Before: R0=120000 SP=744 PC=2700
> After: R0=120000 SP=746 Err=1 SR0=100153 SR1=[0|0] SR2=2700
>
>
> Now, if only I could my recalcitrant J11 running I could verify all
> these tests on real iron.
Cool.
Other interesting tests:
MOV (PC)+,(R0)+
where R0 points to invalid memory. Should affect PC (or back it out), as
well as R0.
Also, something like the LDD instruction (FPP) could be used to check
for other increments, like 4 and 8, which should also be possible, as
well as partials perhaps, if the argument pointed to is partially
outside of valid memory.
I might be able to do these tests under RSX. Have to test setting up the
environment for that. If I do, then I could test this on my 11/93.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-07 16:20 ` Johnny Billquist
@ 2012-02-08 13:34 ` paramucho
2012-02-08 16:03 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-08 13:34 UTC (permalink / raw)
On Tue, 07 Feb 2012 17:20:06 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>> I wrote a better SR1 testbed where all I need to for a new test is
>> fill in a template and insert the new test code.
>>
>> Kernel and user memory are mapped the same space. Par5 is not mapped.
>> The tests are designed to fail at location 120000. An asterix marks
>> the part of the instruction which will cause the trap by trying to
>> access location 120000.
>I might be able to do these tests under RSX. Have to test setting up the
>environment for that. If I do, then I could test this on my 11/93.
With sticky tape, a pair of tweezers and an ageing RX02 drive I
managed to boot the 11/73. After the RX02 boots I use RUST's ethernet
MOP facility to boot out of a (Windows-native) directory on my Windows
box. The only thing left to fix are the intermittent Winpcap crashes.
Testing was delayed when I decided to use the terminal cable as a trip
rope, pulling out the DLV11J socket and all the little brass things.
An hour later I'd actually managed to put it all back together after
finding the wiring diagrams, straightening pins and those hardware
kind of things one does.
I've updated the previous tests with J11 status:
>> TEST0:
>> In the first test, TEST00, we expect the trap to occur after after the
>> source field. R0 should have advanced by 2 and the low byte of SR1
>> should hold "20", meaning R0 has been incremented by two.
>>
>> SIMH:
>> Test00: mov *(r0)+,(r0)+
>> Before: R0=120000 SP=744 PC=2064
>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=2064
J11 is the same as SimH
>> E11:
>> Test00: mov *(r0)+,(r0)+
>> Before: R0=120000 SP=744 PC=2064
>> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2064
>>
>> As you can see E11 doesn't increment R0 and leaves SR1 null.
>> TEST01:
>> In TEST02 the trap occurs on the destination field. SimH is expected
>> to advance R0 by 4, as shown by the [20|20] SR1.
>>
>> SIMH:
>> Test01: mov (r0)+,*(r0)+
>> Before: R0=117776 SP=744 PC=2266
>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|20] SR2=2266
J11 is the same as SimH
>> E11:
>> Test01: mov (r0)+,*(r0)+
>> Before: R0=117776 SP=744 PC=2266
>> After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2266
>>
>> E11 backs the instruction out.
>> TEST02:
>> This test is much the same as TEST00 and shows that MTPx doesn't push
>> anything on the stack in case of an error.
>>
>> SIMH:
>> Test02: mfpi *(r0)+
>> Before: R0=120000 SP=744 PC=2462
>> After: R0=120002 SP=744 Err=1 SR0=100153 SR1=[0|20] SR2=2462
J11 is the same as SimH
>> E11:
>> Test02: mfpi *(r0)+
>> Before: R0=120000 SP=744 PC=2462
>> After: R0=120000 SP=744 Err=1 SR0=100153 SR1=[0|0] SR2=2462
>> TEST03:
>> I was thinking about SR1 tests while was out riding my bike in circles
>> this evening, and I thought, the most likely place that the E11 tactic
>> would fail with be with MFPx/MTPx. And that's what happens with MTPI.
>>
>> SimH correctly shows that both R0 and SP have been incremented with
>> [20|26]. E11 backs R0 out, but fails to backout SP (it should be 744,
>> not 746). It's a bug, but probably easily fixed.
>>
>> SIMH:
>> Test03: mtpi *(r0)+
>> Before: R0=120000 SP=744 PC=2700
>> After: R0=120002 SP=746 Err=1 SR0=100153 SR1=[20|26] SR2=2700
J11 is the same as SimH
>> E11:
>> Test03: mtpi *(r0)+
>> Before: R0=120000 SP=744 PC=2700
>> After: R0=120000 SP=746 Err=1 SR0=100153 SR1=[0|0] SR2=2700
E11 is really wrong.
<snip>
+++++++++++++++++++++++++
TEST06:
>Other interesting tests:
>
> MOV (PC)+,(R0)+
>
>where R0 points to invalid memory. Should affect PC (or back it out), as
>well as R0.
In fact modifications of PC should not appear in SR1 at all and that's
because the instruction itself is always restarted from the beginning.
SimH gets this wrong:
J11:
Test06: mov (pc)+,*(r0)+
Before: R0=120000 SP=744 PC=4166
After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=4166
****
SimH:
Test06: mov (pc)+,*(r0)+
Before: R0=120000 SP=744 PC=4166 SR0=153
After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|27] SR2=4166
SimH is wrong! *****
This is a generic SimH difference which is easily fixed. It's probably
just a matter of modifying calc_MMR1 to exclude R7 (something like:
(((val)&7)==7)? (MMR1):...
E11 is as expected.
E11:
Test06: mov (pc)+,*(r0)+
Before: R0=120000 SP=744 PC=4176 SR0=1
After: R0=120000 SP=744 Err=250 SR0=100013 SR1=[0|0] SR2=4176
+++++++++++++++++++++++++
TEST07:
TEST08:
TEST09:
TEST10:
>Also, something like the LDD instruction (FPP) could be used to check
>for other increments, like 4 and 8, which should also be possible, as
>well as partials perhaps, if the argument pointed to is partially
>outside of valid memory.
I'll deal with the four variations of this test together: single and
double precision with the error at the start of the data area or
halfway through it.
SimH treats FPU instructions as it does the base instruction set as
shown below: SR1 has the modifications made to R0 in SR1 in all cases
below.
SimH:
Test07: ldf (r0)+,%0 ; 32-bit
Before: R0=120000 SP=744 PC=4444 SR0=13
After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4444
****** ****
Test08: ldf (r0)+,%0 ; 32-bit
Before: R0=117776 SP=744 PC=4722 SR0=13
After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4722
****** ****
Test09: ldf (r0)+,%0 ; 64-bit
Before: R0=120000 SP=744 PC=5200 SR0=13
After: R0=120010 SP=744 Err=1 SR0=100013 SR1=[0|100] SR2=5200
****** *****
Test10: ldd (r0)+,%0 ; 64-bit
Before: R0=117774 SP=744 PC=5460 SR0=13
After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|100] SR2=5460
****** *****
However, the J11 FPU doesn't use SR1 to record register modifications.
Instead, it acts more like E11, backing out the registers instead (or
, more likely, not updating them until all accesses are complete).
Thus, SimH is *different* on all the above tests. The fix here is more
extensive, but the FPU source module is considerably easier to work
with the main CPU module. It's probably a matter of using the internal
MMR1 information to backout the registers.
J11 and E11:
Test07: ldf (r0)+,%0 ; 32-bit
Before: R0=120000 SP=744 PC=4444 SR0=13
After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4444
****** ***
Test08: ldf (r0)+,%0 ; 32-bit
Before: R0=117776 SP=744 PC=4722 SR0=13
After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4722
****** ***
Test09: ldf (r0)+,%0 ; 64-bit
Before: R0=120000 SP=744 PC=5200 SR0=13
After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=5200
****** ***
Test10: ldd (r0)+,%0 ; 64-bit
Before: R0=117774 SP=744 PC=5460 SR0=13
After: R0=177774 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=5460
****** ***
This J11 behavior may well be undocumented. There's no guarantee that
this behavior is the same with earlier FPU implementations. We'd need
an 11/45, and 11/40, an 11/34 etc to test that.
+++++++++++++++++++++++++
TEST13:
The FPU result also suggests that EIS and CIS tests be done (I don't
have CIS). This EIS test has identical results on J11 and SimH.
J11/SimH:
Test13: mul (r0)+,r2
Before: R0=120000 SP=744 PC=6306 SR0=13
After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=6306
And has the expected backed-out E11 result:
E11:
Test13: mul (r0)+,r2
Before: R0=120000 SP=744 PC=6306 SR0=1
After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=6306
+++++++++++++++++++++++++
TEST12:
TEST14:
I thought it would be useful to compare bus errors (traps to 4) with
MMU errors (traps to 250). In fact, the R0 register outcomes look to
be the same for both MMU and BUS errors.
Note: the displayed value "Err" now holds the vector address, i.e. 4
or 250.
J11/SimH:
Test12: ldd (r0)+,%0 ; bus error
Before: R0=160000 SP=744 PC=6336 SR0=13
After: R0=160010 SP=744 Err=4 SR0=13 SR1=[0|0] SR2=1722
Test14: tst (r0)+ ; bus error
Before: R0=160000 SP=744 PC=7060 SR0=13
After: R0=160002 SP=744 Err=4 SR0=13 SR1=[0|0] SR2=1722
E11:
Test12: ldd (r0)+,%0 ; bus error
Before: R0=160000 SP=744 PC=6336 SR0=1
After: R0=160000 SP=744 Err=4 SR0=1 SR1=[0|0] SR2=1722
Test14: tst (r0)+ ; bus error
Before: R0=160000 SP=744 PC=7060 SR0=1
After: R0=160000 SP=744 Err=4 SR0=1 SR1=[0|0] SR2=1722
+++++++++++++++++++++++++
Summary:
It's all a bit higgledy-piggledy above, so I'll summarise, using the
J11 behavior as the benchmark, where:
"Correct" means the same as the J11
"Different" means not the same, but still functional.
You may willing to accept these. I'm less so inclined.
"Wrong" means a real bug (marked with ****).
1. Base and EIS instruction sets.
SimH: Correct on all, except,
**** Wrong for (PC) inc/dec's which should be ignored
(because instruction restarts).
E11: Different on all because it backs modifications out.
**** Wrong for MTPI because it doesn't backout the stack pop.
2. FPU instruction set.
SimH: Different on all because it doesn't back inc/dec's out.
E11: Correct on all (more by chance than design though :).
(And, yes, to those who've asked before, I will inform Bob Supnik and
John Wilson about these differences (in the fullness of time when the
list is completed.))
Going forward (sometime):
o I still need to do some tests with RTS Rn and RTI. A slight
redesign of the utility is required for that.
o I need to extend the testbed to also capture PSW NZVC flags before
and after instructions. Clearly ADC, ROL etc will fail if the
condition codes are not preserved. I don't expect errors, but, to
quote W.C. Fields, (or was it Fats Waller) one never knows, does
one.
o More comparison between bus errors and page errors is needed.
o More instruction tests
(I should explain that my interest in these tests comes from the
desire to actually utilize the SR1 paging facility at some time down
the track. I'm not just interested here in seeing if SimH and E11 are
compatible with the hardware, I'm also interested in seeing if the J11
functionality has bugs in it, 'cos if it does I may as well not waste
my precious time).
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-08 13:34 ` paramucho
@ 2012-02-08 16:03 ` Johnny Billquist
2012-02-08 16:58 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-08 16:03 UTC (permalink / raw)
On 2012-02-08 14.34, paramucho wrote:
> On Tue, 07 Feb 2012 17:20:06 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
> I've updated the previous tests with J11 status:
>
>>> TEST0:
>>> In the first test, TEST00, we expect the trap to occur after after the
>>> source field. R0 should have advanced by 2 and the low byte of SR1
>>> should hold "20", meaning R0 has been incremented by two.
>>>
>>> SIMH:
>>> Test00: mov *(r0)+,(r0)+
>>> Before: R0=120000 SP=744 PC=2064
>>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=2064
> J11 is the same as SimH
>
>>> E11:
>>> Test00: mov *(r0)+,(r0)+
>>> Before: R0=120000 SP=744 PC=2064
>>> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2064
>>>
>>> As you can see E11 doesn't increment R0 and leaves SR1 null.
So E11 does not behave like the J11, even when asked to, in this case.
But it does work correctly according to the architecture.
>>> TEST01:
>>> In TEST02 the trap occurs on the destination field. SimH is expected
>>> to advance R0 by 4, as shown by the [20|20] SR1.
>>>
>>> SIMH:
>>> Test01: mov (r0)+,*(r0)+
>>> Before: R0=117776 SP=744 PC=2266
>>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|20] SR2=2266
> J11 is the same as SimH
>
>>> E11:
>>> Test01: mov (r0)+,*(r0)+
>>> Before: R0=117776 SP=744 PC=2266
>>> After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2266
>>>
>>> E11 backs the instruction out.
Same comment as for TEST00
>>> TEST02:
>>> This test is much the same as TEST00 and shows that MTPx doesn't push
>>> anything on the stack in case of an error.
>>>
>>> SIMH:
>>> Test02: mfpi *(r0)+
>>> Before: R0=120000 SP=744 PC=2462
>>> After: R0=120002 SP=744 Err=1 SR0=100153 SR1=[0|20] SR2=2462
> J11 is the same as SimH
>
>>> E11:
>>> Test02: mfpi *(r0)+
>>> Before: R0=120000 SP=744 PC=2462
>>> After: R0=120000 SP=744 Err=1 SR0=100153 SR1=[0|0] SR2=2462
Same comment as for TEST00
>>> TEST03:
>>> I was thinking about SR1 tests while was out riding my bike in circles
>>> this evening, and I thought, the most likely place that the E11 tactic
>>> would fail with be with MFPx/MTPx. And that's what happens with MTPI.
>>>
>>> SimH correctly shows that both R0 and SP have been incremented with
>>> [20|26]. E11 backs R0 out, but fails to backout SP (it should be 744,
>>> not 746). It's a bug, but probably easily fixed.
>>>
>>> SIMH:
>>> Test03: mtpi *(r0)+
>>> Before: R0=120000 SP=744 PC=2700
>>> After: R0=120002 SP=746 Err=1 SR0=100153 SR1=[20|26] SR2=2700
> J11 is the same as SimH
>
>>> E11:
>>> Test03: mtpi *(r0)+
>>> Before: R0=120000 SP=744 PC=2700
>>> After: R0=120000 SP=746 Err=1 SR0=100153 SR1=[0|0] SR2=2700
> E11 is really wrong.
> <snip>
Right. A real bug here.
>> Other interesting tests:
>>
>> MOV (PC)+,(R0)+
>>
>> where R0 points to invalid memory. Should affect PC (or back it out), as
>> well as R0.
>
> In fact modifications of PC should not appear in SR1 at all and that's
> because the instruction itself is always restarted from the beginning.
Not necessarily. The 11/44 and 11/70 (according to the manuals) will
update SR1 with modifications to the PC as well (page 164 in the
processor handbook for those models).
The text says:
"MMR1 records any autoincrement/decrement of the general purpose
registers, including explicit references through the PC."
However, I'm not sure what the point of that is, since MMR2 will hold
the PC at the start of the instruction anyway, so you don't really need
to adjust the PC anyway.
> SimH gets this wrong:
>
> J11:
> Test06: mov (pc)+,*(r0)+
> Before: R0=120000 SP=744 PC=4166
> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=4166
> ****
J11 would appear to work differently than the 11/44 or 11/70. What is
the saved PC on the stack at this point? Has it been updated or not?
> SimH:
> Test06: mov (pc)+,*(r0)+
> Before: R0=120000 SP=744 PC=4166 SR0=153
> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|27] SR2=4166
> SimH is wrong! *****
Definitely wrong if it tries to act like a J11. Perhaps not wrong for
some other CPU models.
> This is a generic SimH difference which is easily fixed. It's probably
> just a matter of modifying calc_MMR1 to exclude R7 (something like:
> (((val)&7)==7)? (MMR1):...
Possibly. But it needs to be different depending on which CPU model you
are trying to simulate.
> E11 is as expected.
>
> E11:
> Test06: mov (pc)+,*(r0)+
> Before: R0=120000 SP=744 PC=4176 SR0=1
> After: R0=120000 SP=744 Err=250 SR0=100013 SR1=[0|0] SR2=4176
E11 backs all out, yup.
> +++++++++++++++++++++++++
> TEST07:
> TEST08:
> TEST09:
> TEST10:
>> Also, something like the LDD instruction (FPP) could be used to check
>> for other increments, like 4 and 8, which should also be possible, as
>> well as partials perhaps, if the argument pointed to is partially
>> outside of valid memory.
>
> I'll deal with the four variations of this test together: single and
> double precision with the error at the start of the data area or
> halfway through it.
>
> SimH treats FPU instructions as it does the base instruction set as
> shown below: SR1 has the modifications made to R0 in SR1 in all cases
> below.
>
> SimH:
> Test07: ldf (r0)+,%0 ; 32-bit
> Before: R0=120000 SP=744 PC=4444 SR0=13
> After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4444
> ****** ****
>
> Test08: ldf (r0)+,%0 ; 32-bit
> Before: R0=117776 SP=744 PC=4722 SR0=13
> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4722
> ****** ****
>
> Test09: ldf (r0)+,%0 ; 64-bit
> Before: R0=120000 SP=744 PC=5200 SR0=13
> After: R0=120010 SP=744 Err=1 SR0=100013 SR1=[0|100] SR2=5200
> ****** *****
>
> Test10: ldd (r0)+,%0 ; 64-bit
> Before: R0=117774 SP=744 PC=5460 SR0=13
> After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|100] SR2=5460
> ****** *****
That looked very reasonable.
> However, the J11 FPU doesn't use SR1 to record register modifications.
> Instead, it acts more like E11, backing out the registers instead (or
> , more likely, not updating them until all accesses are complete).
>
> Thus, SimH is *different* on all the above tests. The fix here is more
> extensive, but the FPU source module is considerably easier to work
> with the main CPU module. It's probably a matter of using the internal
> MMR1 information to backout the registers.
>
> J11 and E11:
> Test07: ldf (r0)+,%0 ; 32-bit
> Before: R0=120000 SP=744 PC=4444 SR0=13
> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4444
> ****** ***
> Test08: ldf (r0)+,%0 ; 32-bit
> Before: R0=117776 SP=744 PC=4722 SR0=13
> After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4722
> ****** ***
> Test09: ldf (r0)+,%0 ; 64-bit
> Before: R0=120000 SP=744 PC=5200 SR0=13
> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=5200
> ****** ***
> Test10: ldd (r0)+,%0 ; 64-bit
> Before: R0=117774 SP=744 PC=5460 SR0=13
> After: R0=177774 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=5460
> ****** ***
Interesting.
> This J11 behavior may well be undocumented. There's no guarantee that
> this behavior is the same with earlier FPU implementations. We'd need
> an 11/45, and 11/40, an 11/34 etc to test that.
Definitely. Also, it would be interesting to see if J11 behaves the same
with and without the FPA.
I can (eventually) set up to test this on a real 11/70.
> +++++++++++++++++++++++++
> TEST13:
> The FPU result also suggests that EIS and CIS tests be done (I don't
> have CIS). This EIS test has identical results on J11 and SimH.
CIS - That would mean either 11/23, 11/24 or 11/44, as those were the
only ones to even have that option. But they were not common... Tricky
to test in other words.
> J11/SimH:
> Test13: mul (r0)+,r2
> Before: R0=120000 SP=744 PC=6306 SR0=13
> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=6306
>
> And has the expected backed-out E11 result:
>
> E11:
> Test13: mul (r0)+,r2
> Before: R0=120000 SP=744 PC=6306 SR0=1
> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=6306
Yeah. Same as for the basic tests. Same comment as TEST00
> +++++++++++++++++++++++++
> TEST12:
> TEST14:
> I thought it would be useful to compare bus errors (traps to 4) with
> MMU errors (traps to 250). In fact, the R0 register outcomes look to
> be the same for both MMU and BUS errors.
>
> Note: the displayed value "Err" now holds the vector address, i.e. 4
> or 250.
>
> J11/SimH:
> Test12: ldd (r0)+,%0 ; bus error
> Before: R0=160000 SP=744 PC=6336 SR0=13
> After: R0=160010 SP=744 Err=4 SR0=13 SR1=[0|0] SR2=1722
>
> Test14: tst (r0)+ ; bus error
> Before: R0=160000 SP=744 PC=7060 SR0=13
> After: R0=160002 SP=744 Err=4 SR0=13 SR1=[0|0] SR2=1722
>
> E11:
> Test12: ldd (r0)+,%0 ; bus error
> Before: R0=160000 SP=744 PC=6336 SR0=1
> After: R0=160000 SP=744 Err=4 SR0=1 SR1=[0|0] SR2=1722
>
> Test14: tst (r0)+ ; bus error
> Before: R0=160000 SP=744 PC=7060 SR0=1
> After: R0=160000 SP=744 Err=4 SR0=1 SR1=[0|0] SR2=1722
Does not look like the MMR registers are being used at all for bus
errors, which in fact is not surprising.
> +++++++++++++++++++++++++
> Summary:
>
> It's all a bit higgledy-piggledy above, so I'll summarise, using the
> J11 behavior as the benchmark, where:
>
> "Correct" means the same as the J11
>
> "Different" means not the same, but still functional.
> You may willing to accept these. I'm less so inclined.
>
> "Wrong" means a real bug (marked with ****).
>
> 1. Base and EIS instruction sets.
> SimH: Correct on all, except,
> **** Wrong for (PC) inc/dec's which should be ignored
> (because instruction restarts).
I'm not it should be classified as a bug. It depends on what the PC
pushed on the stack looks like. It might be fully correct, but not the
same as J11 (see other comments about this above).
> E11: Different on all because it backs modifications out.
> **** Wrong for MTPI because it doesn't backout the stack pop.
Right. That's a clear bug.
> 2. FPU instruction set.
> SimH: Different on all because it doesn't back inc/dec's out.
> E11: Correct on all (more by chance than design though :).
SimH is different to the J11, yes.
> (And, yes, to those who've asked before, I will inform Bob Supnik and
> John Wilson about these differences (in the fullness of time when the
> list is completed.))
Cool.
> Going forward (sometime):
>
> o I still need to do some tests with RTS Rn and RTI. A slight
> redesign of the utility is required for that.
RTI? I could see potential for RTS as well as JSR, if the SP points to
invalid memory. But RTI... Hmm... Am I thinking wrong here. But that
could only come from a broken kernel SP, and a trap will then become a
double trap, since you can't trap for the error without a stack.
Or what am I missing? (Too tired to think more...)
> o I need to extend the testbed to also capture PSW NZVC flags before
> and after instructions. Clearly ADC, ROL etc will fail if the
> condition codes are not preserved. I don't expect errors, but, to
> quote W.C. Fields, (or was it Fats Waller) one never knows, does
> one.
After, you have them on the stack. Before, just do a MFPS.
> o More comparison between bus errors and page errors is needed.
Not sure why. You tests above all clearly showed that at bus errors, no
MMR registers are involved anyway.
> o More instruction tests
Always. :-)
> (I should explain that my interest in these tests comes from the
> desire to actually utilize the SR1 paging facility at some time down
> the track. I'm not just interested here in seeing if SimH and E11 are
> compatible with the hardware, I'm also interested in seeing if the J11
> functionality has bugs in it, 'cos if it does I may as well not waste
> my precious time).
Me interested too. :-)
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-08 16:03 ` Johnny Billquist
@ 2012-02-08 16:58 ` paramucho
2012-02-08 22:29 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-08 16:58 UTC (permalink / raw)
On Wed, 08 Feb 2012 17:03:02 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-08 14.34, paramucho wrote:
>> On Tue, 07 Feb 2012 17:20:06 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>> <snip>
>>
>> I've updated the previous tests with J11 status:
>>
>>>> TEST0:
>>>> In the first test, TEST00, we expect the trap to occur after after the
>>>> source field. R0 should have advanced by 2 and the low byte of SR1
>>>> should hold "20", meaning R0 has been incremented by two.
>>>>
>>>> SIMH:
>>>> Test00: mov *(r0)+,(r0)+
>>>> Before: R0=120000 SP=744 PC=2064
>>>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=2064
>> J11 is the same as SimH
>>
>>>> E11:
>>>> Test00: mov *(r0)+,(r0)+
>>>> Before: R0=120000 SP=744 PC=2064
>>>> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2064
>>>>
>>>> As you can see E11 doesn't increment R0 and leaves SR1 null.
>
>So E11 does not behave like the J11, even when asked to, in this case.
>But it does work correctly according to the architecture.
Let's not go back to the "architecture" debate...we're never gonna
agree. I've avoided the issue below with the terms "correct",
"different" and "wrong".
<snip>
>>> Other interesting tests:
>>>
>>> MOV (PC)+,(R0)+
>>>
>>> where R0 points to invalid memory. Should affect PC (or back it out), as
>>> well as R0.
>>
>> In fact modifications of PC should not appear in SR1 at all and that's
>> because the instruction itself is always restarted from the beginning.
>
>Not necessarily. The 11/44 and 11/70 (according to the manuals) will
>update SR1 with modifications to the PC as well (page 164 in the
>processor handbook for those models).
>The text says:
>"MMR1 records any autoincrement/decrement of the general purpose
>registers, including explicit references through the PC."
>
>However, I'm not sure what the point of that is, since MMR2 will hold
>the PC at the start of the instruction anyway, so you don't really need
>to adjust the PC anyway.
It's an oxymoron.
>> SimH gets this wrong:
>>
>> J11:
>> Test06: mov (pc)+,*(r0)+
>> Before: R0=120000 SP=744 PC=4166
>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=4166
>> ****
>
>J11 would appear to work differently than the 11/44 or 11/70. What is
>the saved PC on the stack at this point? Has it been updated or not?
The PC on the stack is always updated. At present my test program
would crash if it wasn't. That's what I need to change to test RTI
etc.
<snip>
>> +++++++++++++++++++++++++
>> TEST07:
>> TEST08:
>> TEST09:
>> TEST10:
>>> Also, something like the LDD instruction (FPP) could be used to check
>>> for other increments, like 4 and 8, which should also be possible, as
>>> well as partials perhaps, if the argument pointed to is partially
>>> outside of valid memory.
>>
>> I'll deal with the four variations of this test together: single and
>> double precision with the error at the start of the data area or
>> halfway through it.
>>
>> SimH treats FPU instructions as it does the base instruction set as
>> shown below: SR1 has the modifications made to R0 in SR1 in all cases
>> below.
>>
>> SimH:
>> Test07: ldf (r0)+,%0 ; 32-bit
>> Before: R0=120000 SP=744 PC=4444 SR0=13
>> After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4444
>> ****** ****
<snip>
>That looked very reasonable.
>
>> However, the J11 FPU doesn't use SR1 to record register modifications.
>> Instead, it acts more like E11, backing out the registers instead (or
>> , more likely, not updating them until all accesses are complete).
>>
>> Thus, SimH is *different* on all the above tests. The fix here is more
>> extensive, but the FPU source module is considerably easier to work
>> with the main CPU module. It's probably a matter of using the internal
>> MMR1 information to backout the registers.
>>
>> J11 and E11:
>> Test07: ldf (r0)+,%0 ; 32-bit
>> Before: R0=120000 SP=744 PC=4444 SR0=13
>> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4444
<snip>
>Interesting.
>> This J11 behavior may well be undocumented. There's no guarantee that
>> this behavior is the same with earlier FPU implementations. We'd need
>> an 11/45, and 11/40, an 11/34 etc to test that.
I found the following comment in the SimH sources tonight:
According to the PDP-11 Architecture Handbook, MMR1 records all
autoincrement and autodecrement operations, including those which
explicitly reference the PC. For the J-11, this is only true for
autodecrement operands, autodecrement deferred operands, and
autoincrement destination operands that involve a write to memory.
The simulator follows the Handbook, for simplicity.
The document he's referencing is here (and I think I used to have a
copy of it):
http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
So, Bob Supnik is stating here that he's not slavishly following the
J11, so I'll just mark it "different" for the moment.
>Definitely. Also, it would be interesting to see if J11 behaves the same
>with and without the FPA.
>I can (eventually) set up to test this on a real 11/70.
It would be great to see if the older implementations actually do
update PC and/or FPU instructions. What system runs on the 11/70...let
me guess :-)
>> +++++++++++++++++++++++++
>> TEST13:
>> The FPU result also suggests that EIS and CIS tests be done (I don't
>> have CIS). This EIS test has identical results on J11 and SimH.
>
>CIS - That would mean either 11/23, 11/24 or 11/44, as those were the
>only ones to even have that option. But they were not common... Tricky
>to test in other words.
<snip>
>> +++++++++++++++++++++++++
>> Summary:
>>
>> It's all a bit higgledy-piggledy above, so I'll summarise, using the
>> J11 behavior as the benchmark, where:
>>
>> "Correct" means the same as the J11
>>
>> "Different" means not the same, but still functional.
>> You may willing to accept these. I'm less so inclined.
>>
>> "Wrong" means a real bug (marked with ****).
>>
>> 1. Base and EIS instruction sets.
>> SimH: Correct on all, except,
>> **** Wrong for (PC) inc/dec's which should be ignored
>> (because instruction restarts).
Correction:
Different for (PC) incs/decs (see source comment above)
>
>I'm not it should be classified as a bug. It depends on what the PC
>pushed on the stack looks like. It might be fully correct, but not the
>same as J11 (see other comments about this above).
The comment from the source, shown above, shows he's being generic
rather than specific to the J11.
>> E11: Different on all because it backs modifications out.
>> **** Wrong for MTPI because it doesn't backout the stack pop.
>
>Right. That's a clear bug.
>
>> 2. FPU instruction set.
>> SimH: Different on all because it doesn't back inc/dec's out.
>> E11: Correct on all (more by chance than design though :).
>
>SimH is different to the J11, yes.
But, again, I think he's being "generic". It makes sense with this
functionality which is never used.
>> (And, yes, to those who've asked before, I will inform Bob Supnik and
>> John Wilson about these differences (in the fullness of time when the
>> list is completed.))
>
>Cool.
However, there's nothing left on the SimH list now.
>> Going forward (sometime):
>>
>> o I still need to do some tests with RTS Rn and RTI. A slight
>> redesign of the utility is required for that.
>
>RTI? I could see potential for RTS as well as JSR, if the SP points to
>invalid memory. But RTI... Hmm... Am I thinking wrong here. But that
>could only come from a broken kernel SP, and a trap will then become a
>double trap, since you can't trap for the error without a stack.
>Or what am I missing? (Too tired to think more...)
I was thinking of an RTI on a good stack but where the popped PC/PSW
in fact point to unmapped memory. That would be quite common when the
kernel returns to user mode. The MMU trap will occur on the kernel
stack...but that trap should overwrite the popped PC/PSW...
(I have been thinking about double traps as well, but not a lot).
>> o I need to extend the testbed to also capture PSW NZVC flags before
>> and after instructions. Clearly ADC, ROL etc will fail if the
>> condition codes are not preserved. I don't expect errors, but, to
>> quote W.C. Fields, (or was it Fats Waller) one never knows, does
>> one.
>
>After, you have them on the stack. Before, just do a MFPS.
I have to rewrite the app a little. Tonight I was doing other stuff
(getting MicroPower Pascal off the floppies).
>> o More comparison between bus errors and page errors is needed.
>
>Not sure why. You tests above all clearly showed that at bus errors, no
>MMR registers are involved anyway.
Yeah, I guess so too, it's just that "diligence" thing...
>> o More instruction tests
>
>Always. :-)
I forgot one:
o Find out more about the E11 commands SET CPU NOFPBACKOUT and SET CPU
SR1.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-08 16:58 ` paramucho
@ 2012-02-08 22:29 ` Johnny Billquist
2012-02-10 13:12 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-08 22:29 UTC (permalink / raw)
On 2012-02-08 17:58, paramucho wrote:
> On Wed, 08 Feb 2012 17:03:02 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-08 14.34, paramucho wrote:
>>> On Tue, 07 Feb 2012 17:20:06 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>> <snip>
>>>
>>> I've updated the previous tests with J11 status:
>>>
>>>>> TEST0:
>>>>> In the first test, TEST00, we expect the trap to occur after after the
>>>>> source field. R0 should have advanced by 2 and the low byte of SR1
>>>>> should hold "20", meaning R0 has been incremented by two.
>>>>>
>>>>> SIMH:
>>>>> Test00: mov *(r0)+,(r0)+
>>>>> Before: R0=120000 SP=744 PC=2064
>>>>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=2064
>>> J11 is the same as SimH
>>>
>>>>> E11:
>>>>> Test00: mov *(r0)+,(r0)+
>>>>> Before: R0=120000 SP=744 PC=2064
>>>>> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2064
>>>>>
>>>>> As you can see E11 doesn't increment R0 and leaves SR1 null.
>>
>> So E11 does not behave like the J11, even when asked to, in this case.
>> But it does work correctly according to the architecture.
>
> Let's not go back to the "architecture" debate...we're never gonna
> agree. I've avoided the issue below with the terms "correct",
> "different" and "wrong".
Heh. Well, you can perhaps at least agree that according to the
perceived function of MMR1, E11s behavior is consistent with the idea of
how MMR1 is used, and any code written that use MMR1 will turn out the
correct result both with the E11 implementation as well as the J11
implementation, even though they behave differently in their
implementation of it.
There, now you don't have to take the word "architecture" in your mouth.
>>>> Other interesting tests:
>>>>
>>>> MOV (PC)+,(R0)+
>>>>
>>>> where R0 points to invalid memory. Should affect PC (or back it out), as
>>>> well as R0.
>>>
>>> In fact modifications of PC should not appear in SR1 at all and that's
>>> because the instruction itself is always restarted from the beginning.
>>
>> Not necessarily. The 11/44 and 11/70 (according to the manuals) will
>> update SR1 with modifications to the PC as well (page 164 in the
>> processor handbook for those models).
>> The text says:
>> "MMR1 records any autoincrement/decrement of the general purpose
>> registers, including explicit references through the PC."
>>
>> However, I'm not sure what the point of that is, since MMR2 will hold
>> the PC at the start of the instruction anyway, so you don't really need
>> to adjust the PC anyway.
>
> It's an oxymoron.
I wouldn't call it an oxymoron, but maybe me knowledge of english fails
me here.
It would only appear (to me) that the information is stored in two
places. They should end up with the same result at the end, but this is
just a case of redundancy.
>>> SimH gets this wrong:
>>>
>>> J11:
>>> Test06: mov (pc)+,*(r0)+
>>> Before: R0=120000 SP=744 PC=4166
>>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=4166
>>> ****
>>
>> J11 would appear to work differently than the 11/44 or 11/70. What is
>> the saved PC on the stack at this point? Has it been updated or not?
>
> The PC on the stack is always updated. At present my test program
> would crash if it wasn't. That's what I need to change to test RTI
> etc.
Is the PC on the stack updated by two, or by four? That is the question.
It should always at least have been updated by two, since the
instruction fetch have always taken place. And that update is not ever
reflected in MMR1. However, the additional two, from the (PC)+, should
be recorded in MMR1, if the PC on the stack has been incremented by 4.
>>> +++++++++++++++++++++++++
>>> TEST07:
>>> TEST08:
>>> TEST09:
>>> TEST10:
>>>> Also, something like the LDD instruction (FPP) could be used to check
>>>> for other increments, like 4 and 8, which should also be possible, as
>>>> well as partials perhaps, if the argument pointed to is partially
>>>> outside of valid memory.
>>>
>>> I'll deal with the four variations of this test together: single and
>>> double precision with the error at the start of the data area or
>>> halfway through it.
>>>
>>> SimH treats FPU instructions as it does the base instruction set as
>>> shown below: SR1 has the modifications made to R0 in SR1 in all cases
>>> below.
>>>
>>> SimH:
>>> Test07: ldf (r0)+,%0 ; 32-bit
>>> Before: R0=120000 SP=744 PC=4444 SR0=13
>>> After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4444
>>> ****** ****
> <snip>
>
>> That looked very reasonable.
>>
>>> However, the J11 FPU doesn't use SR1 to record register modifications.
>>> Instead, it acts more like E11, backing out the registers instead (or
>>> , more likely, not updating them until all accesses are complete).
>>>
>>> Thus, SimH is *different* on all the above tests. The fix here is more
>>> extensive, but the FPU source module is considerably easier to work
>>> with the main CPU module. It's probably a matter of using the internal
>>> MMR1 information to backout the registers.
>>>
>>> J11 and E11:
>>> Test07: ldf (r0)+,%0 ; 32-bit
>>> Before: R0=120000 SP=744 PC=4444 SR0=13
>>> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4444
> <snip>
>> Interesting.
>
>>> This J11 behavior may well be undocumented. There's no guarantee that
>>> this behavior is the same with earlier FPU implementations. We'd need
>>> an 11/45, and 11/40, an 11/34 etc to test that.
>
> I found the following comment in the SimH sources tonight:
>
> According to the PDP-11 Architecture Handbook, MMR1 records all
> autoincrement and autodecrement operations, including those which
> explicitly reference the PC. For the J-11, this is only true for
> autodecrement operands, autodecrement deferred operands, and
> autoincrement destination operands that involve a write to memory.
Wow, the J11 is rather more tricky. Interesting. It can partially back
out of these things then.
The reference is the same I read about in the Processor Handbook.
The comment is helpful, since obviously Bob have checked this then (come
to think of it, wasn't he even involved in the J11 microcode
development, or was it just the FPA microcode development?). Anyway, he
possibly knows a lot about the internals of the J11.
> The simulator follows the Handbook, for simplicity.
>
> The document he's referencing is here (and I think I used to have a
> copy of it):
>
> http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
Yes. That is the handbook that I referred to a few posts ago as well.
It's really a better source for how a PDP-11 should work (I won't call
it the architecture, since you object so much). But it leaves a lot up
to specific implementations on how to do things. Like the handling of
MMR1 in respect to backing out of changes. Which J11 takes advantage of.
Simh consiously chose to not fully simulate the J11 here.
That handbook is, by the way, just the last incarnation of the PDP-11
Processor Handbook. Unfortunately I don't have my copy where I'm sitting
(living). But if I remember right, it covers the T11, F11 and J11.
Possibly also the LSI11. It also touches on the 11/44, and I think the
11/34 and the 11/70 with friends. But most of the book is not about
specific implementations, but about the PDP-11 as such.
> So, Bob Supnik is stating here that he's not slavishly following the
> J11, so I'll just mark it "different" for the moment.
Right.
>> Definitely. Also, it would be interesting to see if J11 behaves the same
>> with and without the FPA.
>> I can (eventually) set up to test this on a real 11/70.
>
> It would be great to see if the older implementations actually do
> update PC and/or FPU instructions. What system runs on the 11/70...let
> me guess :-)
:-)
I'll need to start by just writing a small program that runs under RSX
and that presents me with the information. Once I have that up and
running, I can use it on all machines I have.
>>> +++++++++++++++++++++++++
>>> Summary:
>>>
>>> It's all a bit higgledy-piggledy above, so I'll summarise, using the
>>> J11 behavior as the benchmark, where:
>>>
>>> "Correct" means the same as the J11
>>>
>>> "Different" means not the same, but still functional.
>>> You may willing to accept these. I'm less so inclined.
>>>
>>> "Wrong" means a real bug (marked with ****).
>>>
>>> 1. Base and EIS instruction sets.
>>> SimH: Correct on all, except,
>>> **** Wrong for (PC) inc/dec's which should be ignored
>>> (because instruction restarts).
> Correction:
> Different for (PC) incs/decs (see source comment above)
>>
>> I'm not it should be classified as a bug. It depends on what the PC
>> pushed on the stack looks like. It might be fully correct, but not the
>> same as J11 (see other comments about this above).
>
> The comment from the source, shown above, shows he's being generic
> rather than specific to the J11.
Right. But unless Simh then also have pushed the "correct" PC on the
stack, Simh could have a bug here, or just be different. You cannot just
mess around with MMR1 without also making sure that the registers as
such have the correct values, with respect to MMR1 and state before the
trap.
>>> E11: Different on all because it backs modifications out.
>>> **** Wrong for MTPI because it doesn't backout the stack pop.
>>
>> Right. That's a clear bug.
>>
>>> 2. FPU instruction set.
>>> SimH: Different on all because it doesn't back inc/dec's out.
>>> E11: Correct on all (more by chance than design though :).
>>
>> SimH is different to the J11, yes.
>
> But, again, I think he's being "generic". It makes sense with this
> functionality which is never used.
Yes. But it means his simulation of a J11 is faulty. It does not behave
like a J11. But since nothing actually normally use this, it has not
really been a problem. Furthermore, Simh's implementation is not wrong.
It's just different than J11.
>>> (And, yes, to those who've asked before, I will inform Bob Supnik and
>>> John Wilson about these differences (in the fullness of time when the
>>> list is completed.))
>>
>> Cool.
>
> However, there's nothing left on the SimH list now.
>
>>> Going forward (sometime):
>>>
>>> o I still need to do some tests with RTS Rn and RTI. A slight
>>> redesign of the utility is required for that.
>>
>> RTI? I could see potential for RTS as well as JSR, if the SP points to
>> invalid memory. But RTI... Hmm... Am I thinking wrong here. But that
>> could only come from a broken kernel SP, and a trap will then become a
>> double trap, since you can't trap for the error without a stack.
>> Or what am I missing? (Too tired to think more...)
>
> I was thinking of an RTI on a good stack but where the popped PC/PSW
> in fact point to unmapped memory. That would be quite common when the
> kernel returns to user mode. The MMU trap will occur on the kernel
> stack...but that trap should overwrite the popped PC/PSW...
Um. The MMU will (as always) push the information on the kernel stack,
but it should not be any different from if your code just happens to run
off memory into non-existent memory in a straight program flow.
The RTI should not make any difference here, as far as I can tell. The
instruction fetch will trap. The updated PC should be pushed on the
kernel stack, and MMR1 should be 0.
Of course the old PC,PSW will be overwritten by the new. The old were
popped off the stack, and the data is dead. Then new data is pushed on
to the stack.
> (I have been thinking about double traps as well, but not a lot).
It's bad. :-)
>>> o I need to extend the testbed to also capture PSW NZVC flags before
>>> and after instructions. Clearly ADC, ROL etc will fail if the
>>> condition codes are not preserved. I don't expect errors, but, to
>>> quote W.C. Fields, (or was it Fats Waller) one never knows, does
>>> one.
>>
>> After, you have them on the stack. Before, just do a MFPS.
>
> I have to rewrite the app a little. Tonight I was doing other stuff
> (getting MicroPower Pascal off the floppies).
Saw that. Nice work.
>>> o More instruction tests
>>
>> Always. :-)
>
> I forgot one:
>
> o Find out more about the E11 commands SET CPU NOFPBACKOUT and SET CPU
> SR1.
Ah, yes. Those are still mysterious.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-08 22:29 ` Johnny Billquist
@ 2012-02-10 13:12 ` paramucho
2012-02-10 19:20 ` glen herrmannsfeldt
2012-02-10 19:29 ` Johnny Billquist
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-10 13:12 UTC (permalink / raw)
On Wed, 08 Feb 2012 23:29:52 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>>>>>> As you can see E11 doesn't increment R0 and leaves SR1 null.
>>>
>>> So E11 does not behave like the J11, even when asked to, in this case.
>>> But it does work correctly according to the architecture.
>>
>> Let's not go back to the "architecture" debate...we're never gonna
>> agree. I've avoided the issue below with the terms "correct",
>> "different" and "wrong".
>
>Heh. Well, you can perhaps at least agree that according to the
>perceived function of MMR1, E11s behavior is consistent with the idea of
>how MMR1 is used, and any code written that use MMR1 will turn out the
>correct result both with the E11 implementation as well as the J11
>implementation, even though they behave differently in their
>implementation of it.
>
>There, now you don't have to take the word "architecture" in your mouth.
Oh well, if you really want to go back there...
The piano-style keyboard was one of the early illustrative models for
the computer "architecture" (probably in THE MYTHICAL MAN MONTH). The
idea is that sheet music played on any (musical) keyboard will sound
the same, apart from timbre,, whether it's actually a piano, organ,
harpsichord etc. The analogy was sheet music=software,
"keyboard"=architecture, and implementations were "piano", "organ"
etc.
What the IBM 360 and the PDP-11 were trying to avoid was the earlier
approach where every change in the underlying technology led to a
completely new machine with a new architecture. Software had to be
rewritten, etc, etc.
Now, the problem for the PDP-11 was that it remained sensitive to
technology changes and frequently had to modify the architecture
because of the available technology. To use the earlier analogy of the
piano, sheet music played on the various PDP-11s would sound different
without changes to the sheet music.
I'll take that analogy a bit further. While all keyboards have the
same "architectural principles" there are some that have architectural
differences. On some (early) keyboards the 12 notes of the lowest
octave are not tuned chromatically but rather diatonically (to extend
the bass range). In the renaissance a few keyboards had two black keys
between the white keys (to handle different tuning systems). Now,
these are "architectural differences", not "implementation
differences" because they require changes to be made to the "sheet
music".
With these kinds of changes it becomes necessary to think of the
"keyboard" as a "base architecture" with different "model
architectures". The reason you must do this is because an
"implementation" is always the expression of an "architecture".
Changes such as removing odd address traps, address traps in general,
EAE vs EIS, FIS vs FPU and the like are "architectural differences"
not implementational differences, because they require alterations to
the "software".
Of course, there is a little bit of room to manouevre between
implementations of the architecture. But the latitude for these
"differences" must also be specified by the architecture. In the case
of the PDP-11 these "differences" were technology- or design-driven,
on a per-model basis, and thus it became necessary to restate the
architecture for each model.
The "PDP-11 Architecture Handbook" you mention was a largely
retrospective document rather than the working definition of the
architecture that generated the models. The working descriptions of
the "architecture" are documents such as that I've cited, e.g.
EK-KDJ1E-UG-001_KDJ11-E_CPU_Module_Users_Guide_Jan91 at bitsavers.
The VAX was much more like a "real architecture". There were
differences between VAXen but nothing like that seen on the PDP-11.
The VAX was released with a strong, definitive architectual
description. That document wasn't abstract or aspirational: it
specified the software machine.
To say that the "PDP-11 Architecture Handbook" was the working
architecture for the PDP-11 reduces "architecture" to an aspirational
goal. An architecture needs to provide the working description of an
implementation. With the PDP-11 they had to fudge. The PDP-11 sits
half-way between the pre-architectural and the full-architectural
generations.
The problem, for me, with your definition of "implementation" is that
for a given model there is no complete specific architectural
description available that precedes the model. That's why I treat the
documents, such as the document cited above, as the technical
descriptions. As noted, that document begins with a chapter on the
architecture".
When Bob Supnik chooses a particular interpretation of a particular
document as the basis of his SR1 code he's not working within the
specifications of a precisely defined (or precisely "undefined")
architecture but rather picking one of the many alternatives of a
poorly and only partially stated base architecture. We're doing the
same here: trying to work out what the architecture is because it's
not precisely stated anywhere in general terms. And the website
http://pdp2011.sytse.net/wordpress/, cited by another current thread,
also has references to SR1 and its multiple interpretations)
In other words, for the PDP-11 the line between "architecture" and
"implementation" is frequently blurred and frequently just a fiction.
<snip>
>>>> SimH gets this wrong:
>>>>
>>>> J11:
>>>> Test06: mov (pc)+,*(r0)+
>>>> Before: R0=120000 SP=744 PC=4166
>>>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=4166
>>>> ****
>>>
>>> J11 would appear to work differently than the 11/44 or 11/70. What is
>>> the saved PC on the stack at this point? Has it been updated or not?
>>
>> The PC on the stack is always updated. At present my test program
>> would crash if it wasn't. That's what I need to change to test RTI
>> etc.
>
>Is the PC on the stack updated by two, or by four? That is the question.
>It should always at least have been updated by two, since the
>instruction fetch have always taken place. And that update is not ever
>reflected in MMR1. However, the additional two, from the (PC)+, should
>be recorded in MMR1, if the PC on the stack has been incremented by 4.
It's incremented by four. If it wasn't my progam would crash. The PC
itself is always incremented by the full and correct amount in these
tests, except for those which test RTI etc.
>>>> This J11 behavior may well be undocumented. There's no guarantee that
>>>> this behavior is the same with earlier FPU implementations. We'd need
>>>> an 11/45, and 11/40, an 11/34 etc to test that.
>>
>> I found the following comment in the SimH sources tonight:
>>
>> According to the PDP-11 Architecture Handbook, MMR1 records all
>> autoincrement and autodecrement operations, including those which
>> explicitly reference the PC. For the J-11, this is only true for
>> autodecrement operands, autodecrement deferred operands, and
>> autoincrement destination operands that involve a write to memory.
>
>Wow, the J11 is rather more tricky. Interesting. It can partially back
>out of these things then.
>The reference is the same I read about in the Processor Handbook.
>
>The comment is helpful, since obviously Bob have checked this then (come
>to think of it, wasn't he even involved in the J11 microcode
>development, or was it just the FPA microcode development?). Anyway, he
>possibly knows a lot about the internals of the J11.
>
>> The simulator follows the Handbook, for simplicity.
>>
>> The document he's referencing is here (and I think I used to have a
>> copy of it):
>>
>> http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
>
>Yes. That is the handbook that I referred to a few posts ago as well.
>It's really a better source for how a PDP-11 should work (I won't call
>it the architecture, since you object so much). But it leaves a lot up
>to specific implementations on how to do things. Like the handling of
>MMR1 in respect to backing out of changes. Which J11 takes advantage of.
>Simh consiously chose to not fully simulate the J11 here.
>
>That handbook is, by the way, just the last incarnation of the PDP-11
>Processor Handbook. Unfortunately I don't have my copy where I'm sitting
>(living). But if I remember right, it covers the T11, F11 and J11.
>Possibly also the LSI11. It also touches on the 11/44, and I think the
>11/34 and the 11/70 with friends. But most of the book is not about
>specific implementations, but about the PDP-11 as such.
But as I've said above, it's an often retrospective document.
Architectures are not retrospective, they are working specifications
of new implementations. The point I'm making about the PDP-11 is that
it didn't stick to the architecture (unless you reduce the term
"architecture" to something very fuzzy, almost aspirational).
>> So, Bob Supnik is stating here that he's not slavishly following the
>> J11, so I'll just mark it "different" for the moment.
>
>Right.
>
>>> Definitely. Also, it would be interesting to see if J11 behaves the same
>>> with and without the FPA.
>>> I can (eventually) set up to test this on a real 11/70.
>>
>> It would be great to see if the older implementations actually do
>> update PC and/or FPU instructions. What system runs on the 11/70...let
>> me guess :-)
>
>:-)
>
>I'll need to start by just writing a small program that runs under RSX
>and that presents me with the information. Once I have that up and
>running, I can use it on all machines I have.
I'll send you my code, although it won't help much. My C code is
actually in a pre-processor language and the MACRO code is not
stand-alone. But at least it will synch our efforts.
>>>> +++++++++++++++++++++++++
>>>> Summary:
>>>>
>>>> It's all a bit higgledy-piggledy above, so I'll summarise, using the
>>>> J11 behavior as the benchmark, where:
>>>>
>>>> "Correct" means the same as the J11
>>>>
>>>> "Different" means not the same, but still functional.
>>>> You may willing to accept these. I'm less so inclined.
>>>>
>>>> "Wrong" means a real bug (marked with ****).
>>>>
>>>> 1. Base and EIS instruction sets.
>>>> SimH: Correct on all, except,
>>>> **** Wrong for (PC) inc/dec's which should be ignored
>>>> (because instruction restarts).
>> Correction:
>> Different for (PC) incs/decs (see source comment above)
>>>
>>> I'm not it should be classified as a bug. It depends on what the PC
>>> pushed on the stack looks like. It might be fully correct, but not the
>>> same as J11 (see other comments about this above).
>>
>> The comment from the source, shown above, shows he's being generic
>> rather than specific to the J11.
>
>Right. But unless Simh then also have pushed the "correct" PC on the
>stack, Simh could have a bug here, or just be different. You cannot just
>mess around with MMR1 without also making sure that the registers as
>such have the correct values, with respect to MMR1 and state before the
>trap.
But that's exactly what the note from his source above says. The idea
is that the machine provides updates for R7=PC but that the updating
software ignores them. Note, the update information, when present, is
provided only for data references, not for PC instructions. I guess
the idea was that the software would be able to determine which
operand was at fault.
<snip>
>>>> o I still need to do some tests with RTS Rn and RTI. A slight
>>>> redesign of the utility is required for that.
>>>
>>> RTI? I could see potential for RTS as well as JSR, if the SP points to
>>> invalid memory. But RTI... Hmm... Am I thinking wrong here. But that
>>> could only come from a broken kernel SP, and a trap will then become a
>>> double trap, since you can't trap for the error without a stack.
>>> Or what am I missing? (Too tired to think more...)
>>
>> I was thinking of an RTI on a good stack but where the popped PC/PSW
>> in fact point to unmapped memory. That would be quite common when the
>> kernel returns to user mode. The MMU trap will occur on the kernel
>> stack...but that trap should overwrite the popped PC/PSW...
>
>Um. The MMU will (as always) push the information on the kernel stack,
>but it should not be any different from if your code just happens to run
>off memory into non-existent memory in a straight program flow.
>
>The RTI should not make any difference here, as far as I can tell. The
>instruction fetch will trap. The updated PC should be pushed on the
>kernel stack, and MMR1 should be 0.
>
>Of course the old PC,PSW will be overwritten by the new. The old were
>popped off the stack, and the data is dead. Then new data is pushed on
>to the stack.
TEST15:
You're correct, and there are three identical results. Isn't it nice.
J11:
SIMH:
E11:
Test15: *rti
Before: R0=100004 SP=740 PC=6612
After: R0=100004 SP=744 Err=0 SR0=100011 SR1=[0|0] SR2=100004
TEST16:
However, leading on from that starting point I looked at an RTI in
user mode. The user mode stack maps the RTI PC but not the PSW. The
trap is taken in kernel mode of course, so the user mode stack is not
overwritten. In this R0 records the user mode SP.
SimH has a backed-out result and an unaltered user mode stack. The J11
upates SR1 and shows the double pop in the user mode stack.
SimH:
Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
Before: R0=77776 SP=744 PC=7174
After: R0=77776 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174
J11:
Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
Before: R0=77776 SP=744 PC=7174
After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[26|26] SR2=7174
E11 gets it wrong. The stack is double-popped and, of course, there is
no update information.
E11
Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
Before: R0=77776 SP=744 PC=7174
After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174
TEST17:
This is pretty much the same test as TEST16 using RETURN (RTS PC). The
results are analogous to the previous test:
SimH:
Test17: *return ; [*pc] r0 = user mode stack (unmapped)
Before: R0=100000 SP=744 PC=7562
After: R0=100000 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7562
J11:
Test17: *return ; [*pc] r0 = user mode stack (unmapped)
Before: R0=100000 SP=744 PC=7562
After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[0|26] SR2=7562
E11:
Test17: *rti ; [*pc] r0 = user mode stack (unmapped)
Before: R0=100000 SP=744 PC=7562 SR0=1
After: R0=100000 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7562
Now, in the earlier tests we've been blithely talking about E11 as
backing-out SR1. But I think what we're seeing is just John's software
realization of the PDP-11 with no particular thought of SR1. In that
context the earlier MFPI problem and the issue in these two tests are
not so much errors as a lack of SR1 implementation.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-10 13:12 ` paramucho
@ 2012-02-10 19:20 ` glen herrmannsfeldt
2012-02-11 13:12 ` paramucho
2012-02-10 19:29 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-10 19:20 UTC (permalink / raw)
In vmsnet.pdp-11 paramucho <paramucho@hotmail.com> wrote:
(snip)
> What the IBM 360 and the PDP-11 were trying to avoid was the earlier
> approach where every change in the underlying technology led to a
> completely new machine with a new architecture. Software had to be
> rewritten, etc, etc.
It was the defining feature for S/360. At the time, IBM had many
different and imcompatible machines. Even within the categories
of scientific and business machines there were many differences.
Even so, it seems likely that IBM didn't expect it to last
for 50 years, yet current z/Architecture machines are backward
compatible to S/360 in problem (not supervisor) state. Compilers
written for S/360 in Assembler still run on z/OS, as does the
generated code.
> Now, the problem for the PDP-11 was that it remained sensitive to
> technology changes and frequently had to modify the architecture
> because of the available technology. To use the earlier analogy of the
> piano, sheet music played on the various PDP-11s would sound different
> without changes to the sheet music.
It does seem like IBM did better at keeping its architecture
consistent through the generations. Maybe partly luck, and
partly that things were more clearly defined in the first place.
S/360 and S/370, with 24 bit addressing, were followed by XA/370
with 31 bit addressing, yet compatible with 24 bit code.
Many instructions have to work differently in 24 bit mode
than 31 bit, but all carefully designed to stay compatible.
When the PDP-11 was extended to VAX-11, DEC included compatibility
mode, but not quite as seamless as XA/370. Still, they did keep
the PDP-11 floating point formats, strange as they were, to
maintain compatibility. When extended precision (128 bit)
floating point was added to S/360, it was done such that it
was relativly easy to do in software emulation on older S/360
models. That form was then standard on S/370 and later.
> I'll take that analogy a bit further. While all keyboards have the
> same "architectural principles" there are some that have architectural
> differences. On some (early) keyboards the 12 notes of the lowest
> octave are not tuned chromatically but rather diatonically (to extend
> the bass range). In the renaissance a few keyboards had two black keys
> between the white keys (to handle different tuning systems). Now,
> these are "architectural differences", not "implementation
> differences" because they require changes to be made to the "sheet
> music".
With appropriate definitions and mode selection, it might have
been possible to do a backward compatible implementation.
> With these kinds of changes it becomes necessary to think of the
> "keyboard" as a "base architecture" with different "model
> architectures". The reason you must do this is because an
> "implementation" is always the expression of an "architecture".
> Changes such as removing odd address traps, address traps in general,
> EAE vs EIS, FIS vs FPU and the like are "architectural differences"
> not implementational differences, because they require alterations to
> the "software".
> Of course, there is a little bit of room to manouevre between
> implementations of the architecture. But the latitude for these
> "differences" must also be specified by the architecture. In the case
> of the PDP-11 these "differences" were technology- or design-driven,
> on a per-model basis, and thus it became necessary to restate the
> architecture for each model.
IBM had some model differences. Each model had a "Functional
Characteristics" manual giving the model specific description.
Much of that it timing, which is specifically left open in
the architecture. The 360/91 floating point processor generates
a rounded quotient, where the architecture specifies truncation.
That is noted in the Functional Characteristics, as are other
differences due to out of order execution. But there is extra
logic in the 360/91 to allow for self-modifying code, in the
case of prefetched instructions.
> The "PDP-11 Architecture Handbook" you mention was a largely
> retrospective document rather than the working definition of the
> architecture that generated the models. The working descriptions of
> the "architecture" are documents such as that I've cited, e.g.
> EK-KDJ1E-UG-001_KDJ11-E_CPU_Module_Users_Guide_Jan91 at bitsavers.
The published VAX Architecture manual is somewhat later, but
presumably there was an internal working document earlier.
> The VAX was much more like a "real architecture". There were
> differences between VAXen but nothing like that seen on the PDP-11.
> The VAX was released with a strong, definitive architectual
> description. That document wasn't abstract or aspirational: it
> specified the software machine.
It didn't last quite as long as they may have hoped, but
not so bad, either.
> To say that the "PDP-11 Architecture Handbook" was the working
> architecture for the PDP-11 reduces "architecture" to an aspirational
> goal. An architecture needs to provide the working description of an
> implementation. With the PDP-11 they had to fudge. The PDP-11 sits
> half-way between the pre-architectural and the full-architectural
> generations.
> The problem, for me, with your definition of "implementation" is that
> for a given model there is no complete specific architectural
> description available that precedes the model. That's why I treat the
> documents, such as the document cited above, as the technical
> descriptions. As noted, that document begins with a chapter on the
> architecture".
(snip, much of it on the MMR registers)
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-10 13:12 ` paramucho
2012-02-10 19:20 ` glen herrmannsfeldt
@ 2012-02-10 19:29 ` Johnny Billquist
2012-02-11 13:15 ` paramucho
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-10 19:29 UTC (permalink / raw)
On 2012-02-10 14.12, paramucho wrote:
> On Wed, 08 Feb 2012 23:29:52 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>>>>>>> As you can see E11 doesn't increment R0 and leaves SR1 null.
>>>>
>>>> So E11 does not behave like the J11, even when asked to, in this case.
>>>> But it does work correctly according to the architecture.
>>>
>>> Let's not go back to the "architecture" debate...we're never gonna
>>> agree. I've avoided the issue below with the terms "correct",
>>> "different" and "wrong".
>>
>> Heh. Well, you can perhaps at least agree that according to the
>> perceived function of MMR1, E11s behavior is consistent with the idea of
>> how MMR1 is used, and any code written that use MMR1 will turn out the
>> correct result both with the E11 implementation as well as the J11
>> implementation, even though they behave differently in their
>> implementation of it.
>>
>> There, now you don't have to take the word "architecture" in your mouth.
>
> Oh well, if you really want to go back there...
I tried phrasing it to avoid the term "architecture", but still just
look at the behavior of MMR1, which can be done in several ways
(obviously), but still be "right".
If you really want me to comment on the whole text, let me know. I'll
happily point out weaknesses in your analogies (just starting with the
fact that analogies are always problematic, as they are just that,
analogies). :-)
(Oh, and that the VAX is no way as clear cut as you seem to think, or
what is your take on the vector option, or the various subsets that were
defined later on?)
> <snip>
>>>>> SimH gets this wrong:
>>>>>
>>>>> J11:
>>>>> Test06: mov (pc)+,*(r0)+
>>>>> Before: R0=120000 SP=744 PC=4166
>>>>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=4166
>>>>> ****
>>>>
>>>> J11 would appear to work differently than the 11/44 or 11/70. What is
>>>> the saved PC on the stack at this point? Has it been updated or not?
>>>
>>> The PC on the stack is always updated. At present my test program
>>> would crash if it wasn't. That's what I need to change to test RTI
>>> etc.
>>
>> Is the PC on the stack updated by two, or by four? That is the question.
>> It should always at least have been updated by two, since the
>> instruction fetch have always taken place. And that update is not ever
>> reflected in MMR1. However, the additional two, from the (PC)+, should
>> be recorded in MMR1, if the PC on the stack has been incremented by 4.
>
> It's incremented by four. If it wasn't my progam would crash. The PC
> itself is always incremented by the full and correct amount in these
> tests, except for those which test RTI etc.
Aha. So I'd say that J11 in essence is doing wrong. It have updated the
PC more than just the instruction fetch, but this is not reflected in MMR1.
The processor handbooks say it should update MMR1.
So, a program that does a rollback cannot do it right with regards to
the PC, but have to use MMR2 for that.
Why would your program crash if the PC wasn't incremented by 4, by the
way???
>>> The simulator follows the Handbook, for simplicity.
>>>
>>> The document he's referencing is here (and I think I used to have a
>>> copy of it):
>>>
>>> http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
>>
>> Yes. That is the handbook that I referred to a few posts ago as well.
>> It's really a better source for how a PDP-11 should work (I won't call
>> it the architecture, since you object so much). But it leaves a lot up
>> to specific implementations on how to do things. Like the handling of
>> MMR1 in respect to backing out of changes. Which J11 takes advantage of.
>> Simh consiously chose to not fully simulate the J11 here.
>>
>> That handbook is, by the way, just the last incarnation of the PDP-11
>> Processor Handbook. Unfortunately I don't have my copy where I'm sitting
>> (living). But if I remember right, it covers the T11, F11 and J11.
>> Possibly also the LSI11. It also touches on the 11/44, and I think the
>> 11/34 and the 11/70 with friends. But most of the book is not about
>> specific implementations, but about the PDP-11 as such.
>
> But as I've said above, it's an often retrospective document.
It was written way before the 11/93 came about. It was even written
before the 11/83 came about.
But I agree that it's a book that got updated after each new processor
was done, so that it held information that were relevant to the readers.
> Architectures are not retrospective, they are working specifications
> of new implementations. The point I'm making about the PDP-11 is that
> it didn't stick to the architecture (unless you reduce the term
> "architecture" to something very fuzzy, almost aspirational).
And I disagree. The different PDP-11s were not implemented out of a blue
sky, but did actually follow some principles defined way back in 1969.
The PDP-11 architecture.
If they didn't follow that, then the machines would not have been
usable. There is a reason why RT-11 and RSX will work on all different
PDP-11 models. They implement the same architecture.
>>>> Definitely. Also, it would be interesting to see if J11 behaves the same
>>>> with and without the FPA.
>>>> I can (eventually) set up to test this on a real 11/70.
>>>
>>> It would be great to see if the older implementations actually do
>>> update PC and/or FPU instructions. What system runs on the 11/70...let
>>> me guess :-)
>>
>> :-)
>>
>> I'll need to start by just writing a small program that runs under RSX
>> and that presents me with the information. Once I have that up and
>> running, I can use it on all machines I have.
>
> I'll send you my code, although it won't help much. My C code is
> actually in a pre-processor language and the MACRO code is not
> stand-alone. But at least it will synch our efforts.
Cool. But yeah, I'll probably rewrite the stuff in MACRO-11 then. But
it's nice if we have a common concept of what each test checks for, and
how it do it.
>>>>> +++++++++++++++++++++++++
>>>>> Summary:
>>>>>
>>>>> It's all a bit higgledy-piggledy above, so I'll summarise, using the
>>>>> J11 behavior as the benchmark, where:
>>>>>
>>>>> "Correct" means the same as the J11
>>>>>
>>>>> "Different" means not the same, but still functional.
>>>>> You may willing to accept these. I'm less so inclined.
>>>>>
>>>>> "Wrong" means a real bug (marked with ****).
>>>>>
>>>>> 1. Base and EIS instruction sets.
>>>>> SimH: Correct on all, except,
>>>>> **** Wrong for (PC) inc/dec's which should be ignored
>>>>> (because instruction restarts).
>>> Correction:
>>> Different for (PC) incs/decs (see source comment above)
>>>>
>>>> I'm not it should be classified as a bug. It depends on what the PC
>>>> pushed on the stack looks like. It might be fully correct, but not the
>>>> same as J11 (see other comments about this above).
>>>
>>> The comment from the source, shown above, shows he's being generic
>>> rather than specific to the J11.
>>
>> Right. But unless Simh then also have pushed the "correct" PC on the
>> stack, Simh could have a bug here, or just be different. You cannot just
>> mess around with MMR1 without also making sure that the registers as
>> such have the correct values, with respect to MMR1 and state before the
>> trap.
>
> But that's exactly what the note from his source above says. The idea
> is that the machine provides updates for R7=PC but that the updating
> software ignores them. Note, the update information, when present, is
> provided only for data references, not for PC instructions. I guess
> the idea was that the software would be able to determine which
> operand was at fault.
Not sure I understand what you are saying.
Bob states that he's not doing as the J11, yes. He instead updates MMR1
with all PC modifications as well. So far all good. But, unless the
pushed PC for the trap also have that updated value, the contents of
MMR1 would be wrong. You need to push both the updated PC, and update
MMR1, or else do neither, to do it right.
As for "PC instructions", I assume you mean things like branching and
jumping? Any such modifications will never have taken effect on the PC
in the case of a trap.
If you do a:
JMP @(PC)+
<illegal memory pointer>
the MMR1 should show R7 modified by 2, and the PC on the stack should
point to the next instruction.
By the way, the stack and PC modifications of a MARK instruction are
also guaranteed to never have been done in case of a trap.
>>>>> o I still need to do some tests with RTS Rn and RTI. A slight
>>>>> redesign of the utility is required for that.
>>>>
>>>> RTI? I could see potential for RTS as well as JSR, if the SP points to
>>>> invalid memory. But RTI... Hmm... Am I thinking wrong here. But that
>>>> could only come from a broken kernel SP, and a trap will then become a
>>>> double trap, since you can't trap for the error without a stack.
>>>> Or what am I missing? (Too tired to think more...)
>>>
>>> I was thinking of an RTI on a good stack but where the popped PC/PSW
>>> in fact point to unmapped memory. That would be quite common when the
>>> kernel returns to user mode. The MMU trap will occur on the kernel
>>> stack...but that trap should overwrite the popped PC/PSW...
>>
>> Um. The MMU will (as always) push the information on the kernel stack,
>> but it should not be any different from if your code just happens to run
>> off memory into non-existent memory in a straight program flow.
>>
>> The RTI should not make any difference here, as far as I can tell. The
>> instruction fetch will trap. The updated PC should be pushed on the
>> kernel stack, and MMR1 should be 0.
>>
>> Of course the old PC,PSW will be overwritten by the new. The old were
>> popped off the stack, and the data is dead. Then new data is pushed on
>> to the stack.
>
> TEST15:
> You're correct, and there are three identical results. Isn't it nice.
Isn't??? I'd say anything but actually doing it this way is what I would
have called not nice.
> J11:
> SIMH:
> E11:
> Test15: *rti
> Before: R0=100004 SP=740 PC=6612
> After: R0=100004 SP=744 Err=0 SR0=100011 SR1=[0|0] SR2=100004
Thank god.
> TEST16:
> However, leading on from that starting point I looked at an RTI in
> user mode. The user mode stack maps the RTI PC but not the PSW. The
> trap is taken in kernel mode of course, so the user mode stack is not
> overwritten. In this R0 records the user mode SP.
>
> SimH has a backed-out result and an unaltered user mode stack. The J11
> upates SR1 and shows the double pop in the user mode stack.
>
> SimH:
> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
> Before: R0=77776 SP=744 PC=7174
> After: R0=77776 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174
>
> J11:
> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
> Before: R0=77776 SP=744 PC=7174
> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[26|26] SR2=7174
Both are architecturally correct, but different.
> E11 gets it wrong. The stack is double-popped and, of course, there is
> no update information.
>
> E11
> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
> Before: R0=77776 SP=744 PC=7174
> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174
Ouch. Bad. Another bug. :-)
> TEST17:
> This is pretty much the same test as TEST16 using RETURN (RTS PC). The
> results are analogous to the previous test:
>
> SimH:
> Test17: *return ; [*pc] r0 = user mode stack (unmapped)
> Before: R0=100000 SP=744 PC=7562
> After: R0=100000 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7562
>
> J11:
> Test17: *return ; [*pc] r0 = user mode stack (unmapped)
> Before: R0=100000 SP=744 PC=7562
> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[0|26] SR2=7562
>
> E11:
> Test17: *rti ; [*pc] r0 = user mode stack (unmapped)
> Before: R0=100000 SP=744 PC=7562 SR0=1
> After: R0=100000 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7562
E11 and SimH behaving the same way.
> Now, in the earlier tests we've been blithely talking about E11 as
> backing-out SR1. But I think what we're seeing is just John's software
> realization of the PDP-11 with no particular thought of SR1. In that
> context the earlier MFPI problem and the issue in these two tests are
> not so much errors as a lack of SR1 implementation.
You might very well be right on that.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-11 13:12 UTC (permalink / raw)
On Fri, 10 Feb 2012 19:20:42 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:
>In vmsnet.pdp-11 paramucho <paramucho@hotmail.com> wrote:
>
>(snip)
>> What the IBM 360 and the PDP-11 were trying to avoid was the earlier
>> approach where every change in the underlying technology led to a
>> completely new machine with a new architecture. Software had to be
>> rewritten, etc, etc.
>
>It was the defining feature for S/360. At the time, IBM had many
>different and imcompatible machines. Even within the categories
>of scientific and business machines there were many differences.
>
>Even so, it seems likely that IBM didn't expect it to last
>for 50 years, yet current z/Architecture machines are backward
>compatible to S/360 in problem (not supervisor) state. Compilers
>written for S/360 in Assembler still run on z/OS, as does the
>generated code.
It is remarkable that IBM and DEC both had "thinkers" in key positions
at the time. Thomas Brooks' MYTHICAL MAN MONTH evolves the (radical
for IBM then) ideas that user friendliness and small teams were the
way to go. That's what DEC were doing. Gordon Bell's two key books
include a study of IBM machines, including the 360. Both of Bell's
books are on-line.
http://research.microsoft.com/en-us/um/people/gbell/Computer_Engineering/index.html
http://research.microsoft.com/en-us/um/people/gbell/Computer_Structures__Readings_and_Examples/index.html
>> Now, the problem for the PDP-11 was that it remained sensitive to
>> technology changes and frequently had to modify the architecture
>> because of the available technology. To use the earlier analogy of the
>> piano, sheet music played on the various PDP-11s would sound different
>> without changes to the sheet music.
>
>It does seem like IBM did better at keeping its architecture
>consistent through the generations. Maybe partly luck, and
>partly that things were more clearly defined in the first place.
IBM had "process" completely under control. Brooks could hire a 1000
programmers and the IBM internal systems just took over. DEC was run
by cowboys pioneering in the wild west. Gordon Bell rarely knew what
his engineers were really doing.
I used to be heavily involved in DECUS Europe and I pushed for Bell to
come over and give a keynote address. He was quite amazing and
presented a picture of himself ensconced in his office along with his
mania for making charts of everything. He never got what he wanted
from his engineers. He loved what they did, but it wasn't what he
needed. So he made this beautiful chart where he mapped what he knew
were all the favorite habits of each of his designers, and then, to
get the products he wanted, he simply selected the right group of
"habits" to form teams. He was a lot of fun.
In other papers he describes an emotionally-charged decision making
process. Bob Supnik's on-line papers paint the same picture. There was
one case where they made an official decision to build a particular
system but simply never got around to doing it. This is "seat of your
pants" stuff.
In retrospect, the PDP-11 was the learning curve they needed for the
VAX. If you go back and look at the early PDP-11 documentation you see
a company that has yet to invent itself.
>S/360 and S/370, with 24 bit addressing, were followed by XA/370
>with 31 bit addressing, yet compatible with 24 bit code.
>Many instructions have to work differently in 24 bit mode
>than 31 bit, but all carefully designed to stay compatible.
>
>When the PDP-11 was extended to VAX-11, DEC included compatibility
>mode, but not quite as seamless as XA/370. Still, they did keep
>the PDP-11 floating point formats, strange as they were, to
>maintain compatibility. When extended precision (128 bit)
>floating point was added to S/360, it was done such that it
>was relativly easy to do in software emulation on older S/360
>models. That form was then standard on S/370 and later.
"Never trust a computer with a compatibility mode bit". I think
someone from Data General said that.
>> I'll take that analogy a bit further. While all keyboards have the
>> same "architectural principles" there are some that have architectural
>> differences. On some (early) keyboards the 12 notes of the lowest
>> octave are not tuned chromatically but rather diatonically (to extend
>> the bass range). In the renaissance a few keyboards had two black keys
>> between the white keys (to handle different tuning systems). Now,
>> these are "architectural differences", not "implementation
>> differences" because they require changes to be made to the "sheet
>> music".
>
>With appropriate definitions and mode selection, it might have
>been possible to do a backward compatible implementation.
Like most innovations, they were short-lived. No-one figured out how
to play the two-black key models. The diatonic octave is restricted
pretty much to organ pedal keyboards, although I'm sure there are
still vintage keyboards out there somewhere.
>> With these kinds of changes it becomes necessary to think of the
>> "keyboard" as a "base architecture" with different "model
>> architectures". The reason you must do this is because an
>> "implementation" is always the expression of an "architecture".
>
>> Changes such as removing odd address traps, address traps in general,
>> EAE vs EIS, FIS vs FPU and the like are "architectural differences"
>> not implementational differences, because they require alterations to
>> the "software".
>
>> Of course, there is a little bit of room to manouevre between
>> implementations of the architecture. But the latitude for these
>> "differences" must also be specified by the architecture. In the case
>> of the PDP-11 these "differences" were technology- or design-driven,
>> on a per-model basis, and thus it became necessary to restate the
>> architecture for each model.
>
>IBM had some model differences. Each model had a "Functional
>Characteristics" manual giving the model specific description.
>Much of that it timing, which is specifically left open in
>the architecture. The 360/91 floating point processor generates
>a rounded quotient, where the architecture specifies truncation.
>That is noted in the Functional Characteristics, as are other
>differences due to out of order execution. But there is extra
>logic in the 360/91 to allow for self-modifying code, in the
>case of prefetched instructions.
A mixture of architectural and implementational differences or
variations. Or, more honestly, "trade-offs" in many cases.
>> The "PDP-11 Architecture Handbook" you mention was a largely
>> retrospective document rather than the working definition of the
>> architecture that generated the models. The working descriptions of
>> the "architecture" are documents such as that I've cited, e.g.
>> EK-KDJ1E-UG-001_KDJ11-E_CPU_Module_Users_Guide_Jan91 at bitsavers.
>
>The published VAX Architecture manual is somewhat later, but
>presumably there was an internal working document earlier.
I used to have that somewhere. I think it was printed on recycled
paper.
>> The VAX was much more like a "real architecture". There were
>> differences between VAXen but nothing like that seen on the PDP-11.
>> The VAX was released with a strong, definitive architectual
>> description. That document wasn't abstract or aspirational: it
>> specified the software machine.
>
>It didn't last quite as long as they may have hoped, but
>not so bad, either.
But VMS is alive and well, living in "bliss"... DEC thought of
themselves too much as a hardware company, but I think their lasting
innovations were in software. I have the VMS source fiches for V3x,and
maybe V4. They're quite magical--to see this small group of software
engineers ripping out page after page of excellent code. Volumes of
it. VMS isn't my favorite working environment, but the code is a
monument to an understanding of what an O/S is.
CPU architectures have lost their central role. Today it's the
"software architectures", and principally based on the two streams
which emanated from the PDP-11 and VAX: the VMS/Windows stream and the
Unix stream.
>> To say that the "PDP-11 Architecture Handbook" was the working
>> architecture for the PDP-11 reduces "architecture" to an aspirational
>> goal. An architecture needs to provide the working description of an
>> implementation. With the PDP-11 they had to fudge. The PDP-11 sits
>> half-way between the pre-architectural and the full-architectural
>> generations.
>
>> The problem, for me, with your definition of "implementation" is that
>> for a given model there is no complete specific architectural
>> description available that precedes the model. That's why I treat the
>> documents, such as the document cited above, as the technical
>> descriptions. As noted, that document begins with a chapter on the
>> architecture".
It really has been a debate about "words"...
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-10 19:29 ` Johnny Billquist
@ 2012-02-11 13:15 ` paramucho
2012-02-11 21:09 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-11 13:15 UTC (permalink / raw)
On Fri, 10 Feb 2012 20:29:24 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>>> There, now you don't have to take the word "architecture" in your mouth.
>>
>> Oh well, if you really want to go back there...
>
>I tried phrasing it to avoid the term "architecture", but still just
>look at the behavior of MMR1, which can be done in several ways
>(obviously), but still be "right".
Yeah, but you were still using the term all over the post...
>If you really want me to comment on the whole text, let me know. I'll
>happily point out weaknesses in your analogies (just starting with the
>fact that analogies are always problematic, as they are just that,
>analogies). :-)
Do whatever you want! It's no big thing...
>(Oh, and that the VAX is no way as clear cut as you seem to think, or
>what is your take on the vector option, or the various subsets that were
>defined later on?)
These are clearly architectural variations. The question then is, was
a new architectural specification provided in a timely manner which
clearly described the architectural variations. The "architecture" is
a document and potentially a set of tests as well. It may be varied,
but it is varied by an update to the architectural specification, not
de facto by an unspecified modifications in some particular model.
<snip?
>> It's incremented by four. If it wasn't my progam would crash. The PC
>> itself is always incremented by the full and correct amount in these
>> tests, except for those which test RTI etc.
>
>Aha. So I'd say that J11 in essence is doing wrong. It have updated the
>PC more than just the instruction fetch, but this is not reflected in MMR1.
>The processor handbooks say it should update MMR1.
>So, a program that does a rollback cannot do it right with regards to
>the PC, but have to use MMR2 for that.
The fact there can even be a question about whether it's right or
wrong indicates the lack of a clear reference architecture. This is
not rocket science.
>Why would your program crash if the PC wasn't incremented by 4, by the
>way???
Because my code is very simple:
[setup code]
test instruction
[report code]
When the test instruction crashs the trap ISR simply registers the
fact and RTI's with the C-bit and V-bit set. If the RTI PC was wrong
then my test code would presumably fail. Note, the code which actually
tests RTI, RETURN, JMP etc has a workaround.
Of course there are better ways to do these things, but I was in a
hurry and this is throw-away code...
>>>> The simulator follows the Handbook, for simplicity.
>>>>
>>>> The document he's referencing is here (and I think I used to have a
>>>> copy of it):
>>>>
>>>> http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
>>>
>>> Yes. That is the handbook that I referred to a few posts ago as well.
>>> It's really a better source for how a PDP-11 should work (I won't call
>>> it the architecture, since you object so much). But it leaves a lot up
>>> to specific implementations on how to do things. Like the handling of
>>> MMR1 in respect to backing out of changes. Which J11 takes advantage of.
>>> Simh consiously chose to not fully simulate the J11 here.
>>>
>>> That handbook is, by the way, just the last incarnation of the PDP-11
>>> Processor Handbook. Unfortunately I don't have my copy where I'm sitting
>>> (living). But if I remember right, it covers the T11, F11 and J11.
>>> Possibly also the LSI11. It also touches on the 11/44, and I think the
>>> 11/34 and the 11/70 with friends. But most of the book is not about
>>> specific implementations, but about the PDP-11 as such.
>>
>> But as I've said above, it's an often retrospective document.
>
>It was written way before the 11/93 came about. It was even written
>before the 11/83 came about.
I wasn't applying that book to the 11/8x or 11/9x, but to the CPUs
which it described.
>But I agree that it's a book that got updated after each new processor
>was done, so that it held information that were relevant to the readers.
I don't recall that manual being updated after each significant new
CPU and I'm not even sure their was an "Architecture Handbook" which
covered the 11/8x and 11/9x CPU's?
BTW: there was an early architectural spec in one of Gordon Bell's
books. Interestingly it has a completely different FPU instruction set
and also lists a double-word instruction set.
http://research.microsoft.com/en-us/um/people/gbell/Computer_Engineering/index.html
Page 257 describes a floating point instruction set which is much
close to FIS but also include FMOVE and FNEG. A double word
instruction set is also presented: DMOVE, DADD, ..., DNEG.
The operations were to be implemented with two-word instructions, the
first being: "enter floating point mode and execute one instruction."
The second word would have had full source and destination register
specifications. I would have loved to have had the double-word ops.
All the hassle we had with EIS addressing restrictions and lack of
32-bit operations.
>> Architectures are not retrospective, they are working specifications
>> of new implementations. The point I'm making about the PDP-11 is that
>> it didn't stick to the architecture (unless you reduce the term
>> "architecture" to something very fuzzy, almost aspirational).
>
>And I disagree. The different PDP-11s were not implemented out of a blue
>sky, but did actually follow some principles defined way back in 1969.
>The PDP-11 architecture.
>If they didn't follow that, then the machines would not have been
>usable. There is a reason why RT-11 and RSX will work on all different
>PDP-11 models. They implement the same architecture.
The reason that RT-11 works on all the PDP-11 models is because it
contains code which manages all the architectural variations. RT-11
won't boot on a T11/SBC-11 unless you have the version of RT-11 which
inserts NOPs here and there to manage the interrupt scheme.
Code developed exclusively on an LSI-11 often crashs when moved to
other PDP-11s because the LSI-11 does not implement odd address traps.
That has always been a major drag.
PDP-11 software was frequently distributed in a variety of
NHD/EIS/FPU/FIS/EAE versions.
I have noted in earlier posts that all PDP-11s share the same "base
architecture", and that's where most of the compatibility comes from.
That's not what the disagreement is about. What you call
"implementation" variations are what I generally call "(model)
architectural variations".
>>>>> Definitely. Also, it would be interesting to see if J11 behaves the same
>>>>> with and without the FPA.
>>>>> I can (eventually) set up to test this on a real 11/70.
>>>>
>>>> It would be great to see if the older implementations actually do
>>>> update PC and/or FPU instructions. What system runs on the 11/70...let
>>>> me guess :-)
>>>
>>> :-)
>>>
>>> I'll need to start by just writing a small program that runs under RSX
>>> and that presents me with the information. Once I have that up and
>>> running, I can use it on all machines I have.
>>
>> I'll send you my code, although it won't help much. My C code is
>> actually in a pre-processor language and the MACRO code is not
>> stand-alone. But at least it will synch our efforts.
>
>Cool. But yeah, I'll probably rewrite the stuff in MACRO-11 then. But
>it's nice if we have a common concept of what each test checks for, and
>how it do it.
It will be good to have alternate tests because my code may have
(more) bugs. I'll send it tomorrow. SR1.R/SR1.MAC is mostly in MACRO,
but relies on 40 years of MACRO libraries and personal habits. The
rest of it is in a completely undocumented personal language which
translates into DECUS C. I'll send the (unpretty) C code as well.
>>>>>> +++++++++++++++++++++++++
>>>>>> Summary:
>>>>>>
>>>>>> It's all a bit higgledy-piggledy above, so I'll summarise, using the
>>>>>> J11 behavior as the benchmark, where:
>>>>>>
>>>>>> "Correct" means the same as the J11
>>>>>>
>>>>>> "Different" means not the same, but still functional.
>>>>>> You may willing to accept these. I'm less so inclined.
>>>>>>
>>>>>> "Wrong" means a real bug (marked with ****).
>>>>>>
>>>>>> 1. Base and EIS instruction sets.
>>>>>> SimH: Correct on all, except,
>>>>>> **** Wrong for (PC) inc/dec's which should be ignored
>>>>>> (because instruction restarts).
>>>> Correction:
>>>> Different for (PC) incs/decs (see source comment above)
>>>>>
<snip>
>Not sure I understand what you are saying.
>Bob states that he's not doing as the J11, yes. He instead updates MMR1
>with all PC modifications as well. So far all good. But, unless the
>pushed PC for the trap also have that updated value, the contents of
>MMR1 would be wrong. You need to push both the updated PC, and update
>MMR1, or else do neither, to do it right.
The "pushed PC for the trap" turns out to be irrelevant to the SR1
recovery process. All the information is in SR0, SR1 and SR2. MMU SR2
has the restart PC. The "pushed PC" can be thrown away.
A compatible recovery process for the cases we've seen so far, except
for two E11 cases, would be:
1. Use SR0 to locate the faulting page. Map it.
2. Apply all SR1 inc/decs to the appropriate saved registers.
(R7 inc/decs may be made, but they will be discarded with
the next step).
3. Restart the instruction at the location specified by SR2
(And this is also how the KDJ11-A manual describes the process).
In TEST05 futher below SimH records the PC movement from 100000 to
100002 with [27] in SR1. J11 advances the PC, but leaves SR1 as [0].
It's a jungle.
>As for "PC instructions", I assume you mean things like branching and
>jumping? Any such modifications will never have taken effect on the PC
>in the case of a trap.
>
>If you do a:
>
> JMP @(PC)+
> <illegal memory pointer>
>
>the MMR1 should show R7 modified by 2, and the PC on the stack should
>point to the next instruction.
The JMP @#ILLPTR instruction completes with PC=ILLPTR. The trap
doesn't occur until the next instruction fetch (which is, of course,
ILLPTR, which traps). Note SR2 in the listing below. That's the
address of instruction which trapped.
J11:
E11:
Test04: jmp @#100000 ; 100000 is the gap
Before: R0=100000 SP=744 PC=3524
After: R0=100000 SP=744 Err=250 SR0=100011 SR1=[0|0] SR2=100000
TEST05:
What you've described above is more like this, where half the
instruction is mapped, and the other half ain't:
77776 000137 jmp @(pc)+ end of par4 (mapped)
100000 xxxxxx ;unmapped location beginning of par5 (unmapped)
In the test below R0 reports the actual PC just before and after the
instruction.
J11 and SimH do point to the next instruction (100002 in r0). E11
doesn't. However, J11 doesn't update SR1 and SimH does. It's a
wonderful world of color and variety. Operationally it's innocuous.
J11:
Test05: jmp @#xxxxxx ; xxxxxx is in gap. r0=pc
Before: R0=77776 SP=744 PC=4060
After: R0=100002 SP=744 Err=250 SR0=100011 SR1=[0|0] SR2=77776
SimH:
Test05: jmp @#xxxxxx ; xxxxxx is in gap. r0=pc
Before: R0=77776 SP=744 PC=4060
After: R0=100002 SP=744 Err=250 SR0=100011 SR1=[0|27] SR2=77776
E11:
Test05: jmp @#xxxxxx ; xxxxxx is in gap. r0=pc
Before: R0=77776 SP=744 PC=4060 SR0=1
After: R0=100000 SP=744 Err=250 SR0=100011 SR1=[0|0] SR2=77776
>By the way, the stack and PC modifications of a MARK instruction are
>also guaranteed to never have been done in case of a trap.
I had looked in various "architectural" documents for information on
MARK in this regard :-) Where did you find it?
<snip>
>> TEST16:
>> However, leading on from that starting point I looked at an RTI in
>> user mode. The user mode stack maps the RTI PC but not the PSW. The
>> trap is taken in kernel mode of course, so the user mode stack is not
>> overwritten. In this R0 records the user mode SP.
>>
>> SimH has a backed-out result and an unaltered user mode stack. The J11
>> upates SR1 and shows the double pop in the user mode stack.
>>
>> SimH:
>> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
>> Before: R0=77776 SP=744 PC=7174
>> After: R0=77776 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174
>>
>> J11:
>> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
>> Before: R0=77776 SP=744 PC=7174
>> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[26|26] SR2=7174
>
>Both are architecturally correct, but different.
Both are "operationally compatible" if the algorithm mentioned above
is followed (which effectively ignores R7 inc/decs).
>> E11 gets it wrong. The stack is double-popped and, of course, there is
>> no update information.
>>
>> E11
>> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
>> Before: R0=77776 SP=744 PC=7174
>> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174
>
>Ouch. Bad. Another bug. :-)
As we discussed, only if John is actually trying to implement SR1...
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-11 13:12 ` paramucho
@ 2012-02-11 20:06 ` glen herrmannsfeldt
2012-02-11 20:23 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: glen herrmannsfeldt @ 2012-02-11 20:06 UTC (permalink / raw)
In vmsnet.pdp-11 paramucho <paramucho@hotmail.com> wrote:
(snip, I wrote)
>>S/360 and S/370, with 24 bit addressing, were followed by XA/370
>>with 31 bit addressing, yet compatible with 24 bit code.
>>Many instructions have to work differently in 24 bit mode
>>than 31 bit, but all carefully designed to stay compatible.
>>When the PDP-11 was extended to VAX-11, DEC included compatibility
>>mode, but not quite as seamless as XA/370. Still, they did keep
>>the PDP-11 floating point formats, strange as they were, to
>>maintain compatibility.
(snip)
> "Never trust a computer with a compatibility mode bit". I think
> someone from Data General said that.
For XA/370, it is an address mode bit. They went to 31 bit addressing,
with the extra bit as the mode bit, and a system bit that forces 24
bit addressing, when needed. The combination allows compatible
calls between 24 bit and 31 bit code.
S/360 (and S/370) use 24 bit addresses in 32 bit words. If they
planned ahead, they would have restricted the use of the other
eight bits, but they didn't. With the memory restrictions at
the time, OS/360 used the other bits for many different things.
(Note that Apple made the same mistake with MacOS, and had to
go through and fix things later.) As I understand it, though,
VAX and VMS didn't miss this one. Many fields in VAX and VMS
that aren't yet needed are MBZ, must be zero. That allows for
later redefinition, knowing that they are zero in older code.
Even in z/OS, many of the OS/360 control blocks still have the
old format with 24 bit addresses. The mode switch has to work,
as much of the the OS depends on it working.
-- glen
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-11 13:12 ` paramucho
2012-02-11 20:06 ` glen herrmannsfeldt
@ 2012-02-11 20:23 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-11 20:23 UTC (permalink / raw)
On 2012-02-11 14:12, paramucho wrote:
> On Fri, 10 Feb 2012 19:20:42 +0000 (UTC), glen herrmannsfeldt
> <gah@ugcs.caltech.edu> wrote:
>
>> S/360 and S/370, with 24 bit addressing, were followed by XA/370
>> with 31 bit addressing, yet compatible with 24 bit code.
>> Many instructions have to work differently in 24 bit mode
>> than 31 bit, but all carefully designed to stay compatible.
>>
>> When the PDP-11 was extended to VAX-11, DEC included compatibility
>> mode, but not quite as seamless as XA/370. Still, they did keep
>> the PDP-11 floating point formats, strange as they were, to
>> maintain compatibility. When extended precision (128 bit)
>> floating point was added to S/360, it was done such that it
>> was relativly easy to do in software emulation on older S/360
>> models. That form was then standard on S/370 and later.
>
> "Never trust a computer with a compatibility mode bit". I think
> someone from Data General said that.
I know DG was totally against the compatibility bit, and thus didn't
have that for the Eclipse. I think it was a mistake. However, there are
so many weird things about the Eclipse that it's hard to point to any
one specific reason for it not really being a success.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-11 13:15 ` paramucho
@ 2012-02-11 21:09 ` Johnny Billquist
2012-02-12 17:23 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-11 21:09 UTC (permalink / raw)
On 2012-02-11 14:15, paramucho wrote:
> On Fri, 10 Feb 2012 20:29:24 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>>> It's incremented by four. If it wasn't my progam would crash. The PC
>>> itself is always incremented by the full and correct amount in these
>>> tests, except for those which test RTI etc.
>>
>> Aha. So I'd say that J11 in essence is doing wrong. It have updated the
>> PC more than just the instruction fetch, but this is not reflected in MMR1.
>> The processor handbooks say it should update MMR1.
>> So, a program that does a rollback cannot do it right with regards to
>> the PC, but have to use MMR2 for that.
>
> The fact there can even be a question about whether it's right or
> wrong indicates the lack of a clear reference architecture. This is
> not rocket science.
I'd say that the J11 breaks the specification. It clearly says that MMR1
should reflect any changes to the PC as well.
>> Why would your program crash if the PC wasn't incremented by 4, by the
>> way???
>
> Because my code is very simple:
>
> [setup code]
> test instruction
> [report code]
>
> When the test instruction crashs the trap ISR simply registers the
> fact and RTI's with the C-bit and V-bit set. If the RTI PC was wrong
> then my test code would presumably fail. Note, the code which actually
> tests RTI, RETURN, JMP etc has a workaround.
Oh. I assumed you just printed the information in the trap handler, and
didn't return. Seemed like the simple way to do things. But if you
return, then it becomes more important that the PC points to the next
instruction. I suspect that means that your program might actually fail
on some PDP-11 models.
For example, if you do a
MOV (R0)+,@(PC)+
where it traps on the R0 reference, might, and probably will have the PC
pointing to the pointer, and not the next instruction on many PDP-11s.
> Of course there are better ways to do these things, but I was in a
> hurry and this is throw-away code...
:-)
>>>>> The simulator follows the Handbook, for simplicity.
>>>>>
>>>>> The document he's referencing is here (and I think I used to have a
>>>>> copy of it):
>>>>>
>>>>> http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
>>>>
>>>> Yes. That is the handbook that I referred to a few posts ago as well.
>>>> It's really a better source for how a PDP-11 should work (I won't call
>>>> it the architecture, since you object so much). But it leaves a lot up
>>>> to specific implementations on how to do things. Like the handling of
>>>> MMR1 in respect to backing out of changes. Which J11 takes advantage of.
>>>> Simh consiously chose to not fully simulate the J11 here.
>>>>
>>>> That handbook is, by the way, just the last incarnation of the PDP-11
>>>> Processor Handbook. Unfortunately I don't have my copy where I'm sitting
>>>> (living). But if I remember right, it covers the T11, F11 and J11.
>>>> Possibly also the LSI11. It also touches on the 11/44, and I think the
>>>> 11/34 and the 11/70 with friends. But most of the book is not about
>>>> specific implementations, but about the PDP-11 as such.
>>>
>>> But as I've said above, it's an often retrospective document.
>>
>> It was written way before the 11/93 came about. It was even written
>> before the 11/83 came about.
>
> I wasn't applying that book to the 11/8x or 11/9x, but to the CPUs
> which it described.
It describes the J11, which is the CPU used in the 11/8x and 11/9x machines.
>> But I agree that it's a book that got updated after each new processor
>> was done, so that it held information that were relevant to the readers.
>
> I don't recall that manual being updated after each significant new
> CPU and I'm not even sure their was an "Architecture Handbook" which
> covered the 11/8x and 11/9x CPU's?
All of those machines use the J11 CPU, and the architecture handbook do
cover the J11. No need to make a new version of that handbook until a
new CPU showed up, and the J11 was the last.
> BTW: there was an early architectural spec in one of Gordon Bell's
> books. Interestingly it has a completely different FPU instruction set
> and also lists a double-word instruction set.
If you read the really early documents and plans for the PDP-11 you'll
find a lot of odd things and plans which didn't happen the way they
planned it. :-)
>>> Architectures are not retrospective, they are working specifications
>>> of new implementations. The point I'm making about the PDP-11 is that
>>> it didn't stick to the architecture (unless you reduce the term
>>> "architecture" to something very fuzzy, almost aspirational).
>>
>> And I disagree. The different PDP-11s were not implemented out of a blue
>> sky, but did actually follow some principles defined way back in 1969.
>> The PDP-11 architecture.
>> If they didn't follow that, then the machines would not have been
>> usable. There is a reason why RT-11 and RSX will work on all different
>> PDP-11 models. They implement the same architecture.
>
> The reason that RT-11 works on all the PDP-11 models is because it
> contains code which manages all the architectural variations. RT-11
> won't boot on a T11/SBC-11 unless you have the version of RT-11 which
> inserts NOPs here and there to manage the interrupt scheme.
Hmm. I think I can't remember much of any model-specific code in RSX.
But I'm sure there are some things in a few places...
Searching through the code right now, in the SST handler, I can't
actually find any model-specific code...
> Code developed exclusively on an LSI-11 often crashs when moved to
> other PDP-11s because the LSI-11 does not implement odd address traps.
> That has always been a major drag.
I remember that it does not trap odd address access at all. Bad, but
hard to do much about.
> PDP-11 software was frequently distributed in a variety of
> NHD/EIS/FPU/FIS/EAE versions.
I know some layered products which came with different versions of
libraries. The NHD version works on all machines, while the other ones
are faster, but requires that hardware to be available to be able to run.
Seems perfectly reasonable.
>>>>>> Definitely. Also, it would be interesting to see if J11 behaves the same
>>>>>> with and without the FPA.
>>>>>> I can (eventually) set up to test this on a real 11/70.
>>>>>
>>>>> It would be great to see if the older implementations actually do
>>>>> update PC and/or FPU instructions. What system runs on the 11/70...let
>>>>> me guess :-)
>>>>
>>>> :-)
>>>>
>>>> I'll need to start by just writing a small program that runs under RSX
>>>> and that presents me with the information. Once I have that up and
>>>> running, I can use it on all machines I have.
>>>
>>> I'll send you my code, although it won't help much. My C code is
>>> actually in a pre-processor language and the MACRO code is not
>>> stand-alone. But at least it will synch our efforts.
>>
>> Cool. But yeah, I'll probably rewrite the stuff in MACRO-11 then. But
>> it's nice if we have a common concept of what each test checks for, and
>> how it do it.
>
> It will be good to have alternate tests because my code may have
> (more) bugs. I'll send it tomorrow. SR1.R/SR1.MAC is mostly in MACRO,
> but relies on 40 years of MACRO libraries and personal habits. The
> rest of it is in a completely undocumented personal language which
> translates into DECUS C. I'll send the (unpretty) C code as well.
Well, my code will be RSX-specific, so not really directly useful by
others either. However, maybe easier to adopt. We'll find out.
>>>>>>> +++++++++++++++++++++++++
>>>>>>> Summary:
>>>>>>>
>>>>>>> It's all a bit higgledy-piggledy above, so I'll summarise, using the
>>>>>>> J11 behavior as the benchmark, where:
>>>>>>>
>>>>>>> "Correct" means the same as the J11
>>>>>>>
>>>>>>> "Different" means not the same, but still functional.
>>>>>>> You may willing to accept these. I'm less so inclined.
>>>>>>>
>>>>>>> "Wrong" means a real bug (marked with ****).
>>>>>>>
>>>>>>> 1. Base and EIS instruction sets.
>>>>>>> SimH: Correct on all, except,
>>>>>>> **** Wrong for (PC) inc/dec's which should be ignored
>>>>>>> (because instruction restarts).
>>>>> Correction:
>>>>> Different for (PC) incs/decs (see source comment above)
>>>>>>
>
> <snip>
>> Not sure I understand what you are saying.
>> Bob states that he's not doing as the J11, yes. He instead updates MMR1
>> with all PC modifications as well. So far all good. But, unless the
>> pushed PC for the trap also have that updated value, the contents of
>> MMR1 would be wrong. You need to push both the updated PC, and update
>> MMR1, or else do neither, to do it right.
>
> The "pushed PC for the trap" turns out to be irrelevant to the SR1
> recovery process. All the information is in SR0, SR1 and SR2. MMU SR2
> has the restart PC. The "pushed PC" can be thrown away.
>
> A compatible recovery process for the cases we've seen so far, except
> for two E11 cases, would be:
>
> 1. Use SR0 to locate the faulting page. Map it.
> 2. Apply all SR1 inc/decs to the appropriate saved registers.
> (R7 inc/decs may be made, but they will be discarded with
> the next step).
> 3. Restart the instruction at the location specified by SR2
>
> (And this is also how the KDJ11-A manual describes the process).
Right. But had MMR1 been updated "correctly", step 3 would not be
absolutely required. But as it stands, you need this.
>> As for "PC instructions", I assume you mean things like branching and
>> jumping? Any such modifications will never have taken effect on the PC
>> in the case of a trap.
>>
>> If you do a:
>>
>> JMP @(PC)+
>> <illegal memory pointer>
>>
>> the MMR1 should show R7 modified by 2, and the PC on the stack should
>> point to the next instruction.
>
> The JMP @#ILLPTR instruction completes with PC=ILLPTR. The trap
> doesn't occur until the next instruction fetch (which is, of course,
> ILLPTR, which traps). Note SR2 in the listing below. That's the
> address of instruction which trapped.
Doh! I wasn't thinking straight. :-)
> TEST05:
> What you've described above is more like this, where half the
> instruction is mapped, and the other half ain't:
>
> 77776 000137 jmp @(pc)+ end of par4 (mapped)
> 100000 xxxxxx ;unmapped location beginning of par5 (unmapped)
>
> In the test below R0 reports the actual PC just before and after the
> instruction.
>
> J11 and SimH do point to the next instruction (100002 in r0). E11
> doesn't. However, J11 doesn't update SR1 and SimH does. It's a
> wonderful world of color and variety. Operationally it's innocuous.
Right. I think J11 in a way is cheating here, but it seems that Bob
knows something about the internals of J11 which is the source of this.
>> By the way, the stack and PC modifications of a MARK instruction are
>> also guaranteed to never have been done in case of a trap.
>
> I had looked in various "architectural" documents for information on
> MARK in this regard :-) Where did you find it?
It's in the "Architecture Handbook".
Atleast the earlier version, which I gave a link to before. I wish I had
the latest version online. Anyone know if it's available somewhere?
>>> E11 gets it wrong. The stack is double-popped and, of course, there is
>>> no update information.
>>>
>>> E11
>>> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped)
>>> Before: R0=77776 SP=744 PC=7174
>>> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174
>>
>> Ouch. Bad. Another bug. :-)
>
> As we discussed, only if John is actually trying to implement SR1...
Well, if he isn't trying, it's still a bug. It means that you cannot use
E11 if you want to implement a paging system, since you cannot undo a
partial instruction in all cases in E11. And if you tell E11 to act like
a J11, it would be nice if code that works on J11 also works in E11.
Admittedly no current existing code (apart from possibly diagnostics)
actually use this specific feature, so you can get away with having it
non-functional.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-11 21:09 ` Johnny Billquist
@ 2012-02-12 17:23 ` paramucho
2012-02-12 18:35 ` paramucho
2012-02-13 23:18 ` Johnny Billquist
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-12 17:23 UTC (permalink / raw)
On Sat, 11 Feb 2012 22:09:11 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>>> Why would your program crash if the PC wasn't incremented by 4, by the
>>> way???
>>
>> Because my code is very simple:
>>
>> [setup code]
>> test instruction
>> [report code]
>>
>> When the test instruction crashs the trap ISR simply registers the
>> fact and RTI's with the C-bit and V-bit set. If the RTI PC was wrong
>> then my test code would presumably fail. Note, the code which actually
>> tests RTI, RETURN, JMP etc has a workaround.
>
>Oh. I assumed you just printed the information in the trap handler, and
>didn't return. Seemed like the simple way to do things. But if you
>return, then it becomes more important that the PC points to the next
>instruction. I suspect that means that your program might actually fail
>on some PDP-11 models.
>
>For example, if you do a
>
> MOV (R0)+,@(PC)+
>
>where it traps on the R0 reference, might, and probably will have the PC
>pointing to the pointer, and not the next instruction on many PDP-11s.
I'm well aware of that, however the technique is commonplace in RT-11
for the simple cases. As I said, I use the non-returning trap handler
technique for RTI, RETURN etc. Actually, the main problem with the
RT-11 technique is that you can mask other traps. Anyway, I had to
move all the tests to the trap handler yesterday when I finally put
the condition code tracking in.
<snip>
>>>> Architectures are not retrospective, they are working specifications
>>>> of new implementations. The point I'm making about the PDP-11 is that
>>>> it didn't stick to the architecture (unless you reduce the term
>>>> "architecture" to something very fuzzy, almost aspirational).
>>>
>>> And I disagree. The different PDP-11s were not implemented out of a blue
>>> sky, but did actually follow some principles defined way back in 1969.
>>> The PDP-11 architecture.
>>> If they didn't follow that, then the machines would not have been
>>> usable. There is a reason why RT-11 and RSX will work on all different
>>> PDP-11 models. They implement the same architecture.
>>
>> The reason that RT-11 works on all the PDP-11 models is because it
>> contains code which manages all the architectural variations. RT-11
>> won't boot on a T11/SBC-11 unless you have the version of RT-11 which
>> inserts NOPs here and there to manage the interrupt scheme.
>
>Hmm. I think I can't remember much of any model-specific code in RSX.
>But I'm sure there are some things in a few places...
>
>Searching through the code right now, in the SST handler, I can't
>actually find any model-specific code...
I wouldn't expect to find LSI or T11 conditionals in code that runs on
memory mapped machines. In any case, you also listed RT-11 in your
claim above, and RT-11 supported the LSI-11 and T11. In the RT-11
bootstrap you'll find these sequences:
TST <I/O address> ; Check device present
T11NOP ; NOP on T11
BCS ... ; error detected
(Note, these tests use exactly the trap technique I described above).
>> Code developed exclusively on an LSI-11 often crashs when moved to
>> other PDP-11s because the LSI-11 does not implement odd address traps.
>> That has always been a major drag.
>
>I remember that it does not trap odd address access at all. Bad, but
>hard to do much about.
The whole point of the architecture approach was to avoid precisely
this kind of incompatibility. That's why I've said that the PDP-11 is
somewhere in between the pre-architectural and architectural worlds.
All the main PDP-11 architectural issues had their roots in
cost-technology trade-offs.
>> PDP-11 software was frequently distributed in a variety of
>> NHD/EIS/FPU/FIS/EAE versions.
>
>I know some layered products which came with different versions of
>libraries. The NHD version works on all machines, while the other ones
>are faster, but requires that hardware to be available to be able to run.
>Seems perfectly reasonable.
I make the same point as above.
<snip>
>>> By the way, the stack and PC modifications of a MARK instruction are
>>> also guaranteed to never have been done in case of a trap.
>>
>> I had looked in various "architectural" documents for information on
>> MARK in this regard :-) Where did you find it?
>
>It's in the "Architecture Handbook".
>Atleast the earlier version, which I gave a link to before. I wish I had
>the latest version online. Anyone know if it's available somewhere?
Which link was that? The only link I can find in this stream is the
link I provided, but all that has is a picture of the front cover.
> http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
<snip>
BTW: I checked the 11/34 and J11 XXDP diagnostics at bitsavers last
night. The SR1 test on the 11/34 just expects a big, fat zero. On the
J11 the tests are limited to various combinations of "mov
(r1)+,-(r5)", mixing up autoinc and autodec. That's it.
As noted above, I've implemented the condition code tests (and I'm
running a bit late with the promised code because of that). The test
below shows the PS to be 30000 BEFORE the test. AFTER the test it is
30004. I repeat the test with an initial PS of 30017 (all condition
codes set). The AFTER state is 30005. I only show the repeated test if
there is a difference between its PS BEFORE and AFTER state.
J11:
SimH:
Test03: mtpi *(r0)+
Before: R0=100000 SP=740 PC=3110 PS=30000
After: R0=100002 SP=742 PC=3112 PS=30004
Vec=250 SR0=100151 SR1=[20|26] SR2=3110
Before: R0=100000 SP=740 PC=3110 PS=30017
After: R0=100002 SP=742 PC=3112 PS=30005
Vec=250 SR0=100151 SR1=[20|26] SR2=3110
I've also cleaned up some other display details. VEC is now the trap
vector. SP and PC are always the SP and PC (I was using R0 sometimes
in the previous version). Adding the PS has forced me to wrap the MMU
information on to a separate line.
E11 doesn't have the condition code problem, but you may recall that
this is one of two tests we marked as a BUG because the AFTER state
has SP+2 but there's no recovery information.
E11:
Test03: mtpi *(r0)+
Before: R0=100000 SP=740 PC=3110 PS=30000
After: R0=100000 SP=742 PC=3112 PS=30000
Vec=250 SR0=100151 SR1=[0|0] SR2=3110
What I realized tonight however is that the E11 bug distracted me from
noticing a bigger problem: The J11 and SimH might give us the backout
information for the stack ([20|26]), but it's of no use because the
MTPI stack operand will have already been overwritten by the MMU trap.
The value we wanted to write to user space (for example) can't be
recovered.
Basically, if we want to implement demand paging, we're screwed. MFPx
and MTPx are the basic tools used in the kernel to copy information to
and from user space. The workarounds are horrible (i.e. converting the
virtual address to a par/offset pair and mapping via a window). I'll
be very interested to know if the 11/70 has the problem.
Coming back to the condition codes, I note that J11 and SimH both
begin altering the CC's before an instruction is complete. That could
be fatal to a restarted ADC/SBC, ROL/ROR, ASH/ASHC instructions since
the C bit might be altered. I need new tests for that.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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-13 23:18 ` Johnny Billquist
1 sibling, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-12 18:35 UTC (permalink / raw)
On Sun, 12 Feb 2012 17:23:32 GMT, paramucho@hotmail.com (paramucho)
wrote:
><snip>
>>
>As noted above, I've implemented the condition code tests (and I'm
>running a bit late with the promised code because of that). The test
>below shows the PS to be 30000 BEFORE the test. AFTER the test it is
>30004. I repeat the test with an initial PS of 30017 (all condition
>codes set). The AFTER state is 30005. I only show the repeated test if
>there is a difference between its PS BEFORE and AFTER state.
>
>J11:
>SimH:
>Test03: mtpi *(r0)+
>Before: R0=100000 SP=740 PC=3110 PS=30000
>After: R0=100002 SP=742 PC=3112 PS=30004
> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>
>Before: R0=100000 SP=740 PC=3110 PS=30017
>After: R0=100002 SP=742 PC=3112 PS=30005
> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>
<snip>
>E11 doesn't have the condition code problem, but you may recall that
>this is one of two tests we marked as a BUG because the AFTER state
>has SP+2 but there's no recovery information.
>
>E11:
>Test03: mtpi *(r0)+
>Before: R0=100000 SP=740 PC=3110 PS=30000
>After: R0=100000 SP=742 PC=3112 PS=30000
> Vec=250 SR0=100151 SR1=[0|0] SR2=3110
>
>What I realized tonight however is that the E11 bug distracted me from
>noticing a bigger problem: The J11 and SimH might give us the backout
>information for the stack ([20|26]), but it's of no use because the
>MTPI stack operand will have already been overwritten by the MMU trap.
>The value we wanted to write to user space (for example) can't be
>recovered.
>
>Basically, if we want to implement demand paging, we're screwed. MFPx
>and MTPx are the basic tools used in the kernel to copy information to
>and from user space. The workarounds are horrible (i.e. converting the
>virtual address to a par/offset pair and mapping via a window). I'll
>be very interested to know if the 11/70 has the problem.
It occurred to me later that this problem was generic for any kernel
instruction which popped the stack before the fault, e.g. mov
(sp)+,(r0)+ where R0 was an invalid pointer. In fact a quick test
showed identical results as per MTPI above.
Clearly, you can't demand-page on the same stack that you take page
faults on. Thus, if demand paging is only supported in user and
supervisor mode perhaps the idea is to move "paged" system code to
supervisor space. Either that or not to page system code at all and
use address checks and page locks for every kernel access to
user/supervisor mode...
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-12 18:35 ` paramucho
@ 2012-02-13 17:30 ` paramucho
2012-02-14 13:14 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-13 17:30 UTC (permalink / raw)
On Sun, 12 Feb 2012 18:35:31 GMT, paramucho@hotmail.com (paramucho)
wrote:
>On Sun, 12 Feb 2012 17:23:32 GMT, paramucho@hotmail.com (paramucho)
>wrote:
>
>><snip>
>>>
>>As noted above, I've implemented the condition code tests (and I'm
>>running a bit late with the promised code because of that). The test
>>below shows the PS to be 30000 BEFORE the test. AFTER the test it is
>>30004. I repeat the test with an initial PS of 30017 (all condition
>>codes set). The AFTER state is 30005. I only show the repeated test if
>>there is a difference between its PS BEFORE and AFTER state.
>>
>>J11:
>>SimH:
>>Test03: mtpi *(r0)+
>>Before: R0=100000 SP=740 PC=3110 PS=30000 ----
>>After: R0=100002 SP=742 PC=3112 PS=30004 -Z--
>> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>>
>>Before: R0=100000 SP=740 PC=3110 PS=30017 NZVC
>>After: R0=100002 SP=742 PC=3112 PS=30005 -Z-C
>> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>>
><snip>
>
>>E11 doesn't have the condition code problem, but you may recall that
>>this is one of two tests we marked as a BUG because the AFTER state
>>has SP+2 but there's no recovery information.
>>
>>E11:
>>Test03: mtpi *(r0)+
>>Before: R0=100000 SP=740 PC=3110 PS=30000 ----
>>After: R0=100000 SP=742 PC=3112 PS=30000 ----
>> Vec=250 SR0=100151 SR1=[0|0] SR2=3110
>>
>>What I realized tonight however is that the E11 bug distracted me from
>>noticing a bigger problem: The J11 and SimH might give us the backout
>>information for the stack ([20|26]), but it's of no use because the
>>MTPI stack operand will have already been overwritten by the MMU trap.
>>The value we wanted to write to user space (for example) can't be
>>recovered.
>>
>>Basically, if we want to implement demand paging, we're screwed. MFPx
>>and MTPx are the basic tools used in the kernel to copy information to
>>and from user space. The workarounds are horrible (i.e. converting the
>>virtual address to a par/offset pair and mapping via a window). I'll
>>be very interested to know if the 11/70 has the problem.
>
>It occurred to me later that this problem was generic for any kernel
>instruction which popped the stack before the fault, e.g. mov
>(sp)+,(r0)+ where R0 was an invalid pointer. In fact a quick test
>showed identical results as per MTPI above.
>
>Clearly, you can't demand-page on the same stack that you take page
>faults on. Thus, if demand paging is only supported in user and
>supervisor mode perhaps the idea is to move "paged" system code to
>supervisor space. Either that or not to page system code at all and
>use address checks and page locks for every kernel access to
>user/supervisor mode...
TEST21:: MFPS
I've added a 4-character condition code field, e.g. "NZVC", (and I've
edited the earlier examples above).
MFPS instruction tests fail because the condition codes pushed by the
abort trap have been modified from the original. In the examples ----
is pushed as -Z-- and NZVC is pushed as ---C. The restarted
instruction will return the wrong condition codes. This is not good.
J11/SimH:
Test21: mfps (r0)+
Before: R0=100000 SP=742 PC=6526 PS=30000 ----
After: R0=100001 SP=742 PC=6530 PS=30004 -Z--
Vec=250 SR0=100011 SR1=[0|10] SR2=6526
Before: R0=100000 SP=742 PC=6526 PS=30017 NZVC
After: R0=100001 SP=742 PC=6530 PS=30001 ---C
Vec=250 SR0=100011 SR1=[0|10] SR2=6526
The changes being applied to the PS are those described for the
instruction. In the case of MFPS:
N: set if PS <0> = 1; cleared otherwise
Z: set if PS <07:00> = 0; cleared otherwise
V: cleared
C: not affected
MTPS does not have a problem.
BTW: Perhaps it's time to note the obvious: The J11 and SimH tend to
apply the side-affects of an operation as an instruction progresses
where E11 tends wait until an instruction has completed before
applying side-affects. And it's also clear that the SimH attempts to
get as close as possible to the J11's operational behavior, so any
deviations from J11 behavior are probably worth reporting.
I did a final compare of the J11 and SimH, clearing some details etc.
The results are in the source of the utility.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-12 17:23 ` paramucho
2012-02-12 18:35 ` paramucho
@ 2012-02-13 23:18 ` Johnny Billquist
2012-02-14 16:20 ` paramucho
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-13 23:18 UTC (permalink / raw)
On 2012-02-12 18:23, paramucho wrote:
> On Sat, 11 Feb 2012 22:09:11 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>>>>> Architectures are not retrospective, they are working specifications
>>>>> of new implementations. The point I'm making about the PDP-11 is that
>>>>> it didn't stick to the architecture (unless you reduce the term
>>>>> "architecture" to something very fuzzy, almost aspirational).
>>>>
>>>> And I disagree. The different PDP-11s were not implemented out of a blue
>>>> sky, but did actually follow some principles defined way back in 1969.
>>>> The PDP-11 architecture.
>>>> If they didn't follow that, then the machines would not have been
>>>> usable. There is a reason why RT-11 and RSX will work on all different
>>>> PDP-11 models. They implement the same architecture.
>>>
>>> The reason that RT-11 works on all the PDP-11 models is because it
>>> contains code which manages all the architectural variations. RT-11
>>> won't boot on a T11/SBC-11 unless you have the version of RT-11 which
>>> inserts NOPs here and there to manage the interrupt scheme.
>>
>> Hmm. I think I can't remember much of any model-specific code in RSX.
>> But I'm sure there are some things in a few places...
>>
>> Searching through the code right now, in the SST handler, I can't
>> actually find any model-specific code...
>
> I wouldn't expect to find LSI or T11 conditionals in code that runs on
> memory mapped machines. In any case, you also listed RT-11 in your
> claim above, and RT-11 supported the LSI-11 and T11. In the RT-11
> bootstrap you'll find these sequences:
RSX can also run on non-memorymapped machines. M+ can not, but 11M
definitely can. But I should check that distribution to make sure that
file isn't different. But almost all files are the same between 11M and
M+, with conditionals in them.
> TST <I/O address> ; Check device present
> T11NOP ; NOP on T11
> BCS ... ; error detected
>
> (Note, these tests use exactly the trap technique I described above).
Ah, with a trap handler setting the carry if you have a bus timeout?
Yes, RSX do that in the boot sequence, when trying to figure out which
machine you have. Also, if you have a device driver trying to come
online, it will fail and be marked offline if the device don't respond
to the address. However, this whole thing is run the same way on all
models that I can see, the only odd thing in your code being that
T11NOP, which I'm curious about...
>>> Code developed exclusively on an LSI-11 often crashs when moved to
>>> other PDP-11s because the LSI-11 does not implement odd address traps.
>>> That has always been a major drag.
>>
>> I remember that it does not trap odd address access at all. Bad, but
>> hard to do much about.
>
> The whole point of the architecture approach was to avoid precisely
> this kind of incompatibility. That's why I've said that the PDP-11 is
> somewhere in between the pre-architectural and architectural worlds.
> All the main PDP-11 architectural issues had their roots in
> cost-technology trade-offs.
There are always implementations that might differ one way or another
from the generally accepted behavior. Often with bad effects, but it's a
trade-off. That is, however, no argument for or against the existence of
an architecture. There are VAXen with horrible deviations from that
architecture as well. I can't remember which model now, but there is one
with a very incompatible MMU. Mostly used in things like the X-terminals
DEC made, if I remember right.
>>>> By the way, the stack and PC modifications of a MARK instruction are
>>>> also guaranteed to never have been done in case of a trap.
>>>
>>> I had looked in various "architectural" documents for information on
>>> MARK in this regard :-) Where did you find it?
>>
>> It's in the "Architecture Handbook".
>> Atleast the earlier version, which I gave a link to before. I wish I had
>> the latest version online. Anyone know if it's available somewhere?
>
> Which link was that? The only link I can find in this stream is the
> link I provided, but all that has is a picture of the front cover.
http://bitsavers.trailing-edge.com/pdf/dec/pdp11/handbooks/PDP11_Handbook1979.pdf
Page 164, the description of MMR1.
I really should locate the later version online...
> BTW: I checked the 11/34 and J11 XXDP diagnostics at bitsavers last
> night. The SR1 test on the 11/34 just expects a big, fat zero. On the
> J11 the tests are limited to various combinations of "mov
> (r1)+,-(r5)", mixing up autoinc and autodec. That's it.
Cheap bastards. :-)
> As noted above, I've implemented the condition code tests (and I'm
> running a bit late with the promised code because of that). The test
> below shows the PS to be 30000 BEFORE the test. AFTER the test it is
> 30004. I repeat the test with an initial PS of 30017 (all condition
> codes set). The AFTER state is 30005. I only show the repeated test if
> there is a difference between its PS BEFORE and AFTER state.
>
> J11:
> SimH:
> Test03: mtpi *(r0)+
> Before: R0=100000 SP=740 PC=3110 PS=30000
> After: R0=100002 SP=742 PC=3112 PS=30004
> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>
> Before: R0=100000 SP=740 PC=3110 PS=30017
> After: R0=100002 SP=742 PC=3112 PS=30005
> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>
> I've also cleaned up some other display details. VEC is now the trap
> vector. SP and PC are always the SP and PC (I was using R0 sometimes
> in the previous version). Adding the PS has forced me to wrap the MMU
> information on to a separate line.
>
> E11 doesn't have the condition code problem, but you may recall that
> this is one of two tests we marked as a BUG because the AFTER state
> has SP+2 but there's no recovery information.
>
> E11:
> Test03: mtpi *(r0)+
> Before: R0=100000 SP=740 PC=3110 PS=30000
> After: R0=100000 SP=742 PC=3112 PS=30000
> Vec=250 SR0=100151 SR1=[0|0] SR2=3110
>
> What I realized tonight however is that the E11 bug distracted me from
> noticing a bigger problem: The J11 and SimH might give us the backout
> information for the stack ([20|26]), but it's of no use because the
> MTPI stack operand will have already been overwritten by the MMU trap.
> The value we wanted to write to user space (for example) can't be
> recovered.
Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted.
It's a design error in the PDP-11. Gha, that's ugly.
> Basically, if we want to implement demand paging, we're screwed. MFPx
> and MTPx are the basic tools used in the kernel to copy information to
> and from user space. The workarounds are horrible (i.e. converting the
> virtual address to a par/offset pair and mapping via a window). I'll
> be very interested to know if the 11/70 has the problem.
I'm willing to bet money that the 11/70 behaves the same way.
The solution would actually be to make sure the address in userspace you
want to read/write is in memory, so that you don't get page faults.
Using memory mapping registers for this wouldn't be fun.
One more trick that can be used is to only support/use MFPx/MTPx in
kernel in the sequence of a push to the stack followed by this. That
way, you could, as a part of the restart detect this special case, and
back up to the previous instruction to redo the push as well.
> Coming back to the condition codes, I note that J11 and SimH both
> begin altering the CC's before an instruction is complete. That could
> be fatal to a restarted ADC/SBC, ROL/ROR, ASH/ASHC instructions since
> the C bit might be altered. I need new tests for that.
Yikes. Even more problems. That sounds really weird and bad.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-14 13:14 UTC (permalink / raw)
On 2012-02-12 19.35, paramucho wrote:
> On Sun, 12 Feb 2012 17:23:32 GMT, paramucho@hotmail.com (paramucho)
> wrote:
>
>> <snip>
>>>
>> As noted above, I've implemented the condition code tests (and I'm
>> running a bit late with the promised code because of that). The test
>> below shows the PS to be 30000 BEFORE the test. AFTER the test it is
>> 30004. I repeat the test with an initial PS of 30017 (all condition
>> codes set). The AFTER state is 30005. I only show the repeated test if
>> there is a difference between its PS BEFORE and AFTER state.
>>
>> J11:
>> SimH:
>> Test03: mtpi *(r0)+
>> Before: R0=100000 SP=740 PC=3110 PS=30000
>> After: R0=100002 SP=742 PC=3112 PS=30004
>> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>>
>> Before: R0=100000 SP=740 PC=3110 PS=30017
>> After: R0=100002 SP=742 PC=3112 PS=30005
>> Vec=250 SR0=100151 SR1=[20|26] SR2=3110
>>
> <snip>
>
>> E11 doesn't have the condition code problem, but you may recall that
>> this is one of two tests we marked as a BUG because the AFTER state
>> has SP+2 but there's no recovery information.
>>
>> E11:
>> Test03: mtpi *(r0)+
>> Before: R0=100000 SP=740 PC=3110 PS=30000
>> After: R0=100000 SP=742 PC=3112 PS=30000
>> Vec=250 SR0=100151 SR1=[0|0] SR2=3110
>>
>> What I realized tonight however is that the E11 bug distracted me from
>> noticing a bigger problem: The J11 and SimH might give us the backout
>> information for the stack ([20|26]), but it's of no use because the
>> MTPI stack operand will have already been overwritten by the MMU trap.
>> The value we wanted to write to user space (for example) can't be
>> recovered.
>>
>> Basically, if we want to implement demand paging, we're screwed. MFPx
>> and MTPx are the basic tools used in the kernel to copy information to
>> and from user space. The workarounds are horrible (i.e. converting the
>> virtual address to a par/offset pair and mapping via a window). I'll
>> be very interested to know if the 11/70 has the problem.
>
> It occurred to me later that this problem was generic for any kernel
> instruction which popped the stack before the fault, e.g. mov
> (sp)+,(r0)+ where R0 was an invalid pointer. In fact a quick test
> showed identical results as per MTPI above.
Ah, yes. Good point.
> Clearly, you can't demand-page on the same stack that you take page
> faults on. Thus, if demand paging is only supported in user and
> supervisor mode perhaps the idea is to move "paged" system code to
> supervisor space. Either that or not to page system code at all and
> use address checks and page locks for every kernel access to
> user/supervisor mode...
Right. I suspect the right thing to do in the kernel is to not expect to
do demand paging for access from kernel space. The kernel should check
in advance (and it can) that all memory references will work. Any memory
errors in kernel space should probably be treated as fatal.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-13 23:18 ` Johnny Billquist
@ 2012-02-14 16:20 ` paramucho
2012-02-14 17:47 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-14 16:20 UTC (permalink / raw)
On Tue, 14 Feb 2012 00:18:44 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>> What I realized tonight however is that the E11 bug distracted me from
>> noticing a bigger problem: The J11 and SimH might give us the backout
>> information for the stack ([20|26]), but it's of no use because the
>> MTPI stack operand will have already been overwritten by the MMU trap.
>> The value we wanted to write to user space (for example) can't be
>> recovered.
>
>Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted.
>It's a design error in the PDP-11. Gha, that's ugly.
Yes, but only MTPx is affected. MFPx doesn't have the problem (which
also means that we can use MFPx in solving the MTPx problem).
>> Basically, if we want to implement demand paging, we're screwed. MFPx
>> and MTPx are the basic tools used in the kernel to copy information to
>> and from user space. The workarounds are horrible (i.e. converting the
>> virtual address to a par/offset pair and mapping via a window). I'll
>> be very interested to know if the 11/70 has the problem.
>
>I'm willing to bet money that the 11/70 behaves the same way.
>
>The solution would actually be to make sure the address in userspace you
>want to read/write is in memory, so that you don't get page faults.
>Using memory mapping registers for this wouldn't be fun.
>One more trick that can be used is to only support/use MFPx/MTPx in
>kernel in the sequence of a push to the stack followed by this. That
>way, you could, as a part of the restart detect this special case, and
>back up to the previous instruction to redo the push as well.
My thoughts too. The problem is that the "previous instruction" could
be 2, 4 or 6 bytes long. Noting that MPTI always clears the V-bit, I
would follow the MPTI instruction with BVS, as below, and use the BVS
opcode itself as a signature for the special behavior. I seem to
recall using this technique to solve
10$: psh <value>
mtpi <address>
bvs 10$
(In fact I already use this kind of thing in RUST/XM to handle bus
errors (trap to 4) instead of address checking in some cases.)
"Operational" solutions are available to the other issues as well. For
example, MFPS will never fail to a general register.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-14 13:14 ` Johnny Billquist
@ 2012-02-14 16:20 ` paramucho
2012-02-14 17:30 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-14 16:20 UTC (permalink / raw)
On Tue, 14 Feb 2012 14:14:33 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>>> What I realized tonight however is that the E11 bug distracted me from
>>> noticing a bigger problem: The J11 and SimH might give us the backout
>>> information for the stack ([20|26]), but it's of no use because the
>>> MTPI stack operand will have already been overwritten by the MMU trap.
>>> The value we wanted to write to user space (for example) can't be
>>> recovered.
>>>
>>> Basically, if we want to implement demand paging, we're screwed. MFPx
>>> and MTPx are the basic tools used in the kernel to copy information to
>>> and from user space. The workarounds are horrible (i.e. converting the
>>> virtual address to a par/offset pair and mapping via a window). I'll
>>> be very interested to know if the 11/70 has the problem.
>>
>> It occurred to me later that this problem was generic for any kernel
>> instruction which popped the stack before the fault, e.g. mov
>> (sp)+,(r0)+ where R0 was an invalid pointer. In fact a quick test
>> showed identical results as per MTPI above.
>
>Ah, yes. Good point.
>
>> Clearly, you can't demand-page on the same stack that you take page
>> faults on. Thus, if demand paging is only supported in user and
>> supervisor mode perhaps the idea is to move "paged" system code to
>> supervisor space. Either that or not to page system code at all and
>> use address checks and page locks for every kernel access to
>> user/supervisor mode...
>
>Right. I suspect the right thing to do in the kernel is to not expect to
>do demand paging for access from kernel space. The kernel should check
>in advance (and it can) that all memory references will work. Any memory
>errors in kernel space should probably be treated as fatal.
Clearly we need to have a separate "interrupt" stack for page faults,
and the kernel stack is the logical choice for that. Giving up on
demand paging for the majority of the system code seems to be a high
price to pay (and would take a lot of fun out of the project).
My inclination would be to move a lot of the system code to supervisor
mode. The kernel would be reserved for non-paging code (drivers etc),
or code that made highly-disciplined accesses (the pager itself).
Supervisor mode would be used to implement the system api's etc.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-14 16:20 ` paramucho
@ 2012-02-14 17:30 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-14 17:30 UTC (permalink / raw)
On 2012-02-14 17.20, paramucho wrote:
> On Tue, 14 Feb 2012 14:14:33 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>>> Clearly, you can't demand-page on the same stack that you take page
>>> faults on. Thus, if demand paging is only supported in user and
>>> supervisor mode perhaps the idea is to move "paged" system code to
>>> supervisor space. Either that or not to page system code at all and
>>> use address checks and page locks for every kernel access to
>>> user/supervisor mode...
>>
>> Right. I suspect the right thing to do in the kernel is to not expect to
>> do demand paging for access from kernel space. The kernel should check
>> in advance (and it can) that all memory references will work. Any memory
>> errors in kernel space should probably be treated as fatal.
>
> Clearly we need to have a separate "interrupt" stack for page faults,
> and the kernel stack is the logical choice for that. Giving up on
> demand paging for the majority of the system code seems to be a high
> price to pay (and would take a lot of fun out of the project).
>
> My inclination would be to move a lot of the system code to supervisor
> mode. The kernel would be reserved for non-paging code (drivers etc),
> or code that made highly-disciplined accesses (the pager itself).
> Supervisor mode would be used to implement the system api's etc.
Hmm. I'm not sure demand-paging for the kernel would be such an
important part. In me eyes, it's the demand paging for user processes
that are the interesting thing.
But sure, supervisor mode could be used by the kernel as well.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-14 16:20 ` paramucho
@ 2012-02-14 17:47 ` Johnny Billquist
2012-02-14 18:17 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-14 17:47 UTC (permalink / raw)
On 2012-02-14 17.20, paramucho wrote:
> On Tue, 14 Feb 2012 00:18:44 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
>>> What I realized tonight however is that the E11 bug distracted me from
>>> noticing a bigger problem: The J11 and SimH might give us the backout
>>> information for the stack ([20|26]), but it's of no use because the
>>> MTPI stack operand will have already been overwritten by the MMU trap.
>>> The value we wanted to write to user space (for example) can't be
>>> recovered.
>>
>> Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted.
>> It's a design error in the PDP-11. Gha, that's ugly.
>
> Yes, but only MTPx is affected. MFPx doesn't have the problem (which
> also means that we can use MFPx in solving the MTPx problem).
Huh? I did not get that last part. How does MFPx solve the MTPx problem?
Doing a read before every write?
>>> Basically, if we want to implement demand paging, we're screwed. MFPx
>>> and MTPx are the basic tools used in the kernel to copy information to
>>> and from user space. The workarounds are horrible (i.e. converting the
>>> virtual address to a par/offset pair and mapping via a window). I'll
>>> be very interested to know if the 11/70 has the problem.
>>
>> I'm willing to bet money that the 11/70 behaves the same way.
>>
>> The solution would actually be to make sure the address in userspace you
>> want to read/write is in memory, so that you don't get page faults.
>> Using memory mapping registers for this wouldn't be fun.
>> One more trick that can be used is to only support/use MFPx/MTPx in
>> kernel in the sequence of a push to the stack followed by this. That
>> way, you could, as a part of the restart detect this special case, and
>> back up to the previous instruction to redo the push as well.
>
> My thoughts too. The problem is that the "previous instruction" could
> be 2, 4 or 6 bytes long.
No. It can only be 2 or 4 bytes, since the destination is always -(SP),
or else you have a totally different problem on your hand, which is not
related to this.
I think you can problably pattern match the two previous words in the
instruction stream to figure out which variant it was.
> Noting that MPTI always clears the V-bit, I
> would follow the MPTI instruction with BVS, as below, and use the BVS
> opcode itself as a signature for the special behavior. I seem to
> recall using this technique to solve
>
> 10$: psh <value>
> mtpi <address>
> bvs 10$
>
> (In fact I already use this kind of thing in RUST/XM to handle bus
> errors (trap to 4) instead of address checking in some cases.)
That is also a possibility, since we're talking about the kernel anyway,
which is a well controlled environment.
But I'm not particularly fond of it.
> "Operational" solutions are available to the other issues as well. For
> example, MFPS will never fail to a general register.
Right. However, I think I actually prefer the idea that the kernel
checks/knows that the page is accessible before doing any access.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-14 17:47 ` Johnny Billquist
@ 2012-02-14 18:17 ` paramucho
2012-02-14 19:54 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-14 18:17 UTC (permalink / raw)
>> On Tue, 14 Feb 2012 00:18:44 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>> <snip>
>>
>>>> What I realized tonight however is that the E11 bug distracted me from
>>>> noticing a bigger problem: The J11 and SimH might give us the backout
>>>> information for the stack ([20|26]), but it's of no use because the
>>>> MTPI stack operand will have already been overwritten by the MMU trap.
>>>> The value we wanted to write to user space (for example) can't be
>>>> recovered.
>>>
>>> Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted.
>>> It's a design error in the PDP-11. Gha, that's ugly.
>>
>> Yes, but only MTPx is affected. MFPx doesn't have the problem (which
>> also means that we can use MFPx in solving the MTPx problem).
>
>Huh? I did not get that last part. How does MFPx solve the MTPx problem?
>Doing a read before every write?
"in solving" as in "implementing a workaround."
We get a page fault and we want to see if the instruction causing the
fault was MTPx? So, how do we look at that instruction? With MFPx.
>>>> Basically, if we want to implement demand paging, we're screwed. MFPx
>>>> and MTPx are the basic tools used in the kernel to copy information to
>>>> and from user space. The workarounds are horrible (i.e. converting the
>>>> virtual address to a par/offset pair and mapping via a window). I'll
>>>> be very interested to know if the 11/70 has the problem.
>>>
>>> I'm willing to bet money that the 11/70 behaves the same way.
>>>
>>> The solution would actually be to make sure the address in userspace you
>>> want to read/write is in memory, so that you don't get page faults.
>>> Using memory mapping registers for this wouldn't be fun.
>>> One more trick that can be used is to only support/use MFPx/MTPx in
>>> kernel in the sequence of a push to the stack followed by this. That
>>> way, you could, as a part of the restart detect this special case, and
>>> back up to the previous instruction to redo the push as well.
>>
>> My thoughts too. The problem is that the "previous instruction" could
>> be 2, 4 or 6 bytes long.
>
>No. It can only be 2 or 4 bytes, since the destination is always -(SP),
>or else you have a totally different problem on your hand, which is not
>related to this.
I was thinking of a generalised way of handling (SP)+-related faults
in kernel mode.
<snip>
>I think you can problably pattern match the two previous words in the
>instruction stream to figure out which variant it was.
>
>> Noting that MPTI always clears the V-bit, I
>> would follow the MPTI instruction with BVS, as below, and use the BVS
>> opcode itself as a signature for the special behavior. I seem to
>> recall using this technique to solve
>>
>> 10$: psh <value>
>> mtpi <address>
>> bvs 10$
>>
>> (In fact I already use this kind of thing in RUST/XM to handle bus
>> errors (trap to 4) instead of address checking in some cases.)
>
>That is also a possibility, since we're talking about the kernel anyway,
>which is a well controlled environment.
>
>But I'm not particularly fond of it.
>
>> "Operational" solutions are available to the other issues as well. For
>> example, MFPS will never fail to a general register.
>
>Right. However, I think I actually prefer the idea that the kernel
>checks/knows that the page is accessible before doing any access.
It would have to know that the page remained accessible not just
before the access, but across the access, and that would mean locking
the page. That could get kind of expensive.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-14 18:17 ` paramucho
@ 2012-02-14 19:54 ` Johnny Billquist
2012-02-15 12:58 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-14 19:54 UTC (permalink / raw)
On 2012-02-14 19:17, paramucho wrote:
>>> On Tue, 14 Feb 2012 00:18:44 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>> <snip>
>>>
>>>>> What I realized tonight however is that the E11 bug distracted me from
>>>>> noticing a bigger problem: The J11 and SimH might give us the backout
>>>>> information for the stack ([20|26]), but it's of no use because the
>>>>> MTPI stack operand will have already been overwritten by the MMU trap.
>>>>> The value we wanted to write to user space (for example) can't be
>>>>> recovered.
>>>>
>>>> Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted.
>>>> It's a design error in the PDP-11. Gha, that's ugly.
>>>
>>> Yes, but only MTPx is affected. MFPx doesn't have the problem (which
>>> also means that we can use MFPx in solving the MTPx problem).
>>
>> Huh? I did not get that last part. How does MFPx solve the MTPx problem?
>> Doing a read before every write?
>
> "in solving" as in "implementing a workaround."
>
> We get a page fault and we want to see if the instruction causing the
> fault was MTPx? So, how do we look at that instruction? With MFPx.
Well, this is only a problem when this happens in kernel mode. And you
can just check the failed instruction by checking where the MMR2
register points to see what instruction was executed.
>>>>> Basically, if we want to implement demand paging, we're screwed. MFPx
>>>>> and MTPx are the basic tools used in the kernel to copy information to
>>>>> and from user space. The workarounds are horrible (i.e. converting the
>>>>> virtual address to a par/offset pair and mapping via a window). I'll
>>>>> be very interested to know if the 11/70 has the problem.
>>>>
>>>> I'm willing to bet money that the 11/70 behaves the same way.
>>>>
>>>> The solution would actually be to make sure the address in userspace you
>>>> want to read/write is in memory, so that you don't get page faults.
>>>> Using memory mapping registers for this wouldn't be fun.
>>>> One more trick that can be used is to only support/use MFPx/MTPx in
>>>> kernel in the sequence of a push to the stack followed by this. That
>>>> way, you could, as a part of the restart detect this special case, and
>>>> back up to the previous instruction to redo the push as well.
>>>
>>> My thoughts too. The problem is that the "previous instruction" could
>>> be 2, 4 or 6 bytes long.
>>
>> No. It can only be 2 or 4 bytes, since the destination is always -(SP),
>> or else you have a totally different problem on your hand, which is not
>> related to this.
>
> I was thinking of a generalised way of handling (SP)+-related faults
> in kernel mode.
But this whole problem is a thing when you have something POP something
from the stack. Looking at the previous instruction thought was just for
the MTPx instruction, as that pops the value to write off the stack, and
to restart in kernel mode you then need to re-push the value again.
The idea was simply to restrict the page fault handler to be able to
deal with just a specific sequence, namely PUSH, immediately followed by
MTPx, so that the restart can actually back up and redo the PUSH as well.
But it was just one possible solution to a specific scenario.
In general, I think that doing page-faulting in the kernel is a bad idea.
>>> "Operational" solutions are available to the other issues as well. For
>>> example, MFPS will never fail to a general register.
>>
>> Right. However, I think I actually prefer the idea that the kernel
>> checks/knows that the page is accessible before doing any access.
>
> It would have to know that the page remained accessible not just
> before the access, but across the access, and that would mean locking
> the page. That could get kind of expensive.
You already need to be able to lock pages in memory anyway, as well as
have code to check that memory is paged in, and then do the locking.
This is required for things like DMA, so it's not that you need much more.
And as for "across the access", I'm not really fond of the Unix way of
having user processed get bogged down in the kernel and being preempted
and suspended in kernel mode. I prefer having all the service by the
kernel be finished immediately, and get back out to userland, and wait
there. So you need to be sure that what you are going to access is
available in the beginning, and after that, it will stay around until
your piece of service is finished. No additional checks.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-14 19:54 ` Johnny Billquist
@ 2012-02-15 12:58 ` paramucho
2012-02-15 17:12 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-15 12:58 UTC (permalink / raw)
On Tue, 14 Feb 2012 20:54:51 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>>>> <snip>
>>>>>> What I realized tonight however is that the E11 bug distracted me from
>>>>>> noticing a bigger problem: The J11 and SimH might give us the backout
>>>>>> information for the stack ([20|26]), but it's of no use because the
>>>>>> MTPI stack operand will have already been overwritten by the MMU trap.
>>>>>> The value we wanted to write to user space (for example) can't be
>>>>>> recovered.
>>>>>
>>>>> Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted.
>>>>> It's a design error in the PDP-11. Gha, that's ugly.
>>>>
>>>> Yes, but only MTPx is affected. MFPx doesn't have the problem (which
>>>> also means that we can use MFPx in solving the MTPx problem).
>>>
>>> Huh? I did not get that last part. How does MFPx solve the MTPx problem?
>>> Doing a read before every write?
>>
>> "in solving" as in "implementing a workaround."
>>
>> We get a page fault and we want to see if the instruction causing the
>> fault was MTPx? So, how do we look at that instruction? With MFPx.
>
>Well, this is only a problem when this happens in kernel mode. And you
>can just check the failed instruction by checking where the MMR2
>register points to see what instruction was executed.
Fine, but there is no reason not to use MFPx. Further, we may still
have to perform the same check for code in supervisor mode, and in
that case MFPx is a more general solution. Supervisor mode (SP)+
faults will need to have their stacks protected from overwriting from
other activities.
<snip>
>> I was thinking of a generalised way of handling (SP)+-related faults
>> in kernel mode.
>
>But this whole problem is a thing when you have something POP something
>from the stack. Looking at the previous instruction thought was just for
>the MTPx instruction, as that pops the value to write off the stack, and
>to restart in kernel mode you then need to re-push the value again.
>The idea was simply to restrict the page fault handler to be able to
>deal with just a specific sequence, namely PUSH, immediately followed by
>MTPx, so that the restart can actually back up and redo the PUSH as well.
>But it was just one possible solution to a specific scenario.
>
>In general, I think that doing page-faulting in the kernel is a bad idea.
I'm not convinced...
I've been looking at my existing RUST/XM code, and, given what I've
learned in the last week or so, I think I could add a pager to it. To
do that I'd certainly be handling page faults in the kernel, but from
what I've looked at today it doesn't seem that difficult.
>>>> "Operational" solutions are available to the other issues as well. For
>>>> example, MFPS will never fail to a general register.
>>>
>>> Right. However, I think I actually prefer the idea that the kernel
>>> checks/knows that the page is accessible before doing any access.
>>
>> It would have to know that the page remained accessible not just
>> before the access, but across the access, and that would mean locking
>> the page. That could get kind of expensive.
>
>You already need to be able to lock pages in memory anyway, as well as
>have code to check that memory is paged in, and then do the locking.
>This is required for things like DMA, so it's not that you need much more.
Of course that code will be present, but translating page addresses
(two per address range), applying the lock and then releasing the lock
is a relatively expensive process--I tend to opt for speed when I can.
>And as for "across the access", I'm not really fond of the Unix way of
>having user processed get bogged down in the kernel and being preempted
>and suspended in kernel mode. I prefer having all the service by the
>kernel be finished immediately, and get back out to userland, and wait
>there. So you need to be sure that what you are going to access is
>available in the beginning, and after that, it will stay around until
>your piece of service is finished. No additional checks.
Unix wouldn't be my benchmark in that area. My memory maybe faulty,
but I seem to recall that RSX handles system calls ("executive
directives") in system state, or something like it, effectively
blocking any scheduling activity, or even forks. Tell me it isn't
true!
RT-11, RUST/XM and VMS control preemption entirely through
mutexs/semaphores etc and system state. The kernel code which
implements system calls for processes is just as preemptable as user
mode code (and is reentrant). Anything less than that would seem
pretty antiquated to me.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-15 12:58 ` paramucho
@ 2012-02-15 17:12 ` Johnny Billquist
2012-02-16 13:54 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-15 17:12 UTC (permalink / raw)
On 2012-02-15 13.58, paramucho wrote:
> On Tue, 14 Feb 2012 20:54:51 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>>>>> <snip>
>>>>>>> What I realized tonight however is that the E11 bug distracted me from
>>>>>>> noticing a bigger problem: The J11 and SimH might give us the backout
>>>>>>> information for the stack ([20|26]), but it's of no use because the
>>>>>>> MTPI stack operand will have already been overwritten by the MMU trap.
>>>>>>> The value we wanted to write to user space (for example) can't be
>>>>>>> recovered.
>>>>>>
>>>>>> Sweet jesus. That is right. MFPx/MTPx instructions can't be restarted.
>>>>>> It's a design error in the PDP-11. Gha, that's ugly.
>>>>>
>>>>> Yes, but only MTPx is affected. MFPx doesn't have the problem (which
>>>>> also means that we can use MFPx in solving the MTPx problem).
>>>>
>>>> Huh? I did not get that last part. How does MFPx solve the MTPx problem?
>>>> Doing a read before every write?
>>>
>>> "in solving" as in "implementing a workaround."
>>>
>>> We get a page fault and we want to see if the instruction causing the
>>> fault was MTPx? So, how do we look at that instruction? With MFPx.
>>
>> Well, this is only a problem when this happens in kernel mode. And you
>> can just check the failed instruction by checking where the MMR2
>> register points to see what instruction was executed.
>
> Fine, but there is no reason not to use MFPx. Further, we may still
> have to perform the same check for code in supervisor mode, and in
> that case MFPx is a more general solution. Supervisor mode (SP)+
> faults will need to have their stacks protected from overwriting from
> other activities.
MFPx from supervisor mode is ok. There is nothing that automatically
overwrites the supervisor mode stack, and your backing out of the
instruction at the page fault will restore the stack pointer.
It is only a problem in kernel mode. And I've not yet seen anything that
convinces me that allowing page faults in kernel mode gains you
anything, but can cost you a lot.
>>> I was thinking of a generalised way of handling (SP)+-related faults
>>> in kernel mode.
>>
>> But this whole problem is a thing when you have something POP something
>>from the stack. Looking at the previous instruction thought was just for
>> the MTPx instruction, as that pops the value to write off the stack, and
>> to restart in kernel mode you then need to re-push the value again.
>> The idea was simply to restrict the page fault handler to be able to
>> deal with just a specific sequence, namely PUSH, immediately followed by
>> MTPx, so that the restart can actually back up and redo the PUSH as well.
>> But it was just one possible solution to a specific scenario.
>>
>> In general, I think that doing page-faulting in the kernel is a bad idea.
>
> I'm not convinced...
:-)
What do you expect do to if you get a page fault in kernel mode?
Suspend the execution of something in kernel mode while the page is
being read in, in order to be able to restart the execution. This
becomes very messy, since this means you need to be able to suspend
execution at random places in the kernel.
I simply does not think that is a good idea.
> I've been looking at my existing RUST/XM code, and, given what I've
> learned in the last week or so, I think I could add a pager to it. To
> do that I'd certainly be handling page faults in the kernel, but from
> what I've looked at today it doesn't seem that difficult.
Handling page faults in the kernel is not hard. Handling page faults
which happens in the kernel is anther story, which is what we talk about
above.
>>>>> "Operational" solutions are available to the other issues as well. For
>>>>> example, MFPS will never fail to a general register.
>>>>
>>>> Right. However, I think I actually prefer the idea that the kernel
>>>> checks/knows that the page is accessible before doing any access.
>>>
>>> It would have to know that the page remained accessible not just
>>> before the access, but across the access, and that would mean locking
>>> the page. That could get kind of expensive.
>>
>> You already need to be able to lock pages in memory anyway, as well as
>> have code to check that memory is paged in, and then do the locking.
>> This is required for things like DMA, so it's not that you need much more.
>
> Of course that code will be present, but translating page addresses
> (two per address range), applying the lock and then releasing the lock
> is a relatively expensive process--I tend to opt for speed when I can.
Instead having page faults possible in the kernel comes with other
costs, which are much higher, I think.
>> And as for "across the access", I'm not really fond of the Unix way of
>> having user processed get bogged down in the kernel and being preempted
>> and suspended in kernel mode. I prefer having all the service by the
>> kernel be finished immediately, and get back out to userland, and wait
>> there. So you need to be sure that what you are going to access is
>> available in the beginning, and after that, it will stay around until
>> your piece of service is finished. No additional checks.
>
> Unix wouldn't be my benchmark in that area. My memory maybe faulty,
> but I seem to recall that RSX handles system calls ("executive
> directives") in system state, or something like it, effectively
> blocking any scheduling activity, or even forks. Tell me it isn't
> true!
Yes, Unix is definitely not a benchmark here. :-) Unix have this ugle
EINTR error code from system calls because of this.
Yes, system calls are handled in the kernel in RSX, and are run to
completion before normal scheduling can continue. However, all system
calls are really just performing one thing, which always is known to be
able to run from start to finish without blocking or having other
issues, so system calls never really block anything. System calls are at
the same level as forks, and of course you cannot allow two system
calls, or fork processes to run simultaneously, since that would mean
you get data corruption in the kernel.
> RT-11, RUST/XM and VMS control preemption entirely through
> mutexs/semaphores etc and system state. The kernel code which
> implements system calls for processes is just as preemptable as user
> mode code (and is reentrant). Anything less than that would seem
> pretty antiquated to me.
RT-11 does no such thing. I remember having this discussion in the past
(with you?). Whenever any one program enters USR, all other calls will
be blocking until the first called exits USR again, and then one other
process can enter that whole thing. So only one program at a time can
for example create a file, or use the command line parser.
But to be clear, RSX protects the whole kernel through a lock, and does
not depend on system state or processor priority levels (apart from the
actual lock operations, which are using the IPL itself to protect them).
Which is why adding MP to RSX was also a rather simple operation.
RT-11 plays with the IPL at various places to protect code which is
sensitive.
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.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-15 17:12 ` Johnny Billquist
@ 2012-02-16 13:54 ` paramucho
2012-02-16 20:15 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-16 13:54 UTC (permalink / raw)
On Wed, 15 Feb 2012 18:12:33 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>It is only a problem in kernel mode. And I've not yet seen anything that
>convinces me that allowing page faults in kernel mode gains you
>anything, but can cost you a lot.
<snip>
>What do you expect do to if you get a page fault in kernel mode?
>Suspend the execution of something in kernel mode while the page is
>being read in, in order to be able to restart the execution. This
>becomes very messy, since this means you need to be able to suspend
>execution at random places in the kernel.
Nothing random about it at all. There are key points of contact with
processes, each having it's own specific reason. At present I manage
some of these contact points with MFPx/MFTx, in other places by
mapping a kernel window. In either situation I will be able to choose
if I want to lock a page in advance or not. It's not much more
complicated than the current situation (where each point of contact is
expected to care of unexpected errors anyway).
>I simply does not think that is a good idea.
<snip>
>Instead having page faults possible in the kernel comes with other
>costs, which are much higher, I think.
We simply disagree on the issue of kernel page faults.
>>> And as for "across the access", I'm not really fond of the Unix way of
>>> having user processed get bogged down in the kernel and being preempted
>>> and suspended in kernel mode. I prefer having all the service by the
>>> kernel be finished immediately, and get back out to userland, and wait
>>> there. So you need to be sure that what you are going to access is
>>> available in the beginning, and after that, it will stay around until
>>> your piece of service is finished. No additional checks.
<snip>
>Yes, system calls are handled in the kernel in RSX, and are run to
>completion before normal scheduling can continue. However, all system
>calls are really just performing one thing, which always is known to be
>able to run from start to finish without blocking or having other
>issues, so system calls never really block anything. System calls are at
>the same level as forks, and of course you cannot allow two system
>calls, or fork processes to run simultaneously, since that would mean
>you get data corruption in the kernel.
It was a great idea when RSX was very young and a simple multi-tasking
system. As a grown-up general-purpose O/S I think the approach
involves some serious limitations. While I'm certain that the earlier
systm calls were in and out of the kernel pretty quickly I'm not sure
that that's the case for a lot of the later directives.
>> RT-11, RUST/XM and VMS control preemption entirely through
>> mutexs/semaphores etc and system state. The kernel code which
>> implements system calls for processes is just as preemptable as user
>> mode code (and is reentrant). Anything less than that would seem
>> pretty antiquated to me.
>
>RT-11 does no such thing. I remember having this discussion in the past
>(with you?). Whenever any one program enters USR, all other calls will
>be blocking until the first called exits USR again, and then one other
>process can enter that whole thing. So only one program at a time can
>for example create a file, or use the command line parser.
I don't think your previous "discussion" was with me, or least I hope
it wasn't, because the view you present is completely inaccurate.
The "USR" is to RT-11 what the "F11ACP" is to RSX. You can't describe
the scheduling dynamics of the RSX kernel on the basis of the F11ACP
behavior and you can't describe RT-11's scheduling dynamics on the
basis of the USR behavior. They're quite different things.
The RT-11 USR is a sub-system which handles ACP-like services, driver
fetch and the like. Access to the USR (ACP) is queued on a system-wide
basis. I am not sure whether the RSX F11ACP is single-threaded for all
devices or not.
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.
>But to be clear, RSX protects the whole kernel through a lock, and does
>not depend on system state or processor priority levels (apart from the
>actual lock operations, which are using the IPL itself to protect them).
>Which is why adding MP to RSX was also a rather simple operation.
By "system state" I mean basically the same state as "fork state". In
RSX that also involves a switch to the "system stack". System state
runs at IPL 0. $DIRSV switches to system state.
>RT-11 plays with the IPL at various places to protect code which is
>sensitive.
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
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 ;;;
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.
The idea that RT-11 manages system synchronisation via IPL is simply
wrong. System state and queues are used to manage synchronisation.
>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.
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.
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.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-16 13:54 ` paramucho
@ 2012-02-16 20:15 ` Johnny Billquist
2012-02-17 12:41 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-16 20:15 UTC (permalink / raw)
On 2012-02-16 14.54, paramucho wrote:
> On Wed, 15 Feb 2012 18:12:33 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>> It is only a problem in kernel mode. And I've not yet seen anything that
>> convinces me that allowing page faults in kernel mode gains you
>> anything, but can cost you a lot.
> <snip>
>> What do you expect do to if you get a page fault in kernel mode?
>> Suspend the execution of something in kernel mode while the page is
>> being read in, in order to be able to restart the execution. This
>> becomes very messy, since this means you need to be able to suspend
>> execution at random places in the kernel.
>
> Nothing random about it at all. There are key points of contact with
> processes, each having it's own specific reason. At present I manage
> some of these contact points with MFPx/MFTx, in other places by
> mapping a kernel window. In either situation I will be able to choose
> if I want to lock a page in advance or not. It's not much more
> complicated than the current situation (where each point of contact is
> expected to care of unexpected errors anyway).
There are a whole bunch of them, though, and for different reasons, and
under different conditions. You basically want to be able to handle page
faults at those points. I prefer that the kernel does explicit control
when it tries to do such stuff, and do it in advance. And then have a
controlled behavior when/if memory is not paged in. You prefer to handle
page faults in the kernel.
>> I simply does not think that is a good idea.
> <snip>
>> Instead having page faults possible in the kernel comes with other
>> costs, which are much higher, I think.
>
> We simply disagree on the issue of kernel page faults.
I'm perfectly fine with disagreeing on this then.
>>>> And as for "across the access", I'm not really fond of the Unix way of
>>>> having user processed get bogged down in the kernel and being preempted
>>>> and suspended in kernel mode. I prefer having all the service by the
>>>> kernel be finished immediately, and get back out to userland, and wait
>>>> there. So you need to be sure that what you are going to access is
>>>> available in the beginning, and after that, it will stay around until
>>>> your piece of service is finished. No additional checks.
> <snip>
>
>> Yes, system calls are handled in the kernel in RSX, and are run to
>> completion before normal scheduling can continue. However, all system
>> calls are really just performing one thing, which always is known to be
>> able to run from start to finish without blocking or having other
>> issues, so system calls never really block anything. System calls are at
>> the same level as forks, and of course you cannot allow two system
>> calls, or fork processes to run simultaneously, since that would mean
>> you get data corruption in the kernel.
>
> It was a great idea when RSX was very young and a simple multi-tasking
> system. As a grown-up general-purpose O/S I think the approach
> involves some serious limitations. While I'm certain that the earlier
> systm calls were in and out of the kernel pretty quickly I'm not sure
> that that's the case for a lot of the later directives.
I can't really think of any system call that really need to sit in the
kernel for extended periods. I really do think that is a bad idea, and
that is what Unix prefers.
>>> RT-11, RUST/XM and VMS control preemption entirely through
>>> mutexs/semaphores etc and system state. The kernel code which
>>> implements system calls for processes is just as preemptable as user
>>> mode code (and is reentrant). Anything less than that would seem
>>> pretty antiquated to me.
>>
>> RT-11 does no such thing. I remember having this discussion in the past
>> (with you?). Whenever any one program enters USR, all other calls will
>> be blocking until the first called exits USR again, and then one other
>> process can enter that whole thing. So only one program at a time can
>> for example create a file, or use the command line parser.
>
> I don't think your previous "discussion" was with me, or least I hope
> it wasn't, because the view you present is completely inaccurate.
I don't remember who it was with. Not important anyway.
> The "USR" is to RT-11 what the "F11ACP" is to RSX. You can't describe
> the scheduling dynamics of the RSX kernel on the basis of the F11ACP
> behavior and you can't describe RT-11's scheduling dynamics on the
> basis of the USR behavior. They're quite different things.
F11ACP is a process, scheduled just like any other process. And you are
allowed to have as many of them as you want.
> The RT-11 USR is a sub-system which handles ACP-like services, driver
> fetch and the like. Access to the USR (ACP) is queued on a system-wide
> basis. I am not sure whether the RSX F11ACP is single-threaded for all
> devices or not.
It is hard to describe F11ACP in that way. First of all, you are allowed
to have several F11ACP running, one for each device if you want to.
Second, it is not really single-threaded as such. It is threading on a
device level, though. You cannot have several opens or creates going on
in parallel on a single device. The first file needs to be created
before the second one can, for example (almost an obvious comment, but
anyway...)
But you can have several creates being done on different devices at the
same time.
The reason for wanting to have a separate F11ACP for your device is
caching. F11ACP cache file headers, but there is only so much caching
that can be done in one process. Having a separate process allows it to
have a separate cache, since this cache is held in the process memory.
> 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.
But it's way more locking things out than RSX ever does. 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.
>> But to be clear, RSX protects the whole kernel through a lock, and does
>> not depend on system state or processor priority levels (apart from the
>> actual lock operations, which are using the IPL itself to protect them).
>> Which is why adding MP to RSX was also a rather simple operation.
>
> By "system state" I mean basically the same state as "fork state". In
> RSX that also involves a switch to the "system stack". System state
> runs at IPL 0. $DIRSV switches to system state.
Ah. $DIRSV in RSX is the way you get to "system state" from a user mode
system call. You can also get there through an interrupt, which then
gets through $INTSI.
In reality, the "system state" is visible as the stack depth value. When
it is 0, you are in system state. If it's +1 you are in user mode, and
if it is <0, you are in an interrupt handler. Anything <1 means you are
in kernel mode.
(You can also get there through $INTSC, $INTSE and $INTSV)
>> RT-11 plays with the IPL at various places to protect code which is
>> sensitive.
>
> 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. 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.)
> 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.
That's what the forks are for. If RT-11 don't use forks for this, what
do RT-11 use forks 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. 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.
> 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.
>> 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? Honestly asking
since I don't know the answer myself, and cannot think of any straight
off my head.
> 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?
> 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.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-16 20:15 ` Johnny Billquist
@ 2012-02-17 12:41 ` paramucho
2012-02-17 17:13 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-17 12:41 UTC (permalink / raw)
On Thu, 16 Feb 2012 21:15:55 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>> 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.
<snip>
>> 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 #<PS>,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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-17 12:41 ` paramucho
@ 2012-02-17 17:13 ` Johnny Billquist
2012-02-18 11:24 ` Johnny Billquist
` (2 more replies)
0 siblings, 3 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-17 17:13 UTC (permalink / raw)
On 2012-02-17 13.41, paramucho wrote:
> On Thu, 16 Feb 2012 21:15:55 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
>>> 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).
I was looking in RMONFB.MAC.
C$SIGN almost immediately do an EMT 374, which ends up in USR.
What am I missing?
>> But it's way more locking things out than RSX ever does.
>
> That's confusing the "ACP" with the system.
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.
RSX is doing things in a very different way. We can talk about the RSX
way as well, separately, if you want to.
>> 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.
It is somewhat popular when you want to maximize performance in RSX.
Keep doing other work while file operations are being processed.
Asynchronous I/O, you know...
But when it don't exist, I would not expect people to ask for it.
> 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*.
In more recent versions of VMS, they moved much of the ACP code into the
kernel, to improve performance by avoiding the context switching, so you
have something called an XQP doing the ACP work, but the interface did
not change.
And you still have the ACP around, for some operations.
You'll see it if you look at what processes are running.
I can possibly buy that RT-11 works like windows, but mostly because I
don't know how windows works, so I can buy any claims for it. :-)
> 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.
>>> 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.
Curious question: what do you call the state an interrupt handler gets
in to?
And please note that nothing after this point in RSX ever needs to raise
the IPL.
>> 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.
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.
So, each program normally have its own copy of FCS linked in. Or you can
link in RMS instead of FCS, if you prefer that. Or you can have your
program do file I/O without either FCS or RMS, if you prefer that.
>>> 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.
And in RSX all of these kind of manipulations are done at IPL 0.
But I'm trying to understand ENSYS a bit more right now. See below...
>> 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.
Hmm. I just realized is misread a BIC as a BIS, which is why I believed
that code after ENSYS was running at IPL 7.
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.
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.
So, sometimes you protect shared data through raising the IPL, sometimes
through mutexes, 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. It also makes is much
harder if you ever want to move to a system where the IPL level is not
enough (such as in MP), as you have to identify whereever you are
raising the IPL, and get something like spinning locks in place at all
those places.
> 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 ";;;").
Yes. Not surprised, since all instructions in device drivers which
happens between an interrupt, and the creation of the fork, for example,
will be running at a raised IPL.
Also, if you search for ";;;", you also be getting a lot of empty lines,
which is just because comments are running over several lines, and each
line is prefixed with ;;;, if the code being commented is running at a
raised IPL. But it's arguable how relevant empty lines with just a
comment is...
Another nice point here is that device drivers structures are not being
manipulated by more than one CPU, since a device can only be attached to
one CPU at a time, so those pieces are the only ones where IPL is
enough, and you don't have to worry about MP issues in RSX. The fork
queue, however, is shared between all processors, and needs to be
properly protected.
>>> 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.
Yes. My mistake. I had misread the BIC as a BIS.
>>> 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.
Yes. And I totally accept that. This is exactly what the IPL is for. The
structure being the fork list in RSX, and to switch to the right stack
in RT-11.
> 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.
Right.
> 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.
Right.
>>>> 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."
I said "does *not* complete immediately", which means they will block.
For scheduling to be relevant in the middle of a system call, the system
call will have to be stalled for some significant time for it to be
relevant.
>> 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.
Looking at CREPRC, it creates the process synchronously, but it would
not appear as if it should take any time, so I don't actually think it
qualifies.
MOUNT definitely can take time. I would like to check a little more
under the hood of that one.
RMSRUNDWN is definitely a cheat. It calls $CLOSE in turn, for each
opened file.
And $CLOSE is non-blocking, if you want to, like most RMS operations.
But if it actually is executing the file closing in the kernel, and
calling out to RMS, then yep, that too is a rather long system call.
>>> 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.
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.
Services in DCL and RMS can definitely call upon the system to perform
services.
> 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.
$OPEN, $CLOSE, and so on, are in RMS. RMS in turn do $QIO calls to
perform the neccesary operations on the device. $QIO is the system call.
$OPEN is an RMS function. RMS can, and will, definitely call the system
to perform operations. But you can also circumvent RMS if you want to,
by calling the device directly on your own.
>>> 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.
:-)
The ACP design from RSX is still present in VMS, as is the $QIO, upon
which almost everything else rests.
But yes, VMS do some stuff rather different than RSX. No doubt about that.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-17 17:13 ` Johnny Billquist
@ 2012-02-18 11:24 ` Johnny Billquist
2012-02-18 14:28 ` paramucho
2012-02-18 11:55 ` paramucho
2012-02-20 2:22 ` Jerome H. Fine
2 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-18 11:24 UTC (permalink / raw)
On 2012-02-17 18:13, Johnny Billquist wrote:
> On 2012-02-17 13.41, paramucho wrote:
>> On Thu, 16 Feb 2012 21:15:55 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>> <snip>
>>
>>> 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.
>
> It is somewhat popular when you want to maximize performance in RSX.
> Keep doing other work while file operations are being processed.
> Asynchronous I/O, you know...
>
> But when it don't exist, I would not expect people to ask for it.
It might be pointing out the obvious, but in RSX, when you open a file,
or do whatever file operations, scheduling is still going on. So, not
only can your program continue running while the file open is in
progress, other programs will also be scheduled during this, and can
have their file operations processed at the same time, as well as doing
anything else.
>> 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.
(And obviously at a cost...)
>>>> 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.
A clarification of my view might help here:
Both OSes use IPL to protect/synchronize access to some structures.
However, in RSX this is basically just one structure, while RT-11 uses
the IPL way to protect many things.
In RSX, protection from multiple processes and drivers manipulating
shared data in an uncontrolled way is through the fork. No other way is
allowed. You cannot bump just bump the IPL and then think you are safe
in RSX. So it is not done. This is different than RT-11, where this is
clearly done. The RSX way is not cheaper, but it does make things more
uniform and easy to follow (I think), and it makes it much easier to
make the system work in an MP environment.
I'm not sure I'd use the term "hardware synchronization", since it is
essentially synchronization between processes. Yes, IPLs are also used
for hardware synchronization, but that is essentially talking about
interrupt handlers preventing additional interrupts while processing one
(or at least that is my quick reflection on what hardware
synchronization is).
>> 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 ";;;").
>
> Yes. Not surprised, since all instructions in device drivers which
> happens between an interrupt, and the creation of the fork, for example,
> will be running at a raised IPL.
> Also, if you search for ";;;", you also be getting a lot of empty lines,
> which is just because comments are running over several lines, and each
> line is prefixed with ;;;, if the code being commented is running at a
> raised IPL. But it's arguable how relevant empty lines with just a
> comment is...
>
> Another nice point here is that device drivers structures are not being
> manipulated by more than one CPU, since a device can only be attached to
> one CPU at a time, so those pieces are the only ones where IPL is
> enough, and you don't have to worry about MP issues in RSX. The fork
> queue, however, is shared between all processors, and needs to be
> properly protected.
By the way, checking in M+ V4.6, I get about 6500 hits when searching
for ;;;
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-17 17:13 ` Johnny Billquist
2012-02-18 11:24 ` Johnny Billquist
@ 2012-02-18 11:55 ` paramucho
2012-02-18 20:58 ` Johnny Billquist
2012-02-20 2:22 ` Jerome H. Fine
2 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-18 11:55 UTC (permalink / raw)
On Fri, 17 Feb 2012 18:13:44 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>> 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.
<snip>
>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.
>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?
<snip>
>> 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.
>In more recent versions of VMS, they moved much of the ACP code into the
>kernel, to improve performance by avoiding the context switching, so you
>have something called an XQP doing the ACP work, but the interface did
>not change.
>And you still have the ACP around, for some operations.
>You'll see it if you look at what processes are running.
Yes, I remember when they put XQP in. I spent a few years working with
VMS. I remembed thinking that XDP was a bit more like the RUST/XM ACP
concept.
>I can possibly buy that RT-11 works like windows, but mostly because I
>don't know how windows works, so I can buy any claims for it. :-)
>
>> 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.
<snip>
>> 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
>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.
(And, of course, the system/fork state exit path must also raise IPL,
but you know that.)
<snip>
>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.
<snip>
>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.
>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.
>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.
> 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.
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.
<snip>
>>>> 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."
>
>I said "does *not* complete immediately", which means they will block.
>For scheduling to be relevant in the middle of a system call, the system
>call will have to be stalled for some significant time for it to be
>relevant.
My claims were that VMS system calls are not wrapped in system state
as they are in RSX and that VMS system calls could themselves issue
system calls (where RSX clearly cannot). I didn't make a statement
about whether VMS system calls return immediately or not. That's a
separate issue and not necessary for my claim.
<snip>
>>> 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.
>
>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)
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-18 11:24 ` Johnny Billquist
@ 2012-02-18 14:28 ` paramucho
2012-02-18 20:07 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-18 14:28 UTC (permalink / raw)
On Sat, 18 Feb 2012 12:24:59 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>It might be pointing out the obvious, but in RSX, when you open a file,
>or do whatever file operations, scheduling is still going on. So, not
>only can your program continue running while the file open is in
>progress, other programs will also be scheduled during this, and can
>have their file operations processed at the same time, as well as doing
>anything else.
The USR does not block scheduling or ASTs in RT-11. Processes queue
for directory services, that's all. An RSX system with a single F11ACP
(and/or a single system disk) would be more or less equivalent for the
great majority of programs which issue synchronous directory services.
The RSX systems I use have a single F11ACP, and since they mostly have
a single system device there wouldn't be much point in having more
than one. I don't think any of the software I use depends on
asynchronous directory services. It's just not something most folk
need to have. In previous posts I've described how one can circumvent
the USR queueing behavior when it's actually necessary.
<snip>
>>>>> 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.
>
>A clarification of my view might help here:
>Both OSes use IPL to protect/synchronize access to some structures.
>However, in RSX this is basically just one structure, while RT-11 uses
>the IPL way to protect many things.
>
>In RSX, protection from multiple processes and drivers manipulating
>shared data in an uncontrolled way is through the fork. No other way is
>allowed. You cannot bump just bump the IPL and then think you are safe
>in RSX. So it is not done. This is different than RT-11, where this is
>clearly done. The RSX way is not cheaper, but it does make things more
>uniform and easy to follow (I think), and it makes it much easier to
>make the system work in an MP environment.
Life wasn't meant to be easy for an O/S.
I addressed this point in my other post where I pointed out that VMS
system services make extensive use of SETIPL. It's everywhere in the
system service code.
VMS, like RT-11, avoids blocking the scheduler and ASTs as little as
possible by selectively using a range of devices. RSX wraps everything
in system state. It gains some simplicity in doing so but loses, I
think, by increasing scheduling and AST latencies.
The RSX approach of wrapping system calls in system state means that
system calls can't afford to hang about in the kernel because of the
increased scheduling and AST latencies. That's a hard discipline to
maintain across the life of a system. System creep is unavoidable. I
don't have access to the M+ sources, but I notice a significant
increase in the number of executive directives and think to myself: "I
bet some of these are taking a lot longer than would have been
permitted in early versions of RSX."
<snip>
>>> 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 ";;;").
<snip>
>By the way, checking in M+ V4.6, I get about 6500 hits when searching
>for ;;;
:-)
GRDRV.MAC, LSDRV.MAC are the heaviest users...
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-18 14:28 ` paramucho
@ 2012-02-18 20:07 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-18 20:07 UTC (permalink / raw)
On 2012-02-18 15:28, paramucho wrote:
> On Sat, 18 Feb 2012 12:24:59 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
>> It might be pointing out the obvious, but in RSX, when you open a file,
>> or do whatever file operations, scheduling is still going on. So, not
>> only can your program continue running while the file open is in
>> progress, other programs will also be scheduled during this, and can
>> have their file operations processed at the same time, as well as doing
>> anything else.
>
> The USR does not block scheduling or ASTs in RT-11. Processes queue
> for directory services, that's all. An RSX system with a single F11ACP
> (and/or a single system disk) would be more or less equivalent for the
> great majority of programs which issue synchronous directory services.
If you have a single disk, then yes, calls like open and close will be
serialized for that disk. But you can still do operations on other
disks. A single F11ACP does not serialize access to different disks, so
the point is the number of disks, not the number of ACPs.
> The RSX systems I use have a single F11ACP, and since they mostly have
> a single system device there wouldn't be much point in having more
> than one. I don't think any of the software I use depends on
> asynchronous directory services. It's just not something most folk
> need to have. In previous posts I've described how one can circumvent
> the USR queueing behavior when it's actually necessary.
Indeed, if you only have one disk, it is totally pointless to have more
than one ACP, as a device can only be using one ACP.
But a single ACP does not mean that the ACP is single threaded. It
performs operations on different disks in parallel.
>>>>>> 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.
>>
>> A clarification of my view might help here:
>> Both OSes use IPL to protect/synchronize access to some structures.
>> However, in RSX this is basically just one structure, while RT-11 uses
>> the IPL way to protect many things.
>>
>> In RSX, protection from multiple processes and drivers manipulating
>> shared data in an uncontrolled way is through the fork. No other way is
>> allowed. You cannot bump just bump the IPL and then think you are safe
>> in RSX. So it is not done. This is different than RT-11, where this is
>> clearly done. The RSX way is not cheaper, but it does make things more
>> uniform and easy to follow (I think), and it makes it much easier to
>> make the system work in an MP environment.
>
> Life wasn't meant to be easy for an O/S.
There is no good point for making it harder than it already is.
> I addressed this point in my other post where I pointed out that VMS
> system services make extensive use of SETIPL. It's everywhere in the
> system service code.
>
> VMS, like RT-11, avoids blocking the scheduler and ASTs as little as
> possible by selectively using a range of devices. RSX wraps everything
> in system state. It gains some simplicity in doing so but loses, I
> think, by increasing scheduling and AST latencies.
I'll happily challenge that. Latencies in RSX are very good in fact. If
anything, VMS could do with some improvement (rip out the cruft added,
and get back to its roots).
The claim that RT-11 avoids blocking the scheduler is true in as much as
scheduling can happen sometimes while the process is inside the kernel.
However, RT-11 blocks processes from some operations if any other
process is doing the same (or similar operation), which makes the
avoided scheduling block more like smoke than actual value.
And interrupts are occasionally locked out in various places in RT-11,
even if for just short intervals, while they are locked out much less in
RSX.
> The RSX approach of wrapping system calls in system state means that
> system calls can't afford to hang about in the kernel because of the
> increased scheduling and AST latencies. That's a hard discipline to
> maintain across the life of a system. System creep is unavoidable. I
> don't have access to the M+ sources, but I notice a significant
> increase in the number of executive directives and think to myself: "I
> bet some of these are taking a lot longer than would have been
> permitted in early versions of RSX."
Right. System calls cannot afford to hang around. They are always
required to finish without any sleeps, delays, mutex hangs, or so on.
It is really not a hard discipline to follow, I think. In fact, I think
it is wonderful, makes a lot of sense, and is much better than the
alternative. However, I do recognize that it takes a little more
thinking, and a different approach to some problems than the
traditional, straight forward one. But it is an effort well worth it.
And no, the "new" system services in M+ do not take much more time than
the "old" ones. It still behaves the same way. If it would not, then the
system would not be usable, and RSX systems have been used
(traditionally) in plenty of hard realtime system applications. That's
the normal place where you still find RSX systems (yes, I know of plenty
still in use in the industry).
It's partly just because of the very good response times and latencies
that RSX was so successful.
>>>> 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 ";;;").
> <snip>
>> By the way, checking in M+ V4.6, I get about 6500 hits when searching
>> for ;;;
>
> :-)
>
> GRDRV.MAC, LSDRV.MAC are the heaviest users...
Heh. Neither even exists in M+.
But that is two device drivers, if they follow the normal RSX naming
conventions.
Biggest offenders in M+ are:
CRASH.MAC - which is the crash dump code, run only when the system have
crashed.
TTICH.MAC - input part of the terminal device driver
(Actually, all of the terminal driver is a big contributor, the terminal
driver in RSX is horribly complex.)
Both of these have more than 1000 occurances of ;;; each.
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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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:53 ` paramucho
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-18 20:58 UTC (permalink / raw)
On 2012-02-18 12:55, paramucho wrote:
> On Fri, 17 Feb 2012 18:13:44 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>>> 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?
>
> <snip>
>> 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
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-17 17:13 ` Johnny Billquist
2012-02-18 11:24 ` Johnny Billquist
2012-02-18 11:55 ` paramucho
@ 2012-02-20 2:22 ` Jerome H. Fine
2012-02-20 6:07 ` paramucho
2 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-20 2:22 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]
I have been following Johnny's and Ian's discussion, but since I know
so little about the internals of RSX-11 and VMS, I have not commented.
>Johnny Billquist wrote:
> $OPEN, $CLOSE, and so on, are in RMS. RMS in turn do $QIO calls to
> perform the neccesary operations on the device. $QIO is the system
> call. $OPEN is an RMS function. RMS can, and will, definitely call the
> system to perform operations. But you can also circumvent RMS if you
> want to, by calling the device directly on your own.
Under RT-11, many of the distributed SAV programs
circumvent the USR and perform disk I/O directly,
especially when READ ONLY access to the disk
is sufficient.
DIR, PIP and BINCOM are examples. They read
the directories to obtain access to the files on the
disk, in particular when a "wild card" specification
is used for the files name. I would imagine that this
would allow a system job access to the directory
on the disk even if a lower priority job was using the
USR. I have never tested to determine if this is true,
but it is very likely.
Sometimes, both direct access and the USR are required,
in particular when some files are read and others are
written. If examples of this type of activity are of interest,
please ask.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 1815 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-18 20:58 ` Johnny Billquist
@ 2012-02-20 2:29 ` Jerome H. Fine
2012-02-20 5:54 ` paramucho
2012-02-20 5:53 ` paramucho
1 sibling, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-20 2:29 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 2093 bytes --]
I have been following Johnny's and Ian's discussion, but since I know
so little about the internals of RSX-11 and VMS, I have not commented.
This comment is only to note that I suggest a more careful look at
the code used for C$SISP.
>Johnny Billquist wrote:
>>> 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?
If the code is inspected carefully, it can be seen that the
C$SISP sets a flag in R4 differently from the flag set in
R4 byC$SIGN. In addition, the files on channels 0 to 8
are NOT purged prior to the common code starting at
label 11$:
At least that is my understanding of the above example.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 3845 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-18 20:58 ` Johnny Billquist
2012-02-20 2:29 ` Jerome H. Fine
@ 2012-02-20 5:53 ` paramucho
2012-02-20 10:28 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-20 5:53 UTC (permalink / raw)
On Sat, 18 Feb 2012 21:58:28 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-18 12:55, paramucho wrote:
>> On Fri, 17 Feb 2012 18:13:44 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>> <snip>
>>>> 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 ; R0 = [ 3 | 8. ]
>10$: EMT 374 ; .purge #8., .purge #7, etc
> DECB R0 ; next channel
> BGE 10$ ; more channels to do
> BR 11$ ; join common code
EMT 374, subcode 3 is .PURGE. Channels 8. down to 0 are purged. .PURGE
checks the conditions I listed.
>If I remember right, this is from RT-11 V5.5, so it might be that things
>got changed after that?
It's pretty much the same.
<snip>
>> 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.
At some point in the OPEN process you'd have to "register" an open
with the fully qualified, normalized file name/id and the access mode.
<snip>
>> 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... :-)
Latency is typically measured as "average" and "worst" case.
Occasional short sequences of four or so instructions doesn't alter
either of those measures.
>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?
The point is that in RSX an executive directive is effectively a "fork
routine", and these directives can take quite a considerable time to
complete. Creating a new task is not a simple, short process. The
worst-case fork latency in RSX is the time it takes to execute the
longest executive directive.
It is utterly clear that VMS could not handled system calls in system
state--thousands of instructions are sometimes required.
>> 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.
I must be getting old...I'm starting to forget RT-11...
This post addresses the points raised in the other post...
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-20 2:29 ` Jerome H. Fine
@ 2012-02-20 5:54 ` paramucho
2012-02-20 17:14 ` Jerome H. Fine
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-20 5:54 UTC (permalink / raw)
On Sun, 19 Feb 2012 21:29:56 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
>I have been following Johnny's and Ian's discussion, but since I know
>so little about the internals of RSX-11 and VMS, I have not commented.
>
>This comment is only to note that I suggest a more careful look at
>the code used for C$SISP.
>
> >Johnny Billquist wrote:
>
>>>> 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?
>
>If the code is inspected carefully, it can be seen that the
>C$SISP sets a flag in R4 differently from the flag set in
>R4 byC$SIGN. In addition, the files on channels 0 to 8
>are NOT purged prior to the common code starting at
>label 11$:
>
>At least that is my understanding of the above example.
.CSIGEN (C$SIGN:) purges. .CSISPC (C$SISP:) does not.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-20 2:22 ` Jerome H. Fine
@ 2012-02-20 6:07 ` paramucho
2012-02-21 3:29 ` Jerome H. Fine
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-20 6:07 UTC (permalink / raw)
On Sun, 19 Feb 2012 21:22:03 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
>I have been following Johnny's and Ian's discussion, but since I know
>so little about the internals of RSX-11 and VMS, I have not commented.
>
> >Johnny Billquist wrote:
>
>> $OPEN, $CLOSE, and so on, are in RMS. RMS in turn do $QIO calls to
>> perform the neccesary operations on the device. $QIO is the system
>> call. $OPEN is an RMS function. RMS can, and will, definitely call the
>> system to perform operations. But you can also circumvent RMS if you
>> want to, by calling the device directly on your own.
>
>Under RT-11, many of the distributed SAV programs
>circumvent the USR and perform disk I/O directly,
>especially when READ ONLY access to the disk
>is sufficient.
>
>DIR, PIP and BINCOM are examples. They read
>the directories to obtain access to the files on the
>disk, in particular when a "wild card" specification
>is used for the files name. I would imagine that this
>would allow a system job access to the directory
>on the disk even if a lower priority job was using the
>USR. I have never tested to determine if this is true,
>but it is very likely.
>
>Sometimes, both direct access and the USR are required,
>in particular when some files are read and others are
>written. If examples of this type of activity are of interest,
>please ask.
RT-11 does not provide a directory scan system call, so utilities must
access the directory directly to scan them. RT-11 guarantees that a
directory structure begins at block 6 of a file structured device.
Early versions of RT-11 supported a mechanism by which the USR would
"callback" a program at critical points with a pointer to the
directory entry being processed. Most if not all this utility code has
been replaced by later system calls which read and write individual
directory entries without a callback. However, except for disk
initialization etc, no RT-11 utility directly modifies a directory
with a .READ/.WRITE sequence.
RT-11 magtape and cassette drivers are "special devices" with their
own built-in ACPs. Directory operations on these devices may be
handled via the USR or by using .SPFUN (special functions) to
communicate directly with the driver. In this case the operation is
analogous to the RSX QIO interface. Since tape devices can be
particularly time consuming it is sometimes advantageous to handle
their directory operations without blocking the USR.
The "special device" interface and RT-11 directory structure can be
used to simulate other kinds of devices. I use these two features to
implement a transparent remote file system which permits PDP-11 users
access remote directories as if they were local.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-20 10:28 UTC (permalink / raw)
On 2012-02-20 06.53, paramucho wrote:
> On Sat, 18 Feb 2012 21:58:28 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-18 12:55, paramucho wrote:
>>> On Fri, 17 Feb 2012 18:13:44 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
> EMT 374, subcode 3 is .PURGE. Channels 8. down to 0 are purged. .PURGE
> checks the conditions I listed.
I didn't check now (sitting at the wrong machine), but does PURGE not go
through the USR lock?
>>> 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.
>
> At some point in the OPEN process you'd have to "register" an open
> with the fully qualified, normalized file name/id and the access mode.
Yes. And then what? Need tp back out in case the open should be denied?
RT-11 is rather fast and loose, which I realized from Jaromes comments.
You can actually open files without involving USR at all, since opening
a file is really just a lookup of the file and noticing which block it
starts at.
>> 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?
>
> The point is that in RSX an executive directive is effectively a "fork
> routine", and these directives can take quite a considerable time to
> complete. Creating a new task is not a simple, short process. The
> worst-case fork latency in RSX is the time it takes to execute the
> longest executive directive.
Right in that all system calls are forks. Crating a new task in RSX is
not really done as a system call. It's done by a task. The only system
call is to invoke an existing task.
Once again, RSX do not sit in system calls for extended times. Things
that take long times are done in processes, not the system. And can thus
also be done in parallel by several users.
F11ACP is the task that do file operations. It is threaded itself, but
additionally you can also have several copies of the task running.
INS is the task that installs other tasks, and thus makes them runnable
by users.
TKTN is the task that handles task termination, and cleans up after a
task have finished.
There are others...
> It is utterly clear that VMS could not handled system calls in system
> state--thousands of instructions are sometimes required.
It is also clear that response times is VMS are much worse than RSX.
Easily demonstrated by having an RSX and a VMS system on the same
ethernet allowing DECservers to be booted. They will be booted by the
first system that responds, which is the RSX system every time, even
when you have much faster VAX hardware.
And VMS actually have the same horrible possibilities that Unix do. You
can have system calls that block, and return with errors saying you
should retry the system call again (I just remembered having a
discussion about VMS mailboxes, which ended up with this conclusion a
few months ago).
>>> 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.
>
> I must be getting old...I'm starting to forget RT-11...
I occasionally get the same feeling about RSX when talking with you. I
really need to go and check stuff that I normally don't even think
about. :-)
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-20 5:54 ` paramucho
@ 2012-02-20 17:14 ` Jerome H. Fine
2012-02-20 18:05 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-20 17:14 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 3083 bytes --]
>paramucho wrote:
>>On Sun, 19 Feb 2012 21:29:56 -0500, "Jerome H. Fine" wrote:
>
>>I have been following Johnny's and Ian's discussion, but since I know
>>so little about the internals of RSX-11 and VMS, I have not commented.
>>
>>This comment is only to note that I suggest a more careful look at
>>the code used for C$SISP.
>>
>>>Johnny Billquist wrote:
>>>
>>>
>>>>>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?
>>>
>>>
>>If the code is inspected carefully, it can be seen that the
>>C$SISP sets a flag in R4 differently from the flag set in
>>R4 byC$SIGN. In addition, the files on channels 0 to 8
>>are NOT purged prior to the common code starting at
>>label 11$:
>>
>>At least that is my understanding of the above example.
>>
>>
>
>.CSIGEN (C$SIGN:) purges. .CSISPC (C$SISP:) does not.
>
Obviously, we both agree on that conclusion.
I was attempting to suggest that my understanding of
what Johnny wrote was that a .Purge was done for
both CSI routines since Johnny wrote:
"Must be looking at different versions of something,"
in reference to your statement (just a line above):
"Note, .CSISPC (C$SISP:) does not purge or open files."
If Johnny could please clarify, that would be helpful.
I am only suggesting that I don't understand Johnny's
response, but that I tend to conclude that Johnny's
words mean that he thinks that both CSI routines
do perform a .Purge loop. Ian and I have concluded
that only .CSISPC (C$SISP:) performs the .Purge loop.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 3726 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-20 18:05 UTC (permalink / raw)
On 2012-02-20 18.14, Jerome H. Fine wrote:
> >paramucho wrote:
>> >On Sun, 19 Feb 2012 21:29:56 -0500, "Jerome H. Fine" wrote:
>>> I have been following Johnny's and Ian's discussion, but since I know
>>> so little about the internals of RSX-11 and VMS, I have not commented.
>>>
>>> This comment is only to note that I suggest a more careful look at
>>> the code used for C$SISP.
>>>> Johnny Billquist wrote:
>>>>
>>>>>> 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?
>>>>
>>> If the code is inspected carefully, it can be seen that the
>>> C$SISP sets a flag in R4 differently from the flag set in
>>> R4 byC$SIGN. In addition, the files on channels 0 to 8
>>> are NOT purged prior to the common code starting at
>>> label 11$:
>>>
>>> At least that is my understanding of the above example.
>>>
>>
>> .CSIGEN (C$SIGN:) purges. .CSISPC (C$SISP:) does not.
> Obviously, we both agree on that conclusion.
>
> I was attempting to suggest that my understanding of
> what Johnny wrote was that a .Purge was done for
> both CSI routines since Johnny wrote:
>
> "Must be looking at different versions of something,"
>
> in reference to your statement (just a line above):
>
> "Note, .CSISPC (C$SISP:) does not purge or open files."
>
> If Johnny could please clarify, that would be helpful.
> I am only suggesting that I don't understand Johnny's
> response, but that I tend to conclude that Johnny's
> words mean that he thinks that both CSI routines
> do perform a .Purge loop. Ian and I have concluded
> that only .CSISPC (C$SISP:) performs the .Purge loop.
I have never made any distinction between various parts of the CSI, just
noting that CSI calls USR.
Which is done both through an EMT 374 right at the start of C$SIGN, and
later you have a "JMP EMTUSR" (which would appear to happen for both).
And so, it would appear to me, that a call to CSI would block other USR
calls, for the most part of the CSI processing.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-20 6:07 ` paramucho
@ 2012-02-21 3:29 ` Jerome H. Fine
2012-02-21 8:06 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-21 3:29 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 7028 bytes --]
>paramucho wrote:
>>On Sun, 19 Feb 2012 21:22:03 -0500, "Jerome H. Fine wrote:
>
>>>Johnny Billquist wrote:
>>>
>>>
>>>$OPEN, $CLOSE, and so on, are in RMS. RMS in turn do $QIO calls to
>>>perform the neccesary operations on the device. $QIO is the system
>>>call. $OPEN is an RMS function. RMS can, and will, definitely call the
>>>system to perform operations. But you can also circumvent RMS if you
>>>want to, by calling the device directly on your own.
>>>
>>>
>>Under RT-11, many of the distributed SAV programs
>>circumvent the USR and perform disk I/O directly,
>>especially when READ ONLY access to the disk
>>is sufficient.
>>
>>DIR, PIP and BINCOM are examples. They read
>>the directories to obtain access to the files on the
>>disk, in particular when a "wild card" specification
>>is used for the files name. I would imagine that this
>>would allow a system job access to the directory
>>on the disk even if a lower priority job was using the
>>USR. I have never tested to determine if this is true,
>>but it is very likely.
>>
>>Sometimes, both direct access and the USR are required,
>>in particular when some files are read and others are
>>written. If examples of this type of activity are of interest,
>>please ask.
>>
>RT-11 does not provide a directory scan system call, so utilities must
>access the directory directly to scan them. RT-11 guarantees that a
>directory structure begins at block 6 of a file structured device.
>
>
Actually, while DEC ALWAYS starts the directory structure
at block 6 of a file structured device, that is not required since
in block 1, there is a value which holds the starting block number.
I stress that DEC has never used a different value and that ALL
present code ignores the starting block number specified within
block 1, but it is a possibility.
In addition, since the DEC development team was effectively
terminated (disbanded I think around 1992), there no longer
seems to be any probability that there will be any new major
changes within RT-11. The lack of interest by commercial
users is probably even more of a reason that RT-11 will
not be enhanced in any major way - even though it would
be entirely possible to continue running important applications
under the SimH and E11 emulators, in particular under E11
at speeds in excess of 100 times a PDP-11/93.
>Early versions of RT-11 supported a mechanism by which the USR would
>"callback" a program at critical points with a pointer to the
>directory entry being processed. Most if not all this utility code has
>been replaced by later system calls which read and write individual
>directory entries without a callback. However, except for disk
>initialization etc, no RT-11 utility directly modifies a directory
>with a .READ/.WRITE sequence.
>
>
That "undocumented" "callback" mechanism is still present
in RT-11, just not used any more by the latest versions of
DEC SAV files within RT-11. That code has been
replaced by code which uses the additional file EMT
requests.
So it actually is still possible and still "undocumented".
I suspect that versions of PIP which used the "callback"
mechanism will still function correctly if the RT-11 version
number check is circumvented.
There are other still "undocumented" features in RT-11 such
as READ ONLY / WRITE PROTECTED files. PIP does
not support this feature, but if a user cleverly uses SIPP to
manually set the bit in the status of a file label for a file
structured device, then that will be reflected in the CSWs
when a file .LookUp is performed and RT-11 will prohibit
a program from executing a .Write request to the file. It
would be fun to add the code to DIR and PIP to support
this feature, especially since the Resident Monitor and the
USR already support the concept.
>RT-11 magtape and cassette drivers are "special devices" with their
>own built-in ACPs. Directory operations on these devices may be
>handled via the USR or by using .SPFUN (special functions) to
>communicate directly with the driver. In this case the operation is
>analogous to the RSX QIO interface. Since tape devices can be
>particularly time consuming it is sometimes advantageous to handle
>their directory operations without blocking the USR.
>
>
I can't remember if the USR is unblocked when a "special
device" requests the USR to hand off what is normally a
request handled by the USR. I seem to remember that the
USR is invoked initially when a file is opened on a magtape,
but I can't remember what happens when the device driver
takes over to handle the open request. Do you know if
the USR in RT-11 is unblocked at that point? Often,
the program may not even know that the device for the
file open request is a "special device" and simply call the
USR with the usual EMT request for the type of open
(.LookUp, .Enter) which is required.
>The "special device" interface and RT-11 directory structure can be
>used to simulate other kinds of devices. I use these two features to
>implement a transparent remote file system which permits PDP-11 users
>access remote directories as if they were local.
>
Do you have any details that you are willing to share?
I know that DO(X).SYS which John Wilson wrote
to execute under E11 may do something similar with
DOS directories, but I have never used DO(X).SYS
and I have not looked at the code.
Under RT-11, I have looked at the technical aspects
of an LN(X).SYS device handler (Logical Name Device
List Pseudo Device Driver) which supports the same
functions as the PATH on DOS or the LNL on VMS.
Note that in the latter case, many levels of directories
can be used under VMS while for RT-11, only a single
device name can be used for each entry. Thus when an
RT-11 user wishes to have a .LookUp performed (and
ONLY a .LookUp EMT request is supported) on the
file LN2:FOOBAR.TYP, the .LookUp EMT request
code in the USR knows to search the Logical Name
Device List in the specified order. For example, use:
LN2: => LD2:, LD1:, DU3:
until the specified file with that device name is found.
When I wrote the code for the first preliminary version,
I used the RT-11 ASSIGN command to:
ASSIGN LD2: L2A:
ASSIGN LD1: L2B:
ASSIGN DU3: L2C:
and then searched the four names: L2A, L2B, L2C and L2D
to locate the file name. After I realized that this would use
up too many entries in the ASSIGNed table, I enhanced the
code of the LN(X).SYS device driver to hold a "Logical Name
Device List" within the device driver file in the same manner
as LD(X).SYS so that the ASSIGNed table would not be
required.
Is the code that you use to access remote directories supported
by both RT-11 and RUST or just RUST? Have you modified
an existing device driver or written a new one? The name
RM(X).SYS would be a suitable name for the device driver,
but I expect that you did not use those two characters.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 8478 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-20 10:28 ` Johnny Billquist
@ 2012-02-21 3:33 ` Jerome H. Fine
2012-02-21 6:17 ` paramucho
1 sibling, 0 replies; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-21 3:33 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 3291 bytes --]
>Johnny Billquist wrote:
> >On 2012-02-20 06.53, paramucho wrote:
>
>> >On Sat, 18 Feb 2012 21:58:28 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>>> >On 2012-02-18 12:55, paramucho wrote:
>>>
>>>> On Fri, 17 Feb 2012 18:13:44 +0100, Johnny
>>>> Billquist<bqt@softjar.se> wrote:
>>>
>> EMT 374, subcode 3 is .PURGE. Channels 8. down to 0 are purged. .PURGE
>> checks the conditions I listed.
>
> I didn't check now (sitting at the wrong machine), but does PURGE not
> go through the USR lock?
The .Purge EMT requires only instructions and memory
(no disk I/O is ever required) when no "special directory"
aspects are associated with the device driver. For file
structured disks, the only essential requirement is that the
first word of the 5 word CSWs is set to zero. Otherwise,
the USR is entered and it would be probably be
necessary to initially lock the USR.
>>>> 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.
>>
>> At some point in the OPEN process you'd have to "register" an open
>> with the fully qualified, normalized file name/id and the access mode.
>
> Yes. And then what? Need tp back out in case the open should be denied?
>
> RT-11 is rather fast and loose, which I realized from Jerome's
> comments. You can actually open files without involving USR at all,
> since opening a file is really just a lookup of the file and noticing
> which block it starts at.
RT-11 has absolutely no concept of sharing files. It is
quite possible to open the same file more than once
in the same program on different channels. Naturally,
no reasonable program would do so, but there is nothing
in RT-11 to stop this from taking place.
Obviously, if more than one program opens the same file,
both can also be performing disk I/O on the file. RT-11
controls disk I/O via five CSWs per file. If the program
knows the starting block number of a file on the disk, there
is nothing stopping the program from requesting access to
the total disk drive and performing disk I/O on absolute
blocks on the disk.
>> I must be getting old...I'm starting to forget RT-11...
>
> I occasionally get the same feeling about RSX when talking with you. I
> really need to go and check stuff that I normally don't even think
> about. :-)
I have to use RT-11 constantly to be able to remember.
At 73 years old, the senior moments seem to arrive
more frequently. So don't take what I say as guaranteed.
Usually, I check the code first, but sometimes I forget to
check the code to make sure.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 4521 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-20 18:05 ` Johnny Billquist
@ 2012-02-21 6:16 ` paramucho
2012-02-21 17:38 ` Jerome H. Fine
1 sibling, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-21 6:16 UTC (permalink / raw)
On Mon, 20 Feb 2012 19:05:20 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>I have never made any distinction between various parts of the CSI, just
>noting that CSI calls USR.
>
>Which is done both through an EMT 374 right at the start of C$SIGN, and
>later you have a "JMP EMTUSR" (which would appear to happen for both).
See my other post.
>And so, it would appear to me, that a call to CSI would block other USR
>calls, for the most part of the CSI processing.
CSI calls can acquire their command lines from the terminal.
The RMON/RMONFB CSI handles (optional) terminal input outside the USR
so that the USR is not blocked waiting for command input. That's the
"blocking" I've been talking about.
There are no other "wait" conditions in the USR CSI code: it just
translates the CSI command, returns info to the caller and optionally
opens some files.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-21 6:17 UTC (permalink / raw)
On Mon, 20 Feb 2012 11:28:14 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-20 06.53, paramucho wrote:
>> On Sat, 18 Feb 2012 21:58:28 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>>> On 2012-02-18 12:55, paramucho wrote:
>>>> On Fri, 17 Feb 2012 18:13:44 +0100, Johnny Billquist<bqt@softjar.se>
>>>> wrote:
>>>>
>> EMT 374, subcode 3 is .PURGE. Channels 8. down to 0 are purged. .PURGE
>> checks the conditions I listed.
>
>I didn't check now (sitting at the wrong machine), but does PURGE not go
>through the USR lock?
If you look at the P$URGE code you'll see it tries to avoid the USR.
It only goes to the USR in the case where a "special device" (magtape,
cassette etc) has a new file open. The idea is that the device driver
be able to properly terminate the tape.
P$URGE: JSR R0,CHKSPL ;If special device, go do it
.WORD PURG.. ;(only returns if not special)
PURGE: CLR (R3)+ ;Dissociate channel
...
<snip>
>> At some point in the OPEN process you'd have to "register" an open
>> with the fully qualified, normalized file name/id and the access mode.
>
>Yes. And then what? Need tp back out in case the open should be denied?
The second open would be queued until the first was completed. The
second open would then proceed and would then exit with an error
condition if the access was denied. This approach would be equivalent
to a sequential algorithm.
>RT-11 is rather fast and loose, which I realized from Jaromes comments.
>You can actually open files without involving USR at all, since opening
>a file is really just a lookup of the file and noticing which block it
>starts at.
It's that simplicity that makes RT-11 so flexible.
o RT-11 allows you to first open all your files and save the channel
contents in memory (with .SAVESTATUS). You then reopen channels
with .REOPEN using the saved channel status.
o Under the RSTS emulator the CSI code is modified to parse RSTS
PPN's. You need to go through the USR for that.
o RT-11 supports "logical disks" where disk files are used as virtual
device volumes. The block number needs to have a base value added
to it.
o The sub-directory implementation in RUST/SJ requires only a change
from a "MOV block-number" to an "ADD block-number" in the USR
lookup code.
o RUST remote network directories use the block field for a file
ID rather than a block number.
BTW: I recall talking about the history of the RT-11 disk structure
with one of the early RT-11 team leaders (AntonC or LesP) who told me
that they had almost gone with a subset of ODS1 for RT-11. It was a
saving of 30 words of memory which made them choose the current disk
structure. I've never been able to work out how they would achieved an
RSX subset with only 30 extra words.
>> The point is that in RSX an executive directive is effectively a "fork
>> routine", and these directives can take quite a considerable time to
>> complete. Creating a new task is not a simple, short process. The
>> worst-case fork latency in RSX is the time it takes to execute the
>> longest executive directive.
>
>Right in that all system calls are forks. Crating a new task in RSX is
>not really done as a system call. It's done by a task. The only system
>call is to invoke an existing task.
>Once again, RSX do not sit in system calls for extended times. Things
>that take long times are done in processes, not the system. And can thus
>also be done in parallel by several users.
But if RSX didn't go into system state you wouldn't need these helper
processes. At present they're not an option.
>> It is utterly clear that VMS could not handled system calls in system
>> state--thousands of instructions are sometimes required.
>
>It is also clear that response times is VMS are much worse than RSX.
>Easily demonstrated by having an RSX and a VMS system on the same
>ethernet allowing DECservers to be booted. They will be booted by the
>first system that responds, which is the RSX system every time, even
>when you have much faster VAX hardware.
That's a boot test, not a latency test.
>And VMS actually have the same horrible possibilities that Unix do. You
>can have system calls that block, and return with errors saying you
>should retry the system call again (I just remembered having a
>discussion about VMS mailboxes, which ended up with this conclusion a
>few months ago).
You're looking at that behavior through RSX eyes. VMS system calls
begin as an extension of user code in user state. Nothing is blocked.
It's a different system philosphy, and clearly a decision they made in
terms of changing their approach from that of RSX.
>> I must be getting old...I'm starting to forget RT-11...
>
>I occasionally get the same feeling about RSX when talking with you. I
>really need to go and check stuff that I normally don't even think
>about. :-)
Did you get the two e-mails I sent, or are they landing in a
bit-bucket?
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 3:29 ` Jerome H. Fine
@ 2012-02-21 8:06 ` paramucho
2012-02-21 10:38 ` Johnny Billquist
2012-02-22 2:51 ` Jerome H. Fine
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-21 8:06 UTC (permalink / raw)
On Mon, 20 Feb 2012 22:29:03 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
>>RT-11 does not provide a directory scan system call, so utilities must
>>access the directory directly to scan them. RT-11 guarantees that a
>>directory structure begins at block 6 of a file structured device.
>>
>Actually, while DEC ALWAYS starts the directory structure
>at block 6 of a file structured device, that is not required since
>in block 1, there is a value which holds the starting block number.
>
>I stress that DEC has never used a different value and that ALL
>present code ignores the starting block number specified within
>block 1, but it is a possibility.
Right. I'm aware of that home block value. It was never used by any
version of RT-11 that I know of. I've sometimes thought it might have
been used by RTEM. I thought of using it myself when I implemented
RUST/SJ sub-directories, but it wasn't worth it.
<snip?
>>Early versions of RT-11 supported a mechanism by which the USR would
>>"callback" a program at critical points with a pointer to the
>>directory entry being processed. Most if not all this utility code has
>>been replaced by later system calls which read and write individual
>>directory entries without a callback. However, except for disk
>>initialization etc, no RT-11 utility directly modifies a directory
>>with a .READ/.WRITE sequence.
>>
>>
>That "undocumented" "callback" mechanism is still present
>in RT-11, just not used any more by the latest versions of
>DEC SAV files within RT-11. That code has been
>replaced by code which uses the additional file EMT
>requests.
>
>So it actually is still possible and still "undocumented".
>
>I suspect that versions of PIP which used the "callback"
>mechanism will still function correctly if the RT-11 version
>number check is circumvented.
>
>There are other still "undocumented" features in RT-11 such
>as READ ONLY / WRITE PROTECTED files.
They are directory entry flags which were defined in the final stages
of RT-11. They were barely used. The Read-only flag is copied by
.LOOKUP, but that's about it. I haven't bothered implementing it
because the new flags are not backwards compatible with earlier
versions of RT-11 (which is, historically, partly my fault).
> PIP does
>not support this feature, but if a user cleverly uses SIPP to
>manually set the bit in the status of a file label for a file
>structured device, then that will be reflected in the CSWs
>when a file .LookUp is performed and RT-11 will prohibit
>a program from executing a .Write request to the file. It
>would be fun to add the code to DIR and PIP to support
>this feature, especially since the Resident Monitor and the
>USR already support the concept.
>
>>RT-11 magtape and cassette drivers are "special devices" with their
>>own built-in ACPs. Directory operations on these devices may be
>>handled via the USR or by using .SPFUN (special functions) to
>>communicate directly with the driver. In this case the operation is
>>analogous to the RSX QIO interface. Since tape devices can be
>>particularly time consuming it is sometimes advantageous to handle
>>their directory operations without blocking the USR.
>>
>>
>I can't remember if the USR is unblocked when a "special
>device" requests the USR to hand off what is normally a
>request handled by the USR. I seem to remember that the
>USR is invoked initially when a file is opened on a magtape,
>but I can't remember what happens when the device driver
>takes over to handle the open request. Do you know if
>the USR in RT-11 is unblocked at that point? Often,
>the program may not even know that the device for the
>file open request is a "special device" and simply call the
>USR with the usual EMT request for the type of open
>(.LookUp, .Enter) which is required.
The USR waits for any .LOOKUP/.ENTER to complete.
However, you don't need to use the USR to open files on special
directory devices. Instead, you use .SPFUN with the appropriate
function codes (indeed, that's exactly how the USR handles these
devices).
>>The "special device" interface and RT-11 directory structure can be
>>used to simulate other kinds of devices. I use these two features to
>>implement a transparent remote file system which permits PDP-11 users
>>access remote directories as if they were local.
>>
>Do you have any details that you are willing to share?
>I know that DO(X).SYS which John Wilson wrote
>to execute under E11 may do something similar with
>DOS directories, but I have never used DO(X).SYS
>and I have not looked at the code.
I first supported transparent remote directories in the late
seventies. There are two crucial features in the RUST implementations:
1. Logical names. If you define the following logical name xxx:
. define xxx nf
Then when you access XXX: the NF driver will look for the logical name
at the server. (To handle this on Windows I had to implement a Windows
Logical Name system for my environment). On RUST/SJ the default
translation for a logical name is usually NF:.
2. It's not just a matter of opening and closing files and reading and
writing blocks. The RUST implementation completely translates the
RT-11 file system semantics to the appropriate server operations. For
example, an newly created RT-11 file doesn't appear in a directory
until it's closed--that's not the case with Windows, so the NF server
creates a ".TEN" file initially. There many, many such behaviors to
handle.
>Under RT-11, I have looked at the technical aspects
>of an LN(X).SYS device handler (Logical Name Device
>List Pseudo Device Driver) which supports the same
>functions as the PATH on DOS or the LNL on VMS.
>Note that in the latter case, many levels of directories
>can be used under VMS while for RT-11, only a single
>device name can be used for each entry. Thus when an
>RT-11 user wishes to have a .LookUp performed (and
>ONLY a .LookUp EMT request is supported) on the
>file LN2:FOOBAR.TYP, the .LookUp EMT request
>code in the USR knows to search the Logical Name
>Device List in the specified order. For example, use:
>
>LN2: => LD2:, LD1:, DU3:
>
>until the specified file with that device name is found.
>When I wrote the code for the first preliminary version,
>I used the RT-11 ASSIGN command to:
>
>ASSIGN LD2: L2A:
>ASSIGN LD1: L2B:
>ASSIGN DU3: L2C:
>
>and then searched the four names: L2A, L2B, L2C and L2D
>to locate the file name. After I realized that this would use
>up too many entries in the ASSIGNed table, I enhanced the
>code of the LN(X).SYS device driver to hold a "Logical Name
>Device List" within the device driver file in the same manner
>as LD(X).SYS so that the ASSIGNed table would not be
>required.
RUST systems support DEFINE/PATH to handle this situation:
. define/path sy vm,sy,tmp
instructs the system to search VM:, SY: and TMP:, in that order for
lookups to SY:.
>Is the code that you use to access remote directories supported
>by both RT-11 and RUST or just RUST? Have you modified
>an existing device driver or written a new one? The name
>RM(X).SYS would be a suitable name for the device driver,
>but I expect that you did not use those two characters.
They are all new drivers. I don' use any DEC source code. When I first
wrote them, many years ago, they also functioned under RT-11, but I
haven't really tested them there for many years and I guess there are
some new features which might break. I've just got some real PDP-11s
working for the first time in a couple of years and I know I have to
some testing in that general area, so I'll try it out.
The RUST/SJ NFV.SYS is on the RUST/SJ kit. At present it probably only
work properly with the Windows server NF.EXE, also in the RUST kit.
WinPCap is also required. The documentation is at
http://rust.wikispaces.com/.
>Jerome Fine
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 6:17 ` paramucho
@ 2012-02-21 10:23 ` Johnny Billquist
2012-02-21 11:37 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-21 10:23 UTC (permalink / raw)
On 2012-02-21 07.17, paramucho wrote:
> On Mon, 20 Feb 2012 11:28:14 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-20 06.53, paramucho wrote:
>>> On Sat, 18 Feb 2012 21:58:28 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>>> On 2012-02-18 12:55, paramucho wrote:
>>>>> On Fri, 17 Feb 2012 18:13:44 +0100, Johnny Billquist<bqt@softjar.se>
>>>>> wrote:
>>>>>
>>> The point is that in RSX an executive directive is effectively a "fork
>>> routine", and these directives can take quite a considerable time to
>>> complete. Creating a new task is not a simple, short process. The
>>> worst-case fork latency in RSX is the time it takes to execute the
>>> longest executive directive.
>>
>> Right in that all system calls are forks. Crating a new task in RSX is
>> not really done as a system call. It's done by a task. The only system
>> call is to invoke an existing task.
>> Once again, RSX do not sit in system calls for extended times. Things
>> that take long times are done in processes, not the system. And can thus
>> also be done in parallel by several users.
>
> But if RSX didn't go into system state you wouldn't need these helper
> processes. At present they're not an option.
But then you would have to be able to block in the system call, at which
point you also need to be able to back out and restart system calls, or
else fail system calls with the error saying that you need to redo the
system call (EINTR). One is extremely complex, while the other is very
ugly. Unix and VMS have gone with the latter.
I thought we'd already agreed that Unix was not something to follow. :-)
Or we could accept that processes become deaf at certain times, making
response times utterly unpredictable.
>>> It is utterly clear that VMS could not handled system calls in system
>>> state--thousands of instructions are sometimes required.
>>
>> It is also clear that response times is VMS are much worse than RSX.
>> Easily demonstrated by having an RSX and a VMS system on the same
>> ethernet allowing DECservers to be booted. They will be booted by the
>> first system that responds, which is the RSX system every time, even
>> when you have much faster VAX hardware.
>
> That's a boot test, not a latency test.
No. I'm not talking about how long it takes for the DECserver to boot.
I'm talking about how fast you respond to the boot request.
The DECserver broadcasts a boot request on the ethernet. Other machines
listen for that, and respond to requests saying that they are willing to
provide the boot service. The first such response that comes back to the
DECserver is used by the DECserver for the following boot. The RSX
systems on the network responds much faster to the boot *requests* than
the VMS systems.
>> And VMS actually have the same horrible possibilities that Unix do. You
>> can have system calls that block, and return with errors saying you
>> should retry the system call again (I just remembered having a
>> discussion about VMS mailboxes, which ended up with this conclusion a
>> few months ago).
>
> You're looking at that behavior through RSX eyes. VMS system calls
> begin as an extension of user code in user state. Nothing is blocked.
Right. And system calls in VMS can later on be blocked, and even fail
with a return code saying you should just retry the system call again
because it failed the last time for some random reason that will not be
the same on the next try.
> It's a different system philosphy, and clearly a decision they made in
> terms of changing their approach from that of RSX.
Indeed. Lots of the extensions that VMS added to the RSX base are more
wart-like. The clean bottom line is still there, but some of the
additions have a different philosophy.
>>> I must be getting old...I'm starting to forget RT-11...
>>
>> I occasionally get the same feeling about RSX when talking with you. I
>> really need to go and check stuff that I normally don't even think
>> about. :-)
>
> Did you get the two e-mails I sent, or are they landing in a
> bit-bucket?
Sorry, yes. I got them. Have not had time to do much. Last week was
ridiculous at work...
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 8:06 ` paramucho
@ 2012-02-21 10:38 ` Johnny Billquist
2012-02-21 11:54 ` paramucho
2012-02-22 2:51 ` Jerome H. Fine
1 sibling, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-21 10:38 UTC (permalink / raw)
On 2012-02-21 09.06, paramucho wrote:
> On Mon, 20 Feb 2012 22:29:03 -0500, "Jerome H. Fine"
> <everyone@nospam.com> wrote:
>
>>> RT-11 does not provide a directory scan system call, so utilities must
>>> access the directory directly to scan them. RT-11 guarantees that a
>>> directory structure begins at block 6 of a file structured device.
>>>
>> Actually, while DEC ALWAYS starts the directory structure
>> at block 6 of a file structured device, that is not required since
>> in block 1, there is a value which holds the starting block number.
>>
>> I stress that DEC has never used a different value and that ALL
>> present code ignores the starting block number specified within
>> block 1, but it is a possibility.
>
> Right. I'm aware of that home block value. It was never used by any
> version of RT-11 that I know of. I've sometimes thought it might have
> been used by RTEM. I thought of using it myself when I implemented
> RUST/SJ sub-directories, but it wasn't worth it.
Funny that you mention RTEM, since I seem to have come across a copy
that I now have running on my RSX systems. It is weird, and I have not
looked at all details. Also, a friend of mine have been doing most of
the fooling around. He did get it to boot RT-11 V5.7 after a few patches
to RT-11. Seems like RTEM got broken after V5.5 in the RT-11 side.
I don't know exactly how it works, but it uses a disk split into two
parts. One is shared by all users, and holds all the normal binaries and
stuff you'd expect, while the other part is your private disk, which
holds all the rest of the stuff you do. But they are merged into one
disk in the view of RT-11.
Also, it seems like the file protection is used, and all files on the
shared part of the disk are protected, which seems like a wise thing. :-)
*****
.run rtem
RTE>/vs
RTEM-11 (VAX/VMS) V01.00
RT-11FB V05.07
.SET SL ON
.show all
RT-11FB V05.07
Booted from VS0:RTEMFB
USR is set SWAP
EXIT is set SWAP
KMON is set NOIND
MODE is set NOSJ
TT is set NOQUIET
ERROR is set ERROR
SL is set ON
EDIT is set KED
FORTRAN is set FORTRA
KMON nesting depth is 3
Global .SCCA flag is disabled
CLI is set DCL, CCL, UCL, NO UCF
Emulated RT-11 environment, processor type unknown
60KB of memory
FP11 Hardware Floating Point Unit
Extended Instruction Set (EIS)
50 Hertz System Clock
Multi-terminal support
Global .SCCA support
FPU support
Extended unit support
Device Status CSR Vector(s)
------ ------ --- ---------
LD Installed 000000 000
BA Installed 000000 000
NL Installed 000000 000
SL 122622 000000 000
SD Installed 000000 000
VS Resident 000000 000
TT (Resident)
VS (Resident)
VS0 = DK , SY
MQ (Resident)
BA
NL
LD
SL (Loaded)
SD
1 free slots
Job Name Console Level State Low High Impure
--- ---- ------- ----- ----- --- ---- ------
0 RESORC 0 0 Run 000000 122546 137600
Unit Owner Type WIDTH TAB CRLF FORM SCOPE SPEED
--------------------------------------------------------
0 S-Console DL 80 Yes No No Yes N/A
Address Module Words
------- ------ -----
165324 VS 854.
136020 RMON 5986.
122614 SL 2882.
001000 ..BG.. 20934.
No LD units mounted
.dir
21-Feb-2012
SWAP .SYS 28P 31-Oct-1998 RTEMFB.SYS 108P 02-Feb-2012
LDM .SYS 11P 01-Feb-2012 BAM .SYS 7P 01-Feb-2012
NLM .SYS 2P 01-Feb-2012 SLM .SYS 17P 30-Jan-2012
SDM .SYS 23P 30-Jan-2012 VSM .SYS 6P 01-Feb-2012
DIR .SAV 20P 31-Oct-1998 PIP .SAV 30P 31-Oct-1998
DUP .SAV 52P 31-Oct-1998 RESORC.SAV 35P 31-Oct-1998
IND .SAV 58P 31-Oct-1998 UCL .SAV 16P 31-Oct-1998
UCF .SAV 16P 31-Oct-1998 UCL .DAT 9P 29-Jan-1984
JOAT .SAV 52P 29-Jan-2012 EDIT .SAV 19P 31-Oct-1998
K52 .SAV 81P 07-Apr-2011 KED .SAV 85P 31-Oct-1998
MACRO .SAV 63P 31-Oct-1998 CREF .SAV 6P 31-Oct-1998
LINK .SAV 59P 31-Oct-1998 LIBR .SAV 24P 31-Oct-1998
FILEX .SAV 22P 31-Oct-1998 SRCCOM.SAV 26P 31-Oct-1998
BINCOM.SAV 25P 31-Oct-1998 SLP .SAV 13P 31-Oct-1998
DUMP .SAV 10P 31-Oct-1998 SIPP .SAV 21P 31-Oct-1998
BUP .SAV 68P 31-Oct-1998 PAT .SAV 11P 31-Oct-1998
HELP .SAV 161P 31-Oct-1998 BATCH .SAV 26P 31-Oct-1998
SETUP .SAV 43P 31-Oct-1998 LET .SAV 6P 31-Oct-1998
SPLIT .SAV 3P 31-Oct-1998 TRANSF.SAV 16P 31-Oct-1998
TRANSF.TSK 76P 31-Oct-1998 TRANSF.EXE 45P 31-Oct-1998
DBGSYM.SAV 10P 31-Oct-1998 INDEX .SAV 11P 31-Oct-1998
INDEXX.SAV 14P 31-Oct-1998 INDEXA.IMG 164P 31-Oct-1998
INDEXB.IMG 165P 31-Oct-1998 INDEX .IDX 7P 31-Oct-1998
PASCAL.SAV 52P 29-Jan-1984 FORTRA.SAV 128P 29-Jan-1984
F77 .SAV 327P 29-Jan-1984 BASIC .SAV 56P 29-Jan-1984
TECO .SAV 50P 31-Oct-1998 SYS .SAV 3P 29-Jan-1984
SYSMAC.SML 66P 19-Dec-1988 SYSLIB.OBJ 47P 19-Dec-1988
PASCAL.OBJ 89P 19-Aug-1986 FORLIB.OBJ 205P 31-Dec-1982
F77OTS.OBJ 135P 29-Jan-1984 F77CVF.OBJ 4P 29-Jan-1984
F77NER.OBJ 1P 29-Jan-1984 F77MAP.OBJ 33P 29-Jan-1984
F77EIS.OBJ 3P 29-Jan-1984 F77RAN.OBJ 2P 29-Jan-1984
F77COM.MSG 14P 29-Jan-1984 ODT .OBJ 8P 31-Oct-1998
VDT .OBJ 8P 31-Oct-1998 STARTM.COM 1P 29-Jan-1984
66 Files, 3002 Blocks
486 Free blocks
.
*****
>> There are other still "undocumented" features in RT-11 such
>> as READ ONLY / WRITE PROTECTED files.
>
> They are directory entry flags which were defined in the final stages
> of RT-11. They were barely used. The Read-only flag is copied by
> .LOOKUP, but that's about it. I haven't bothered implementing it
> because the new flags are not backwards compatible with earlier
> versions of RT-11 (which is, historically, partly my fault).
Am I understanding correct that the "P" after the file size is the
indication of the read-only status of the file? I seem to remember it
appearing to be so from something I did, but I'm not sure.
>>> RT-11 magtape and cassette drivers are "special devices" with their
>>> own built-in ACPs. Directory operations on these devices may be
>>> handled via the USR or by using .SPFUN (special functions) to
>>> communicate directly with the driver. In this case the operation is
>>> analogous to the RSX QIO interface. Since tape devices can be
>>> particularly time consuming it is sometimes advantageous to handle
>>> their directory operations without blocking the USR.
>>>
>>>
>> I can't remember if the USR is unblocked when a "special
>> device" requests the USR to hand off what is normally a
>> request handled by the USR. I seem to remember that the
>> USR is invoked initially when a file is opened on a magtape,
>> but I can't remember what happens when the device driver
>> takes over to handle the open request. Do you know if
>> the USR in RT-11 is unblocked at that point? Often,
>> the program may not even know that the device for the
>> file open request is a "special device" and simply call the
>> USR with the usual EMT request for the type of open
>> (.LookUp, .Enter) which is required.
>
> The USR waits for any .LOOKUP/.ENTER to complete.
So, if I understand correctly, any program that don't understand that an
access to a magtape can be done with .SPFUN, and instead opens it with
USR will block until the magtape file have been opened, which can take a
serious while?
Can a program that is waiting on USR be interrupted by something
AST-like? What happens to the USR call meanwhile?
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 10:23 ` Johnny Billquist
@ 2012-02-21 11:37 ` paramucho
2012-02-21 14:16 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-21 11:37 UTC (permalink / raw)
On Tue, 21 Feb 2012 11:23:02 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip?>
>> But if RSX didn't go into system state you wouldn't need these helper
>> processes. At present they're not an option.
>
>But then you would have to be able to block in the system call, at which
>point you also need to be able to back out and restart system calls, or
>else fail system calls with the error saying that you need to redo the
>system call (EINTR). One is extremely complex, while the other is very
>ugly. Unix and VMS have gone with the latter.
>I thought we'd already agreed that Unix was not something to follow. :-)
>
>Or we could accept that processes become deaf at certain times, making
>response times utterly unpredictable.
How does the process become deaf? It can still accept ASTs. What else
is it supposed to do?
>>>> It is utterly clear that VMS could not handled system calls in system
>>>> state--thousands of instructions are sometimes required.
>>>
>>> It is also clear that response times is VMS are much worse than RSX.
>>> Easily demonstrated by having an RSX and a VMS system on the same
>>> ethernet allowing DECservers to be booted. They will be booted by the
>>> first system that responds, which is the RSX system every time, even
>>> when you have much faster VAX hardware.
>>
>> That's a boot test, not a latency test.
>
>No. I'm not talking about how long it takes for the DECserver to boot.
>I'm talking about how fast you respond to the boot request.
>The DECserver broadcasts a boot request on the ethernet. Other machines
>listen for that, and respond to requests saying that they are willing to
>provide the boot service. The first such response that comes back to the
>DECserver is used by the DECserver for the following boot. The RSX
>systems on the network responds much faster to the boot *requests* than
>the VMS systems.
It's still just one specific test. That doesn't measure overall system
performance or other system specific behaviors.
>>> And VMS actually have the same horrible possibilities that Unix do. You
>>> can have system calls that block, and return with errors saying you
>>> should retry the system call again (I just remembered having a
>>> discussion about VMS mailboxes, which ended up with this conclusion a
>>> few months ago).
>>
>> You're looking at that behavior through RSX eyes. VMS system calls
>> begin as an extension of user code in user state. Nothing is blocked.
>
>Right. And system calls in VMS can later on be blocked, and even fail
>with a return code saying you should just retry the system call again
>because it failed the last time for some random reason that will not be
>the same on the next try.
I guess this is the same as your "deaf process" point above...
>> It's a different system philosphy, and clearly a decision they made in
>> terms of changing their approach from that of RSX.
>
>Indeed. Lots of the extensions that VMS added to the RSX base are more
>wart-like. The clean bottom line is still there, but some of the
>additions have a different philosophy.
Well, I see it more that they decided that the system state wrapper
was a bad idea and they dropped it.
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 10:38 ` Johnny Billquist
@ 2012-02-21 11:54 ` paramucho
2012-02-21 14:20 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-21 11:54 UTC (permalink / raw)
On Tue, 21 Feb 2012 11:38:40 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>> Right. I'm aware of that home block value. It was never used by any
>> version of RT-11 that I know of. I've sometimes thought it might have
>> been used by RTEM. I thought of using it myself when I implemented
>> RUST/SJ sub-directories, but it wasn't worth it.
>
>Funny that you mention RTEM, since I seem to have come across a copy
>that I now have running on my RSX systems. It is weird, and I have not
>looked at all details. Also, a friend of mine have been doing most of
>the fooling around. He did get it to boot RT-11 V5.7 after a few patches
>to RT-11. Seems like RTEM got broken after V5.5 in the RT-11 side.
>
>I don't know exactly how it works, but it uses a disk split into two
>parts. One is shared by all users, and holds all the normal binaries and
>stuff you'd expect, while the other part is your private disk, which
>holds all the rest of the stuff you do. But they are merged into one
>disk in the view of RT-11.
>
>Also, it seems like the file protection is used, and all files on the
>shared part of the disk are protected, which seems like a wise thing. :-)
Yes, that must be what's happening there...
>>> There are other still "undocumented" features in RT-11 such
>>> as READ ONLY / WRITE PROTECTED files.
>>
>> They are directory entry flags which were defined in the final stages
>> of RT-11. They were barely used. The Read-only flag is copied by
>> .LOOKUP, but that's about it. I haven't bothered implementing it
>> because the new flags are not backwards compatible with earlier
>> versions of RT-11 (which is, historically, partly my fault).
>
>Am I understanding correct that the "P" after the file size is the
>indication of the read-only status of the file? I seem to remember it
>appearing to be so from something I did, but I'm not sure.
"P" means the file is protected from deletion.
It would be a logical place to implement read-only files but I'm
pretty sure RTEM was implemented before the read-only flag.
>>>> RT-11 magtape and cassette drivers are "special devices" with their
>>>> own built-in ACPs. Directory operations on these devices may be
>>>> handled via the USR or by using .SPFUN (special functions) to
>>>> communicate directly with the driver. In this case the operation is
>>>> analogous to the RSX QIO interface. Since tape devices can be
>>>> particularly time consuming it is sometimes advantageous to handle
>>>> their directory operations without blocking the USR.
>>>>
>>>>
>>> I can't remember if the USR is unblocked when a "special
>>> device" requests the USR to hand off what is normally a
>>> request handled by the USR. I seem to remember that the
>>> USR is invoked initially when a file is opened on a magtape,
>>> but I can't remember what happens when the device driver
>>> takes over to handle the open request. Do you know if
>>> the USR in RT-11 is unblocked at that point? Often,
>>> the program may not even know that the device for the
>>> file open request is a "special device" and simply call the
>>> USR with the usual EMT request for the type of open
>>> (.LookUp, .Enter) which is required.
>>
>> The USR waits for any .LOOKUP/.ENTER to complete.
>
>So, if I understand correctly, any program that don't understand that an
>access to a magtape can be done with .SPFUN, and instead opens it with
>USR will block until the magtape file have been opened, which can take a
>serious while?
Yes
In operational terms this is less of a problem with a single-user
system, where you can plan your day, than it is with in a multi-user
environment where you don't know what other people are going to do at
any given time.
The first system I did was a host/satellite RT-11 implementation where
each satellite PDP-11 saw all the host devices as local. It was in
that environent that I used .SPFUN to access magtape so that directory
access wasn't blocked. We had up to ten or more satellites active,
some of those with multiple users, and the USR was never a problem. I
used a software cache in that system as well which helped in
particular with directory access.
>Can a program that is waiting on USR be interrupted by something
>AST-like? What happens to the USR call meanwhile?
Yes
AST's can interrupt the USR. The USR is just an extension of the
program's mainline (you can't call it from an AST), so it remains
dormant until the AST exits. ASTs can also interrupt system calls,
unless they've switched to system state.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 11:37 ` paramucho
@ 2012-02-21 14:16 ` Johnny Billquist
2012-02-21 16:42 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-21 14:16 UTC (permalink / raw)
On 2012-02-21 12.37, paramucho wrote:
> On Tue, 21 Feb 2012 11:23:02 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip?>
>
>>> But if RSX didn't go into system state you wouldn't need these helper
>>> processes. At present they're not an option.
>>
>> But then you would have to be able to block in the system call, at which
>> point you also need to be able to back out and restart system calls, or
>> else fail system calls with the error saying that you need to redo the
>> system call (EINTR). One is extremely complex, while the other is very
>> ugly. Unix and VMS have gone with the latter.
>> I thought we'd already agreed that Unix was not something to follow. :-)
>>
>> Or we could accept that processes become deaf at certain times, making
>> response times utterly unpredictable.
>
> How does the process become deaf? It can still accept ASTs. What else
> is it supposed to do?
It wasn't a statement - it was a suggestive question on what to possibly do.
The problem is - if you get an AST while blocking on a system call, what
will you do with that system call. The program can do another system
call in the AST. Can you deal with being blocked in a system call, and
at the same time do another system call? And what do you expect the
stack to look like at that point? And the blocking in the current system
call is somehow reflected in the process status. That needs to be
temporary "forgotten", since the process is not blocked while running in
the AST. But once the AST is finished, I would assume that you expect
the process to go back to being blocked in the outer system call. But
the process state might have changed because of things done in the AST,
including the wish to get out of the system call you were blocked in.
Not to mention what to do if you are blocking on a system call, gets an
AST, and in the AST handler do a system call which blocks you. Then what?
See http://en.wikipedia.org/wiki/PCLSRing for more details.
>>>>> It is utterly clear that VMS could not handled system calls in system
>>>>> state--thousands of instructions are sometimes required.
>>>>
>>>> It is also clear that response times is VMS are much worse than RSX.
>>>> Easily demonstrated by having an RSX and a VMS system on the same
>>>> ethernet allowing DECservers to be booted. They will be booted by the
>>>> first system that responds, which is the RSX system every time, even
>>>> when you have much faster VAX hardware.
>>>
>>> That's a boot test, not a latency test.
>>
>> No. I'm not talking about how long it takes for the DECserver to boot.
>> I'm talking about how fast you respond to the boot request.
>> The DECserver broadcasts a boot request on the ethernet. Other machines
>> listen for that, and respond to requests saying that they are willing to
>> provide the boot service. The first such response that comes back to the
>> DECserver is used by the DECserver for the following boot. The RSX
>> systems on the network responds much faster to the boot *requests* than
>> the VMS systems.
>
> It's still just one specific test. That doesn't measure overall system
> performance or other system specific behaviors.
Sure. I can dig up a number of more examples showing that response times
in VMS are much worse than RSX. How many do you need to be convinced?
>>>> And VMS actually have the same horrible possibilities that Unix do. You
>>>> can have system calls that block, and return with errors saying you
>>>> should retry the system call again (I just remembered having a
>>>> discussion about VMS mailboxes, which ended up with this conclusion a
>>>> few months ago).
>>>
>>> You're looking at that behavior through RSX eyes. VMS system calls
>>> begin as an extension of user code in user state. Nothing is blocked.
>>
>> Right. And system calls in VMS can later on be blocked, and even fail
>> with a return code saying you should just retry the system call again
>> because it failed the last time for some random reason that will not be
>> the same on the next try.
>
> I guess this is the same as your "deaf process" point above...
Yes. The point being that blocking on system calls means you need to
deal with what to do when something unexpected happens while you are
being blocked. Back out, proceed with error, or ignore until it is safe
to deal with.
>>> It's a different system philosphy, and clearly a decision they made in
>>> terms of changing their approach from that of RSX.
>>
>> Indeed. Lots of the extensions that VMS added to the RSX base are more
>> wart-like. The clean bottom line is still there, but some of the
>> additions have a different philosophy.
>
> Well, I see it more that they decided that the system state wrapper
> was a bad idea and they dropped it.
We are all entitled to our opinions. :-)
VMS still have that thing in there, though. It's just that for some new
things, they decided to instead allow hanging system calls, which
instead will return an error telling you to redo the operation.
If you consider that an improvement, then we can continue to disagree.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 11:54 ` paramucho
@ 2012-02-21 14:20 ` Johnny Billquist
2012-02-21 15:13 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-21 14:20 UTC (permalink / raw)
On 2012-02-21 12.54, paramucho wrote:
> On Tue, 21 Feb 2012 11:38:40 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>>> Right. I'm aware of that home block value. It was never used by any
>>> version of RT-11 that I know of. I've sometimes thought it might have
>>> been used by RTEM. I thought of using it myself when I implemented
>>> RUST/SJ sub-directories, but it wasn't worth it.
>>
>> Funny that you mention RTEM, since I seem to have come across a copy
>> that I now have running on my RSX systems. It is weird, and I have not
>> looked at all details. Also, a friend of mine have been doing most of
>> the fooling around. He did get it to boot RT-11 V5.7 after a few patches
>> to RT-11. Seems like RTEM got broken after V5.5 in the RT-11 side.
>>
>> I don't know exactly how it works, but it uses a disk split into two
>> parts. One is shared by all users, and holds all the normal binaries and
>> stuff you'd expect, while the other part is your private disk, which
>> holds all the rest of the stuff you do. But they are merged into one
>> disk in the view of RT-11.
>>
>> Also, it seems like the file protection is used, and all files on the
>> shared part of the disk are protected, which seems like a wise thing. :-)
>
> Yes, that must be what's happening there...
Hmm. I might have merged the write protect with delete protection here,
though. But the shared disk image is read-only from the RSX level, so
even if I tried writing to that part under RT-11, it would fail for RTEM
to actually perform the write. I wonder what happens if I try... Should
test one of these days when I have some time for experimentation.
>>>> There are other still "undocumented" features in RT-11 such
>>>> as READ ONLY / WRITE PROTECTED files.
>>>
>>> They are directory entry flags which were defined in the final stages
>>> of RT-11. They were barely used. The Read-only flag is copied by
>>> .LOOKUP, but that's about it. I haven't bothered implementing it
>>> because the new flags are not backwards compatible with earlier
>>> versions of RT-11 (which is, historically, partly my fault).
>>
>> Am I understanding correct that the "P" after the file size is the
>> indication of the read-only status of the file? I seem to remember it
>> appearing to be so from something I did, but I'm not sure.
>
> "P" means the file is protected from deletion.
Ah. As mentioned above. I probably had delete protection confused with
write protection in my memory. Not sure what will happen on writes to
the shared part of the disk.
> It would be a logical place to implement read-only files but I'm
> pretty sure RTEM was implemented before the read-only flag.
You are most likely right on that.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 14:20 ` Johnny Billquist
@ 2012-02-21 15:13 ` paramucho
2012-02-21 15:20 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-21 15:13 UTC (permalink / raw)
On Tue, 21 Feb 2012 15:20:55 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
..
>
>Hmm. I might have merged the write protect with delete protection here,
>though. But the shared disk image is read-only from the RSX level, so
>even if I tried writing to that part under RT-11, it would fail for RTEM
>to actually perform the write. I wonder what happens if I try... Should
>test one of these days when I have some time for experimentation.
I never quite understood why they went to all the work on that split
disk for RTEM. But then, I've never used RTEM either. I did a very
clean RT-11 AME for VMS (VRT), but I don't think we sold a single copy
(however, we used it a lot internally and it was the basis of the
earliest version of my V11 emulator for Windows).
>>>>> There are other still "undocumented" features in RT-11 such
>>>>> as READ ONLY / WRITE PROTECTED files.
>>>>
>>>> They are directory entry flags which were defined in the final stages
>>>> of RT-11. They were barely used. The Read-only flag is copied by
>>>> .LOOKUP, but that's about it. I haven't bothered implementing it
>>>> because the new flags are not backwards compatible with earlier
>>>> versions of RT-11 (which is, historically, partly my fault).
>>>
>>> Am I understanding correct that the "P" after the file size is the
>>> indication of the read-only status of the file? I seem to remember it
>>> appearing to be so from something I did, but I'm not sure.
>>
>> "P" means the file is protected from deletion.
>
>Ah. As mentioned above. I probably had delete protection confused with
>write protection in my memory. Not sure what will happen on writes to
>the shared part of the disk.
My guess is that RTEM protects the system area. I have read the doc
kit somewhere.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 15:13 ` paramucho
@ 2012-02-21 15:20 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-21 15:20 UTC (permalink / raw)
On 2012-02-21 16.13, paramucho wrote:
> On Tue, 21 Feb 2012 15:20:55 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
> ..
>>
>> Hmm. I might have merged the write protect with delete protection here,
>> though. But the shared disk image is read-only from the RSX level, so
>> even if I tried writing to that part under RT-11, it would fail for RTEM
>> to actually perform the write. I wonder what happens if I try... Should
>> test one of these days when I have some time for experimentation.
>
> I never quite understood why they went to all the work on that split
> disk for RTEM. But then, I've never used RTEM either. I did a very
> clean RT-11 AME for VMS (VRT), but I don't think we sold a single copy
> (however, we used it a lot internally and it was the basis of the
> earliest version of my V11 emulator for Windows).
The split disk looked kind of weird when I first saw it, but it makes a
lot of sense. The actual system, as well as all the CUSPs then exist in
only one copy on a system, even if you have lots of people running RTEM.
All have their own private part of the disk where all their own files
gets placed. Back when disks weren't that big, it would make a big
difference, I suspect.
Nowadays, with terabyte disks, and RT-11 restricted to 32M, you can
easily have as many full RT-11 disks as you care about, but with a
system on one RM03, all you had was 63MB, for everything. (One RM03 is
what the first PDP-11/70 I used had, running RSTS/E with about 40 users
normally logged in concurrently...)
>>>>>> There are other still "undocumented" features in RT-11 such
>>>>>> as READ ONLY / WRITE PROTECTED files.
>>>>>
>>>>> They are directory entry flags which were defined in the final stages
>>>>> of RT-11. They were barely used. The Read-only flag is copied by
>>>>> .LOOKUP, but that's about it. I haven't bothered implementing it
>>>>> because the new flags are not backwards compatible with earlier
>>>>> versions of RT-11 (which is, historically, partly my fault).
>>>>
>>>> Am I understanding correct that the "P" after the file size is the
>>>> indication of the read-only status of the file? I seem to remember it
>>>> appearing to be so from something I did, but I'm not sure.
>>>
>>> "P" means the file is protected from deletion.
>>
>> Ah. As mentioned above. I probably had delete protection confused with
>> write protection in my memory. Not sure what will happen on writes to
>> the shared part of the disk.
>
> My guess is that RTEM protects the system area. I have read the doc
> kit somewhere.
In a way it have no choice. It runs under RSX, and all disk access is
going through the system just like any other. And the shared disk image
is read-only for most users.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 14:16 ` Johnny Billquist
@ 2012-02-21 16:42 ` paramucho
2012-02-21 19:43 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-21 16:42 UTC (permalink / raw)
On Tue, 21 Feb 2012 15:16:25 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>On 2012-02-21 12.37, paramucho wrote:
>> On Tue, 21 Feb 2012 11:23:02 +0100, Johnny Billquist<bqt@softjar.se>
>> wrote:
>>
>> <snip?>
>>
>>>> But if RSX didn't go into system state you wouldn't need these helper
>>>> processes. At present they're not an option.
>>>
>>> But then you would have to be able to block in the system call, at which
>>> point you also need to be able to back out and restart system calls, or
>>> else fail system calls with the error saying that you need to redo the
>>> system call (EINTR). One is extremely complex, while the other is very
>>> ugly. Unix and VMS have gone with the latter.
>>> I thought we'd already agreed that Unix was not something to follow. :-)
>>>
>>> Or we could accept that processes become deaf at certain times, making
>>> response times utterly unpredictable.
>>
>> How does the process become deaf? It can still accept ASTs. What else
>> is it supposed to do?
>
>It wasn't a statement - it was a suggestive question on what to possibly do.
>The problem is - if you get an AST while blocking on a system call, what
>will you do with that system call. The program can do another system
>call in the AST. Can you deal with being blocked in a system call, and
>at the same time do another system call? And what do you expect the
>stack to look like at that point? And the blocking in the current system
>call is somehow reflected in the process status. That needs to be
>temporary "forgotten", since the process is not blocked while running in
>the AST. But once the AST is finished, I would assume that you expect
>the process to go back to being blocked in the outer system call. But
>the process state might have changed because of things done in the AST,
>including the wish to get out of the system call you were blocked in.
>Not to mention what to do if you are blocking on a system call, gets an
>AST, and in the AST handler do a system call which blocks you. Then what?
System waits ("blocks") may terminate prematurely because of various
conditions, including stuff that ASTs do. So, when a system wait
returns, the routine has to make sure that it's actual condition has
been satisfied, and if it hasn't then it reissues the system wait. The
stack is not a problem.
In the RT-11 sources you'll see a bunch of calls to $SYSWT which
implement this logic for RT-11. $SYSWT uses co-routines, so they're
even more convoluted than RT-11 usually is.
I had a look at my RUST/XM system wait code tonight, and I think I
understand it. The "$stall #10$, prwhi" issues the system wait, with
10$ as the continuation address after the system wait and prwhi.
(hibernation) as the system wait state.
em$spd:: ;suspend
10$: mov p$hpcr,r4 ;get the pcr
$float ;stop the scheduler
mov pr.sta(r4),r0 ;get the status
bic #prwak$,pr.sta(r4) ;clear the bit
bit #stact$,p$hast ;are we in an AST?
bne 20$ ;yes - forget the rest
bit #prwak$,r0 ;did we get a wake up?
bne 20$ ;yes
$stall #10$, prwhi. ;hibernate
20$: $land
return
em$rsm:: ;resume
mov p$hpcr,r4 ;get the pcr
bis #prwak$,pr.sta(r4) ;set wake pending
return
>See http://en.wikipedia.org/wiki/PCLSRing for more details.
That seems to be some other issue.
>> It's still just one specific test. That doesn't measure overall system
>> performance or other system specific behaviors.
>
>Sure. I can dig up a number of more examples showing that response times
>in VMS are much worse than RSX. How many do you need to be convinced?
How long is a piece of string :-)
I once purchased a VAX/730, so you don't need to convince me of
anything...
But I also spent about five years or so working with VMS and it ain't
so bad and I learned a lot by reading the VMS source microfiches.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-21 17:38 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]
>Johnny Billquist wrote:
>> [Snip]
>>
>> I was attempting to suggest that my understanding of
>> what Johnny wrote was that a .Purge was done for
>> both CSI routines since Johnny wrote:
>>
>> "Must be looking at different versions of something,"
>>
>> in reference to your statement (just a line above):
>>
>> "Note, .CSISPC (C$SISP:) does not purge or open files."
>>
>> If Johnny could please clarify, that would be helpful.
>> I am only suggesting that I don't understand Johnny's
>> response, but that I tend to conclude that Johnny's
>> words mean that he thinks that both CSI routines
>> do perform a .Purge loop. Ian and I have concluded
>> that only .CSISPC (C$SISP:) performs the .Purge loop.
>
>
> I have never made any distinction between various parts of the CSI,
> just noting that CSI calls USR.
>
> Which is done both through an EMT 374 right at the start of C$SIGN,
> and later you have a "JMP EMTUSR" (which would appear to happen for
> both).
>
> And so, it would appear to me, that a call to CSI would block other
> USR calls, for the most part of the CSI processing.
I think that the situation is not as black and white as
you suggest.
(a) Whenever the user is using the keyboard to enter
the CSI file names (for BOTH C$CSISP and
C$CSIGN), the USR is released and the job
is placed into wait state until the <RETURN>
key is used
(b) C$CSISP does not perform any disk I/O to
open files, it only parses the data and returns
the specified information to the user - which
means that the USR, even if it is blocked, is
blocked for a very short time
So while you are correct that the USR is used, the
blocking will be negligible for a C$CSISP request.
I don't have a good estimate, but I would not expect
the blocking to be a problem compared to the actual
blocking when the actual files that the program is told
by the user to process via the C$CSISP request are
actually opened. Note that programs like LINK.SAV
are careful to perform all of the USR requests very
early on and all at the same time after which the files
are .SaveStatus followed by a .ReOpen when the file
actually needs to be read. This limits the use of the
USR to a short period when (in the case of RT11FB)
the USR is already in memory and al of the .LookUp
requests are done at the same time.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 3431 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 17:38 ` Jerome H. Fine
@ 2012-02-21 19:31 ` Johnny Billquist
0 siblings, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-21 19:31 UTC (permalink / raw)
On 2012-02-21 18.38, Jerome H. Fine wrote:
> >Johnny Billquist wrote:
>>> [Snip]
>>>
>>> I was attempting to suggest that my understanding of
>>> what Johnny wrote was that a .Purge was done for
>>> both CSI routines since Johnny wrote:
>>>
>>> "Must be looking at different versions of something,"
>>>
>>> in reference to your statement (just a line above):
>>>
>>> "Note, .CSISPC (C$SISP:) does not purge or open files."
>>>
>>> If Johnny could please clarify, that would be helpful.
>>> I am only suggesting that I don't understand Johnny's
>>> response, but that I tend to conclude that Johnny's
>>> words mean that he thinks that both CSI routines
>>> do perform a .Purge loop. Ian and I have concluded
>>> that only .CSISPC (C$SISP:) performs the .Purge loop.
>>
>> I have never made any distinction between various parts of the CSI,
>> just noting that CSI calls USR.
>>
>> Which is done both through an EMT 374 right at the start of C$SIGN,
>> and later you have a "JMP EMTUSR" (which would appear to happen for
>> both).
>>
>> And so, it would appear to me, that a call to CSI would block other
>> USR calls, for the most part of the CSI processing.
> I think that the situation is not as black and white as
> you suggest.
Nothing never is. :-)
> (a) Whenever the user is using the keyboard to enter
> the CSI file names (for BOTH C$CSISP and
> C$CSIGN), the USR is released and the job
> is placed into wait state until the <RETURN>
> key is used
>
> (b) C$CSISP does not perform any disk I/O to
> open files, it only parses the data and returns
> the specified information to the user - which
> means that the USR, even if it is blocked, is
> blocked for a very short time
>
> So while you are correct that the USR is used, the
> blocking will be negligible for a C$CSISP request.
I don't know exactly what R1 indicates, but if whatever it points to is
non-zero, a call to USR is done (JMP EMTUSR), which will both do an
ENSYS, as well as set the flags indicating that USR is in use, and it
calls with R2 set to CSI.$, which gets into the CSI code of USR. I have
not properly followed what happens in there, but it then seems to be
reading from the TTY in the monitor code, and after a line have been
read, it jumps into CSI in USR again, to the same entry point, so I
assume there must be some flag making CSI act in different ways.
Oh, and of course, the call to USR can also mean that the USR needs to
be swapped in, which I suspect is also possibly some disk I/O.
> I don't have a good estimate, but I would not expect
> the blocking to be a problem compared to the actual
> blocking when the actual files that the program is told
> by the user to process via the C$CSISP request are
> actually opened. Note that programs like LINK.SAV
> are careful to perform all of the USR requests very
> early on and all at the same time after which the files
> are .SaveStatus followed by a .ReOpen when the file
> actually needs to be read. This limits the use of the
> USR to a short period when (in the case of RT11FB)
> the USR is already in memory and al of the .LookUp
> requests are done at the same time.
Right. It would seem that loopup or enter can probably take much more
time than CSI. However, a humans view on time is also vastly different
than a computers.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 16:42 ` paramucho
@ 2012-02-21 19:43 ` Johnny Billquist
2012-02-22 12:21 ` paramucho
2012-02-22 14:33 ` paramucho
0 siblings, 2 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-21 19:43 UTC (permalink / raw)
On 2012-02-21 17.42, paramucho wrote:
> On Tue, 21 Feb 2012 15:16:25 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-21 12.37, paramucho wrote:
>>> On Tue, 21 Feb 2012 11:23:02 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>> <snip?>
>>>
>>>>> But if RSX didn't go into system state you wouldn't need these helper
>>>>> processes. At present they're not an option.
>>>>
>>>> But then you would have to be able to block in the system call, at which
>>>> point you also need to be able to back out and restart system calls, or
>>>> else fail system calls with the error saying that you need to redo the
>>>> system call (EINTR). One is extremely complex, while the other is very
>>>> ugly. Unix and VMS have gone with the latter.
>>>> I thought we'd already agreed that Unix was not something to follow. :-)
>>>>
>>>> Or we could accept that processes become deaf at certain times, making
>>>> response times utterly unpredictable.
>>>
>>> How does the process become deaf? It can still accept ASTs. What else
>>> is it supposed to do?
>>
>> It wasn't a statement - it was a suggestive question on what to possibly do.
>> The problem is - if you get an AST while blocking on a system call, what
>> will you do with that system call. The program can do another system
>> call in the AST. Can you deal with being blocked in a system call, and
>> at the same time do another system call? And what do you expect the
>> stack to look like at that point? And the blocking in the current system
>> call is somehow reflected in the process status. That needs to be
>> temporary "forgotten", since the process is not blocked while running in
>> the AST. But once the AST is finished, I would assume that you expect
>> the process to go back to being blocked in the outer system call. But
>> the process state might have changed because of things done in the AST,
>> including the wish to get out of the system call you were blocked in.
>> Not to mention what to do if you are blocking on a system call, gets an
>> AST, and in the AST handler do a system call which blocks you. Then what?
>
> System waits ("blocks") may terminate prematurely because of various
> conditions, including stuff that ASTs do. So, when a system wait
> returns, the routine has to make sure that it's actual condition has
> been satisfied, and if it hasn't then it reissues the system wait. The
> stack is not a problem.
So you need to restart the system call. What if it is a system call that
have been partially completed? The wait does not happen as a unique part
of the call.
Oh, wait, I bet you are thinking in terms of RT-11 here, where the
distinction between user mode and kernel mode is rather blurry.
In Unix, as an example, there is no context around to restart in the
middle of a system call. What you have left is the context at user mode,
which is then the start of the system call again.
And this is because a signal is delivered in user mode, so the process
gets out of the kernel, in order to run the signal handler. There is no
way you can keep the kernel context for the user process around at that
point. It can not live on the kernel stack, since you exited from the
kernel. It can not live on the user stack, since that would allow you to
break the security of the kernel.
> In the RT-11 sources you'll see a bunch of calls to $SYSWT which
> implement this logic for RT-11. $SYSWT uses co-routines, so they're
> even more convoluted than RT-11 usually is.
>
> I had a look at my RUST/XM system wait code tonight, and I think I
> understand it. The "$stall #10$, prwhi" issues the system wait, with
> 10$ as the continuation address after the system wait and prwhi.
> (hibernation) as the system wait state.
>
> em$spd:: ;suspend
> 10$: mov p$hpcr,r4 ;get the pcr
> $float ;stop the scheduler
> mov pr.sta(r4),r0 ;get the status
> bic #prwak$,pr.sta(r4) ;clear the bit
> bit #stact$,p$hast ;are we in an AST?
> bne 20$ ;yes - forget the rest
> bit #prwak$,r0 ;did we get a wake up?
> bne 20$ ;yes
> $stall #10$, prwhi. ;hibernate
> 20$: $land
> return
>
> em$rsm:: ;resume
> mov p$hpcr,r4 ;get the pcr
> bis #prwak$,pr.sta(r4) ;set wake pending
> return
>
>> See http://en.wikipedia.org/wiki/PCLSRing for more details.
>
> That seems to be some other issue.
No. It is totally the issue. See my comments above.
RT-11 can, however, get away with some things that you cannot do in
systems where user mode and kernel mode are totally separate and
isolated from each other.
Assuming I'm right, I can see why a lot of discussion and confusion
comes up between us. The conditions in RT-11 are rather different than
other systems, meaning you can do stuff that is totally impossible in
other OSes.
>>> It's still just one specific test. That doesn't measure overall system
>>> performance or other system specific behaviors.
>>
>> Sure. I can dig up a number of more examples showing that response times
>> in VMS are much worse than RSX. How many do you need to be convinced?
>
> How long is a piece of string :-)
Exactly. :-D
> I once purchased a VAX/730, so you don't need to convince me of
> anything...
Heh. That was one slow machine.
> But I also spent about five years or so working with VMS and it ain't
> so bad and I learned a lot by reading the VMS source microfiches.
VMS have its points... But to quote the RSX sources:
(LB:[11,10]TDSCH.MAC, line 130 or so...)
;+
; If we cannot process a clock interrupt within 10 seconds, we are
; no longer processing in real time, and we may as well become
; a VAX ... Call an end to this ... NOW!
;-
BGCK$A BF.SAN,BE.IDC,<FATAL> ;;; System massively confused
More a funny joke than really serious in some ways, but still...
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 8:06 ` paramucho
2012-02-21 10:38 ` Johnny Billquist
@ 2012-02-22 2:51 ` Jerome H. Fine
2012-02-22 6:37 ` paramucho
1 sibling, 1 reply; 222+ messages in thread
From: Jerome H. Fine @ 2012-02-22 2:51 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 10471 bytes --]
>paramucho wrote:
>>On Mon, 20 Feb 2012 22:29:03 -0500, "Jerome H. Fine" wrote:
>
>>>RT-11 does not provide a directory scan system call, so utilities must
>>>access the directory directly to scan them. RT-11 guarantees that a
>>>directory structure begins at block 6 of a file structured device.
>>>
>>Actually, while DEC ALWAYS starts the directory structure
>>at block 6 of a file structured device, that is not required since
>>in block 1, there is a value which holds the starting block number.
>>
>>I stress that DEC has never used a different value and that ALL
>>present code ignores the starting block number specified within
>>block 1, but it is a possibility.
>>
>Right. I'm aware of that home block value. It was never used by any
>version of RT-11 that I know of. I've sometimes thought it might have
>been used by RTEM. I thought of using it myself when I implemented
>RUST/SJ sub-directories, but it wasn't worth it.
>
>
However, while I VERY much doubt that there will ever be
a reason to make such a major change to the RT-11 file
structure, it could be done. Since it would make every
previous version of RT-11 incompatible with the use of
a different starting block number, there seems no reason
at the present time to do so, especially since there is nothing
extra that could be done except in a few cases where the
media has hardware faults in the blocks where the file
directory segments normally are located - blocks 6 to 67.
>>>Early versions of RT-11 supported a mechanism by which the USR would
>>>"callback" a program at critical points with a pointer to the
>>>directory entry being processed. Most if not all this utility code has
>>>been replaced by later system calls which read and write individual
>>>directory entries without a callback. However, except for disk
>>>initialization etc, no RT-11 utility directly modifies a directory
>>>with a .READ/.WRITE sequence.
>>>
>>That "undocumented" "callback" mechanism is still present
>>in RT-11, just not used any more by the latest versions of
>>DEC SAV files within RT-11. That code has been
>>replaced by code which uses the additional file EMT
>>requests.
>>
>>So it actually is still possible and still "undocumented".
>>
>>I suspect that versions of PIP which used the "callback"
>>mechanism will still function correctly if the RT-11 version
>>number check is circumvented.
>>
>>There are other still "undocumented" features in RT-11 such
>>as READ ONLY / WRITE PROTECTED files.
>>
>They are directory entry flags which were defined in the final stages
>of RT-11. They were barely used. The Read-only flag is copied by
>.LOOKUP, but that's about it. I haven't bothered implementing it
>because the new flags are not backwards compatible with earlier
>versions of RT-11 (which is, historically, partly my fault).
>
>
Are you suggesting that the PROTECTED bit in the
status word of a file label ever changed from the highest
order bit (bit 15 = 100000 making a word negative) over
the course of RT-11? Bit 14 (040000) is used as the
READ ONLY bit and is always compatible with the
other bits that are used.
The bit definition is E.READ and that definition is available
for the first word in a file label for file structures devices
starting with V05.05 of RT-11. It is used in the RT-11
monitor ONLY TWICE.
Also, I am not sure what you define as the final stages of
RT-11. The instruction:
Bit #<E.READ>,@R3
first appeared in RMONFB.MAC under V05.05 of RT-11
in 1989, so in my opinion, it was available with the code to
support extended device drivers with 64 devices as opposed
to just 8 devices available under V05.04G of RT-11 in 1988.
While V05.05 of RT-11 was certainly after many of the
early distributions, the addition of enhanced device drivers
was, in my opinion, a very major enhancement and I would
not say it arrived in the final stages. The pressure on DEC
was probably from the third party developers who supported
a form of enhanced device drivers, but which required another
form to implement. The DEC method was rather elegant if
I am allowed to say so. The ONLY major aspect which was
omitted from enhanced MSCP device drivers was the ability
to BOOT more than the first 8 devices. That additional
enhancement was easily added for an MSCP device with a
single pair of CSR / VECTOR which then required only a
single word to hold the UNIT / PART value (a byte each)
in the boot block.
The only other instruction was:
Bic #^C<E.READ>,@SP
in the USR.MAC under V05.05 of RT-11 to support keeping
the E.READ bit in the first of the five CSWs when a .LookUp
was performed. That takes a total of about 6 instructions in
two locations in the monitor of RT-11 to handle READ ONLY /
WRITE PROTECTED files. Thus, the extra code in the RT-11
monitor is trivial compared to the importance of having
READ ONLY files.
Obviously, the RT-11 development team had the idea a long
time previous to the appearance of the code in V05.05 of
RT-11. The fact that the necessary changes to DIR and PIP
were never made indicates something that I find difficult to
understand - if Megan Gentry or someone else on the RT-11
development team could comment as to why the DIR and PIP
code was never implemented and distributed, it would help
to understand what the viewpoint was at DEC.
>[Snip]
>
>However, you don't need to use the USR to open files on special
>directory devices. Instead, you use .SPFUN with the appropriate
>function codes (indeed, that's exactly how the USR handles these
>devices).
>
>
I don't think that is actually the case. I seem to remember
that the USR does ordinary .READW and .WRITW on
the file directory to accomplish a .LookUp or a .Enter for
a file. I can find the code if you would find that helpful.
>>>The "special device" interface and RT-11 directory structure can be
>>>used to simulate other kinds of devices. I use these two features to
>>>implement a transparent remote file system which permits PDP-11 users
>>>access remote directories as if they were local.
>>>
>>Do you have any details that you are willing to share?
>>I know that DO(X).SYS which John Wilson wrote
>>to execute under E11 may do something similar with
>>DOS directories, but I have never used DO(X).SYS
>>and I have not looked at the code.
>>
>I first supported transparent remote directories in the late
>seventies. There are two crucial features in the RUST implementations:
>
>1. Logical names. If you define the following logical name xxx:
>
>. define xxx nf
>
RT-11 does not support the DEFINE command. In
addition, RUST must obviously have additional data
structures which interact with the USR equivalent.
Can you please describe a bit of how the DEFINE
structures are set up and used? Unless, of course,
NF: is handled as a device driver.
>Then when you access XXX: the NF driver will look for the logical name
>at the server. (To handle this on Windows I had to implement a Windows
>Logical Name system for my environment). On RUST/SJ the default
>translation for a logical name is usually NF:.
>
>
It would be helpful to understand a bit more.
This does not seem as if it is present in RT-11.
>>Under RT-11, I have looked at the technical aspects
>>of an LN(X).SYS device handler (Logical Name Device
>>List Pseudo Device Driver) which supports the same
>>functions as the PATH on DOS or the LNL on VMS.
>>Note that in the latter case, many levels of directories
>>can be used under VMS while for RT-11, only a single
>>device name can be used for each entry. Thus when an
>>RT-11 user wishes to have a .LookUp performed (and
>>ONLY a .LookUp EMT request is supported) on the
>>file LN2:FOOBAR.TYP, the .LookUp EMT request
>>code in the USR knows to search the Logical Name
>>Device List in the specified order. For example, use:
>>
>>LN2: => LD2:, LD1:, DU3:
>>
>>until the specified file with that device name is found.
>>When I wrote the code for the first preliminary version,
>>I used the RT-11 ASSIGN command to:
>>
>>ASSIGN LD2: L2A:
>>ASSIGN LD1: L2B:
>>ASSIGN DU3: L2C:
>>
>>and then searched the four names: L2A, L2B, L2C and L2D
>>to locate the file name. After I realized that this would use
>>up too many entries in the ASSIGNed table, I enhanced the
>>code of the LN(X).SYS device driver to hold a "Logical Name
>>Device List" within the device driver file in the same manner
>>as LD(X).SYS so that the ASSIGNed table would not be
>>required.
>>
>>
>
>RUST systems support DEFINE/PATH to handle this situation:
>
>. define/path sy vm,sy,tmp
>
>instructs the system to search VM:, SY: and TMP:, in that order for
>lookups to SY:.
>
RUST must have additional code and data structures
to support this feature. If does not seem that RT-11
could easily make this available to the user.
I agree that LN(X).SYS under RT-11 uses the existing
device drivers in the traditional manner, but this allows
the user to also use the existing SET commands in the
normal RT-11 manner.
However, your description of the "DEFINE / PATH"
command suggests a much easier easier way for the
user to accomplish the same thing:
SET LN2: DEVICES=VM:,SY:,TMP:
Note that the LN(X).SYS is a completely new device
driver.
>>Is the code that you use to access remote directories supported
>>by both RT-11 and RUST or just RUST? Have you modified
>>an existing device driver or written a new one? The name
>>RM(X).SYS would be a suitable name for the device driver,
>>but I expect that you did not use those two characters.
>>
>They are all new drivers. I don' use any DEC source code. When I first
>wrote them, many years ago, they also functioned under RT-11, but I
>haven't really tested them there for many years and I guess there are
>some new features which might break. I've just got some real PDP-11s
>working for the first time in a couple of years and I know I have to
>some testing in that general area, so I'll try it out.
>
>The RUST/SJ NFV.SYS is on the RUST/SJ kit. At present it probably only
>work properly with the Windows server NF.EXE, also in the RUST kit.
>WinPCap is also required. The documentation is at
>http://rust.wikispaces.com/.
>
Thank you for the information thus far. If you care to
expand, it would be appreciated.
Jerome Fine
[-- Attachment #2: Type: text/html, Size: 12703 bytes --]
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-22 2:51 ` Jerome H. Fine
@ 2012-02-22 6:37 ` paramucho
0 siblings, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-22 6:37 UTC (permalink / raw)
On Tue, 21 Feb 2012 21:51:04 -0500, "Jerome H. Fine"
<everyone@nospam.com> wrote:
>>They are directory entry flags which were defined in the final stages
>>of RT-11. They were barely used. The Read-only flag is copied by
>>.LOOKUP, but that's about it. I haven't bothered implementing it
>>because the new flags are not backwards compatible with earlier
>>versions of RT-11 (which is, historically, partly my fault).
>>
>>
>Are you suggesting that the PROTECTED bit in the
>status word of a file label ever changed from the highest
>order bit (bit 15 = 100000 making a word negative) over
>the course of RT-11? Bit 14 (040000) is used as the
>READ ONLY bit and is always compatible with the
>other bits that are used.
If you in V5.4 USR.MAC you'll find the following check made in
BLKCHK:
BLKCHK: ...
BIT #^C<107400>,@R1
BNE ILLDIR
That code checks for an invalid volume by making sure the bits
070377 are not set in the directory entry status word. My part,
historically, was that I got the RT-11 team to put that check in
because it was the only cause I had of crashes in STAR-11, my earliest
commercial system.
The way I got them to put the check in was this: The size of the USR
was fixed at exactly 2048 words. Anytime they wanted to put more code
in there they'd have to spend days just optimising to get a few free
words. I had a look at the USR and discovered that over time one of
the routines had become completely redundant, for a saving of 14
words. That was enough payment to get my fix put in.
If you look in V5.5 you'll see that the earlier volume check is gone,
replaced by a number of checks made to the directory header. It's in
this version that E.READ is defined (as 040000) and used.
The problem is that if you try to use a directory which has E.READ set
with V5.4 and earlier you will get an "Invalid Directory" error
because E.READ conflicts with the earlier "^C<107400>" test.
<snip>
>Also, I am not sure what you define as the final stages of
>RT-11. The instruction:
> Bit #<E.READ>,@R3
>first appeared in RMONFB.MAC under V05.05 of RT-11
>in 1989, so in my opinion, it was available with the code to
>support extended device drivers with 64 devices as opposed
>to just 8 devices available under V05.04G of RT-11 in 1988.
>
>While V05.05 of RT-11 was certainly after many of the
>early distributions, the addition of enhanced device drivers
>was, in my opinion, a very major enhancement and I would
>not say it arrived in the final stages. The pressure on DEC
>was probably from the third party developers who supported
>a form of enhanced device drivers, but which required another
>form to implement. The DEC method was rather elegant if
>I am allowed to say so. The ONLY major aspect which was
>omitted from enhanced MSCP device drivers was the ability
>to BOOT more than the first 8 devices. That additional
>enhancement was easily added for an MSCP device with a
>single pair of CSR / VECTOR which then required only a
>single word to hold the UNIT / PART value (a byte each)
>in the boot block.
>
<snip>
>Obviously, the RT-11 development team had the idea a long
>time previous to the appearance of the code in V05.05 of
>RT-11. The fact that the necessary changes to DIR and PIP
>were never made indicates something that I find difficult to
>understand - if Megan Gentry or someone else on the RT-11
>development team could comment as to why the DIR and PIP
>code was never implemented and distributed, it would help
>to understand what the viewpoint was at DEC.
V5.6 was the last release from DEC itself, so I would define V5.6 as
being in the final stages of RT-11's history. In fact, V5.6 had enough
significant new code to call it V6.0, but the RT-11 were trying to
keep a low profile within the company at the time. There wasn't a
great take-up of V5.6 IIRC, which is a pity because it was one of
their best releases. The audience was moving elsewhere.
>>[Snip]
>>However, you don't need to use the USR to open files on special
>>directory devices. Instead, you use .SPFUN with the appropriate
>>function codes (indeed, that's exactly how the USR handles these
>>devices).
>>
>I don't think that is actually the case. I seem to remember
>that the USR does ordinary .READW and .WRITW on
>the file directory to accomplish a .LookUp or a .Enter for
>a file. I can find the code if you would find that helpful.
Look at SPESHL: in the USR.
<snip>
>>I first supported transparent remote directories in the late
>>seventies. There are two crucial features in the RUST implementations:
>>
>>1. Logical names. If you define the following logical name xxx:
>>
>>. define xxx nf
>>
>RT-11 does not support the DEFINE command. In
>addition, RUST must obviously have additional data
>structures which interact with the USR equivalent.
>Can you please describe a bit of how the DEFINE
>structures are set up and used? Unless, of course,
>NF: is handled as a device driver.
Right, on RT-11 you would use ASSIGN. RUST supports both.
NF: is a device driver.
>>Then when you access XXX: the NF driver will look for the logical name
>>at the server. (To handle this on Windows I had to implement a Windows
>>Logical Name system for my environment). On RUST/SJ the default
>>translation for a logical name is usually NF:.
>>
>>
>It would be helpful to understand a bit more.
>This does not seem as if it is present in RT-11.
On the Windows server machine you do this:
C:> run c:\rust\she
o nf/detached ! start the Windows NF server
o define tmp c:\rust\tmp !
o
On RT-11 or RUST you would do this:
. load nf
. assign nf tmp
. dir tmp:
The NF: driver is able to pick up the logical name TMP:. It sends this
name, along with a network request package to the server.
The Windows server gets the name "tmp" and translates it locally to
get "c:\rust\tmp", a native directory, and sends back a RT-11-formate
directory to the RT-11/RUST system.
>>RUST systems support DEFINE/PATH to handle this situation:
>>
>>. define/path sy vm,sy,tmp
>>
>>instructs the system to search VM:, SY: and TMP:, in that order for
>>lookups to SY:.
>>
>RUST must have additional code and data structures
>to support this feature. If does not seem that RT-11
>could easily make this available to the user.
RUST has completely different source code to RT-11. I think TSX has a
similar feature.
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
1 sibling, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-22 12:21 UTC (permalink / raw)
On Tue, 21 Feb 2012 20:43:34 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
>> System waits ("blocks") may terminate prematurely because of various
>> conditions, including stuff that ASTs do. So, when a system wait
>> returns, the routine has to make sure that it's actual condition has
>> been satisfied, and if it hasn't then it reissues the system wait. The
>> stack is not a problem.
>
>So you need to restart the system call. What if it is a system call that
>have been partially completed? The wait does not happen as a unique part
>of the call.
A system wait *is* a unique part of a system call. You don't need to
restart the system call. The "wait" is a loop which retests a wait
condition. That's all.
>Oh, wait, I bet you are thinking in terms of RT-11 here, where the
>distinction between user mode and kernel mode is rather blurry.
>
>In Unix, as an example, there is no context around to restart in the
>middle of a system call. What you have left is the context at user mode,
>which is then the start of the system call again.
>And this is because a signal is delivered in user mode, so the process
>gets out of the kernel, in order to run the signal handler. There is no
>way you can keep the kernel context for the user process around at that
>point. It can not live on the kernel stack, since you exited from the
>kernel. It can not live on the user stack, since that would allow you to
>break the security of the kernel.
I don't know anything about Unix internals but I have the feeling that
it's not a good example because, like RSX, it doesn't have a reentrant
kernel where RT, RUST and VMS do.
I still think your looking at the issue from an RSX angle when you say
"exited from the kernel", in particular when you say the context "can
not live on the kernel stack". Kernel and user mode context are both
active during all process activity. The key piece of kernel
information to save across the ast is in fact the kernel fp/sp before
the ast. When an ast exits it returns to a piece of code which issues
a system call to handle ast exit.
There are rules which forbid one or two scenarios. For example, I
don't think you can run a kernel ast when a user ast is running. In
such cases the kernel ast is delayed.
However, there is nothing in the VMS sources about restarting system
calls because of ASTs, or anything else for that matter.
>> In the RT-11 sources you'll see a bunch of calls to $SYSWT which
>> implement this logic for RT-11. $SYSWT uses co-routines, so they're
>> even more convoluted than RT-11 usually is.
>>
>> I had a look at my RUST/XM system wait code tonight, and I think I
>> understand it. The "$stall #10$, prwhi" issues the system wait, with
>> 10$ as the continuation address after the system wait and prwhi.
>> (hibernation) as the system wait state.
>>
>> em$spd:: ;suspend
>> 10$: mov p$hpcr,r4 ;get the pcr
>> $float ;stop the scheduler
>> mov pr.sta(r4),r0 ;get the status
>> bic #prwak$,pr.sta(r4) ;clear the bit
>> bit #stact$,p$hast ;are we in an AST?
>> bne 20$ ;yes - forget the rest
>> bit #prwak$,r0 ;did we get a wake up?
>> bne 20$ ;yes
>> $stall #10$, prwhi. ;hibernate
>> 20$: $land
>> return
>>
>> em$rsm:: ;resume
>> mov p$hpcr,r4 ;get the pcr
>> bis #prwak$,pr.sta(r4) ;set wake pending
>> return
>>
>>> See http://en.wikipedia.org/wiki/PCLSRing for more details.
>>
>> That seems to be some other issue.
>
>No. It is totally the issue. See my comments above.
>
>RT-11 can, however, get away with some things that you cannot do in
>systems where user mode and kernel mode are totally separate and
>isolated from each other.
What do you think the (RUST) code above is "getting away with"?
BTW: user mode and kernel mode have the same memory map in VMS. They
are certainly not totally isolated. In mapped RT-11 and RUST systems
they are quite separate.
>Assuming I'm right, I can see why a lot of discussion and confusion
>comes up between us. The conditions in RT-11 are rather different than
>other systems, meaning you can do stuff that is totally impossible in
>other OSes.
There is a good deal of flexibility unmapped RT-11 systems (e.g.
RT-11/SJ, RT-11/FB and RUST/SJ), but in the mapped systems (RT-11/XM,
RUST/XM) much of that flexibility is lost.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-22 12:21 ` paramucho
@ 2012-02-22 14:12 ` paramucho
2012-02-22 15:26 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-22 14:12 UTC (permalink / raw)
On Wed, 22 Feb 2012 12:21:43 GMT, paramucho@hotmail.com (paramucho)
wrote:
Cancel this response.
I pressed [SEND] by mistake.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-21 19:43 ` Johnny Billquist
2012-02-22 12:21 ` paramucho
@ 2012-02-22 14:33 ` paramucho
2012-02-22 15:53 ` Johnny Billquist
1 sibling, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-22 14:33 UTC (permalink / raw)
On Tue, 21 Feb 2012 20:43:34 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
http://bitsavers.org/pdf/dec/vax/vms/training/
EY-00014-DP_VMS_Internals_and_Data_Structures_1984.pdf
>> System waits ("blocks") may terminate prematurely because of various
>> conditions, including stuff that ASTs do. So, when a system wait
>> returns, the routine has to make sure that it's actual condition has
>> been satisfied, and if it hasn't then it reissues the system wait. The
>> stack is not a problem.
>
>So you need to restart the system call. What if it is a system call that
>have been partially completed? The wait does not happen as a unique part
>of the call.
The previous response was written before I actually checked the
documentation. I pressed [SEND] by mistake.
In fact, there are only three "regular" VMS system calls which issue
"system waits": hibernate, wait-for-event-flag and wait-for-
event-group (or something like that). The entire system call is
nothing more than a "wait" (so partial completion does not occur).
In VMS, the wait does take place in the mode that the system service
was executed with the PC/PSL backed-up to reissue the Change-mode
instruction for the system call. The main reason for this has more to
do with the orderly handling of processor modes than it has to do with
kernel context.
>Oh, wait, I bet you are thinking in terms of RT-11 here, where the
>distinction between user mode and kernel mode is rather blurry.
I've used VMS more in the last twenty years than I have RT-11. If my
thinking is blurry it's because of my hippie memory.
>In Unix, as an example, there is no context around to restart in the
>middle of a system call. What you have left is the context at user mode,
>which is then the start of the system call again.
>And this is because a signal is delivered in user mode, so the process
>gets out of the kernel, in order to run the signal handler. There is no
>way you can keep the kernel context for the user process around at that
>point. It can not live on the kernel stack, since you exited from the
>kernel. It can not live on the user stack, since that would allow you to
>break the security of the kernel.
This is a separate issue to the system waits above.
Ast delivery is (hardware) controlled by the REI instruction which
compares the mode of pending asts against the destination mode of the
REI. For example, user mode asts are note delivered when the REI
destination mode is kernel. Essentially, from what I can see, asts
just have to wait. So, effectively, VMS is just as bad as RSX in this
regard.
So, I was right when I remembered that system calls are not restarted
(involuntarily), but I completely forgot about the hardware mechanism.
I'll have another look at this stuff on the weekend. VMS is not always
obvious.
<snip>
>>> See http://en.wikipedia.org/wiki/PCLSRing for more details.
>>
>> That seems to be some other issue.
>
>No. It is totally the issue. See my comments above.
>
>RT-11 can, however, get away with some things that you cannot do in
>systems where user mode and kernel mode are totally separate and
>isolated from each other.
RT-11/XM and RUST/XM are memory mapped PDP-11 systems where user mode
and kernel mode are separate. I'm not sure what your point is.
>Assuming I'm right, I can see why a lot of discussion and confusion
>comes up between us. The conditions in RT-11 are rather different than
>other systems, meaning you can do stuff that is totally impossible in
>other OSes.
I think the confusion comes more because I use VMS examples and you
use Unix examples. I know nothing about the Unix kernel and you don't
seem have looked VMS a lot.
I don't think the techniques used in RUST or RT-11 are impossible in
other OSes. In fact, I'm curious where the RT-11 techniques came from.
The V2.0 team leader who implemented this stuff had previously worked
on both RSTS and TOPS-something I think.
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-22 12:21 ` paramucho
2012-02-22 14:12 ` paramucho
@ 2012-02-22 15:26 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-22 15:26 UTC (permalink / raw)
On 2012-02-22 13.21, paramucho wrote:
> On Tue, 21 Feb 2012 20:43:34 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>>> System waits ("blocks") may terminate prematurely because of various
>>> conditions, including stuff that ASTs do. So, when a system wait
>>> returns, the routine has to make sure that it's actual condition has
>>> been satisfied, and if it hasn't then it reissues the system wait. The
>>> stack is not a problem.
>>
>> So you need to restart the system call. What if it is a system call that
>> have been partially completed? The wait does not happen as a unique part
>> of the call.
>
> A system wait *is* a unique part of a system call. You don't need to
> restart the system call. The "wait" is a loop which retests a wait
> condition. That's all.
But there is a problem here. Can't you see it?
If you are sitting in a wait loop in the kernel, how do you get back out
to user state in a way that will allow you to get back into the wait
loop with a preserved context, without exposing the kernel to userspace
manipulatio?
Normally this is not a problem, because you do not call out from kernel
to userspace. Userspace do a system call, and eventually it returns. You
do not have code in kernel space escaping back out into userspace, and
then userspace returns back into kernelspace, where execution continues.
Therein lies the problem. From userspace, the system call is a single
instruction. It is either performed, or not. Not half-done. However, by
having the kernel call back out to user space in the middle of a system
call, you both violate that view, and you require kernel context to be
kept around while back in user space, at which time a context switch can
again take place, not to mention other system calls taking place.
So, how do you keep the context for the first system call around when
the next system call happens? And what do you expect to be on the stack?
And what if the second system call also cause a wait? There is a big can
of worms here.
>> Oh, wait, I bet you are thinking in terms of RT-11 here, where the
>> distinction between user mode and kernel mode is rather blurry.
>>
>> In Unix, as an example, there is no context around to restart in the
>> middle of a system call. What you have left is the context at user mode,
>> which is then the start of the system call again.
>> And this is because a signal is delivered in user mode, so the process
>> gets out of the kernel, in order to run the signal handler. There is no
>> way you can keep the kernel context for the user process around at that
>> point. It can not live on the kernel stack, since you exited from the
>> kernel. It can not live on the user stack, since that would allow you to
>> break the security of the kernel.
>
> I don't know anything about Unix internals but I have the feeling that
> it's not a good example because, like RSX, it doesn't have a reentrant
> kernel where RT, RUST and VMS do.
This is not about reentrancy.
And yes, the Unix kernel is reentrant. You can have several processes
doing and blocking on the same system call in parallel.
Since RSX don't really have the scenario at all, it isn't really helpful
to talk about reentrancy in the RSX case. But as far as anything is
concerned, most anything is reentrant in RSX.
But even bring that term up is a red herring.
> I still think your looking at the issue from an RSX angle when you say
> "exited from the kernel", in particular when you say the context "can
> not live on the kernel stack". Kernel and user mode context are both
> active during all process activity. The key piece of kernel
> information to save across the ast is in fact the kernel fp/sp before
> the ast. When an ast exits it returns to a piece of code which issues
> a system call to handle ast exit.
Nope. Since this isn't even a problem in RSX. It is a problem in Unix,
it is a problem in VMS. Both of them have system calls that can be
aborted with the error code that you need to redo the system call again.
Which is the Unix solution to the problem.
Other systems instead backs out and redo the system call after it has
been interrupted.
You seem to be pretty alone in thinking that you can just ignore it.
> There are rules which forbid one or two scenarios. For example, I
> don't think you can run a kernel ast when a user ast is running. In
> such cases the kernel ast is delayed.
Don't know about RT-11, but in VMS, as well as RSX, when one AST is
executing, all other ASTs are blocked for that process. All ASTs are
queued for the process, and kernel ASTs are added to the head of the
queue, while user ASTs are added to the tail.
So all ASTs (no matter which type) are delayed when an AST is in progress.
> However, there is nothing in the VMS sources about restarting system
> calls because of ASTs, or anything else for that matter.
My memory was incorrect. I can't find anything about aborting system
calls because of ASTs. I'll look some more. The only errors meaning
please restart system calls are from resource shortages.
However, VMS can block processes, making them deaf and dumb instead,
which seems to be the normal behavior there. That's all your resource
waits. No wonder VMS have lousy response times. You cannot be sure ASTs
are delivered anywhere near the time they were queued.
And resource waits are basically mutexes for the process. And they can
happen for a number of reasons. And no, you do not break out of a
resource wait just because you get an AST.
In Unix, you get the system call aborted. In VMS, at some sensitive
places you instead have the process go deaf and dumb.
Now, if you consider that better or worse than Unix, I don't know. I
totally dislike both solutions.
>>> In the RT-11 sources you'll see a bunch of calls to $SYSWT which
>>> implement this logic for RT-11. $SYSWT uses co-routines, so they're
>>> even more convoluted than RT-11 usually is.
>>>
>>> I had a look at my RUST/XM system wait code tonight, and I think I
>>> understand it. The "$stall #10$, prwhi" issues the system wait, with
>>> 10$ as the continuation address after the system wait and prwhi.
>>> (hibernation) as the system wait state.
>>>
>>> em$spd:: ;suspend
>>> 10$: mov p$hpcr,r4 ;get the pcr
>>> $float ;stop the scheduler
>>> mov pr.sta(r4),r0 ;get the status
>>> bic #prwak$,pr.sta(r4) ;clear the bit
>>> bit #stact$,p$hast ;are we in an AST?
>>> bne 20$ ;yes - forget the rest
>>> bit #prwak$,r0 ;did we get a wake up?
>>> bne 20$ ;yes
>>> $stall #10$, prwhi. ;hibernate
>>> 20$: $land
>>> return
>>>
>>> em$rsm:: ;resume
>>> mov p$hpcr,r4 ;get the pcr
>>> bis #prwak$,pr.sta(r4) ;set wake pending
>>> return
>>>
>>>> See http://en.wikipedia.org/wiki/PCLSRing for more details.
>>>
>>> That seems to be some other issue.
>>
>> No. It is totally the issue. See my comments above.
>>
>> RT-11 can, however, get away with some things that you cannot do in
>> systems where user mode and kernel mode are totally separate and
>> isolated from each other.
>
> What do you think the (RUST) code above is "getting away with"?
I did not initially even look at your code, since it didn't seem that
relevant. Code in RT-11 in general do not (nor need) the strict
separation between userspace and kernel space. That is what I was
referring to with the "get away with" comment. It is much more ok to
call back from the kernel to the user program in RT-11, since there are
no security considerations to take.
But if I read things right, you get to em$spd when you are about to
suspend a process, and call em$rsm to wake a process up?
So, if you are in an AST, you will never suspend, otherwise you will
unless the wake bit have been set.
There is way too little here to see or comment much more about. How do
you deliver an AST? Where does that happen, and in which context? How is
the AST invoked, and how is it returned from? What happens if you do
system calls in the AST routine? And if those need to block?
> BTW: user mode and kernel mode have the same memory map in VMS. They
> are certainly not totally isolated. In mapped RT-11 and RUST systems
> they are quite separate.
Since in VMS (well, on a VAX anyway, but I assume on all architectures)
you only have one memory map, that is not really relevant. User mode
cannot access, or even see pages in the kernel. And cannot access the
kernel stack. The kernel is totally isolated from the user mode. Kernel
can, however, access all memory of the user. Not really different than
from a PDP-11, even though there you have different mappings depending
on which mode the processor is in.
The only way to get from user mode to kernel mode is by causing a trap,
which the kernel will handle, and then do something (for example a
system call).
You cannot "return" from user mode to kernel mode, or call random
addresses in kernel mode from user mode, or even check any data the
kernel holds.
>> Assuming I'm right, I can see why a lot of discussion and confusion
>> comes up between us. The conditions in RT-11 are rather different than
>> other systems, meaning you can do stuff that is totally impossible in
>> other OSes.
>
> There is a good deal of flexibility unmapped RT-11 systems (e.g.
> RT-11/SJ, RT-11/FB and RUST/SJ), but in the mapped systems (RT-11/XM,
> RUST/XM) much of that flexibility is lost.
I guess some of it must be lost by just having memory being mapped away
in different directions.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-22 14:33 ` paramucho
@ 2012-02-22 15:53 ` Johnny Billquist
2012-02-22 16:48 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-22 15:53 UTC (permalink / raw)
On 2012-02-22 15.33, paramucho wrote:
> On Tue, 21 Feb 2012 20:43:34 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> http://bitsavers.org/pdf/dec/vax/vms/training/
> EY-00014-DP_VMS_Internals_and_Data_Structures_1984.pdf
>
>>> System waits ("blocks") may terminate prematurely because of various
>>> conditions, including stuff that ASTs do. So, when a system wait
>>> returns, the routine has to make sure that it's actual condition has
>>> been satisfied, and if it hasn't then it reissues the system wait. The
>>> stack is not a problem.
>>
>> So you need to restart the system call. What if it is a system call that
>> have been partially completed? The wait does not happen as a unique part
>> of the call.
>
> The previous response was written before I actually checked the
> documentation. I pressed [SEND] by mistake.
Ah. I made some comments that you might want to read and comment on
anyway...
> In fact, there are only three "regular" VMS system calls which issue
> "system waits": hibernate, wait-for-event-flag and wait-for-
> event-group (or something like that). The entire system call is
> nothing more than a "wait" (so partial completion does not occur).
No. You are forgetting all the resource waits. These are the true
"waiting in kernel until can continue" which is different than RSX.
The hibernate and wait-for conditions exist just like in RSX. These are
system calls that restarted whenever interrupted. They have just about
no context, and thus can very easily be restarted automatically, which
is what is done.
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.
Like I said - the wait-for state, as well as the hibernating, are just
like in RSX. Although it's not called hibernate in RSX. It's probably
most equal to the BLOCKED state, although it could also be the STOPPED
state. (Why RSX have both is fun. They have different effects for the
purpose of swapping, but are otherwise equal, where STOPPED means the
swapping priority drops to 0, so that it is very eligible to be swapped
out, while BLOCKED retain the normal swap priority. There are system
calls to do both.)
> In VMS, the wait does take place in the mode that the system service
> was executed with the PC/PSL backed-up to reissue the Change-mode
> instruction for the system call. The main reason for this has more to
> do with the orderly handling of processor modes than it has to do with
> kernel context.
No. It is exactly like in RSX. If you get to the end of the AST routine,
the wait will be re-executed for you. There is no magic inside the
kernel that resumes the wait. Simple and efficient. Re-execute the wait
if interrupted. Since the wait-for calls have no context, there is
nothing to back out, nothing that hurts from being redone, and it also
automatically handles any changed conditions that might have happened as
a part of the AST execution itself.
>> Oh, wait, I bet you are thinking in terms of RT-11 here, where the
>> distinction between user mode and kernel mode is rather blurry.
>
> I've used VMS more in the last twenty years than I have RT-11. If my
> thinking is blurry it's because of my hippie memory.
:-)
You seem to have a very good grasp of RT-11, it seems to me.
>> In Unix, as an example, there is no context around to restart in the
>> middle of a system call. What you have left is the context at user mode,
>> which is then the start of the system call again.
>> And this is because a signal is delivered in user mode, so the process
>> gets out of the kernel, in order to run the signal handler. There is no
>> way you can keep the kernel context for the user process around at that
>> point. It can not live on the kernel stack, since you exited from the
>> kernel. It can not live on the user stack, since that would allow you to
>> break the security of the kernel.
>
> This is a separate issue to the system waits above.
Not entirely. The are related.
> Ast delivery is (hardware) controlled by the REI instruction which
> compares the mode of pending asts against the destination mode of the
> REI. For example, user mode asts are note delivered when the REI
> destination mode is kernel. Essentially, from what I can see, asts
> just have to wait. So, effectively, VMS is just as bad as RSX in this
> regard.
Yes, VMS works like RSX. :-)
Not sure what you mean by the REI comment. Maybe the code looks
different in VMS than RSX here, but in RSX, an AST is delivered by the
kernel pushing the AST dependent parameters along with some context on
the user stack, and then exit the kernel (using the REI as usual for any
kernel operation) to get back to user state. The new PC, however, is
then the AST address. At that point, ASTs are blocked by a piece of
information in the process structure saying that an AST is in progress.
When your user program have finished the AST, it will do a new system
call, the EXIT AST (ASTX$ in RSX) system call. This system call will
pick up the context on the user stack, and will then resume by a REI
back to user mode to continue where it was before the AST. The (old) PC
is one of the things that were sitting on the user stack, being pushed
there at AST entry, and popped by the AST EXIT. As a part of the AST
EXIT, ASTs are also enabled for the process again, and before the
process is resumed, a check is made if any ASTs have been queued. If
they have, the first one will be processed instead of the process
resuming at the normal context.
There are also system calls to enable and disable AST recognition. If it
is disabled, ASTs are queued up. (ENAR$ and DSAR$ in RSX.) This is
essentially the same state that you are in if you are currently
processing an AST.
> So, I was right when I remembered that system calls are not restarted
> (involuntarily), but I completely forgot about the hardware mechanism.
System calls are restarted. You noted as much yourself, when you
commented that the PC is backed up. That means that the system call will
be re-executed. How can you not have seen that?
> I'll have another look at this stuff on the weekend. VMS is not always
> obvious.
True. :-)
Johnny
>> RT-11 can, however, get away with some things that you cannot do in
>> systems where user mode and kernel mode are totally separate and
>> isolated from each other.
>
> RT-11/XM and RUST/XM are memory mapped PDP-11 systems where user mode
> and kernel mode are separate. I'm not sure what your point is.
My point was/is that RT-11 is a single user system, where protection and
isolation between user mode programs and the kernel is not an essential
part.
>> Assuming I'm right, I can see why a lot of discussion and confusion
>> comes up between us. The conditions in RT-11 are rather different than
>> other systems, meaning you can do stuff that is totally impossible in
>> other OSes.
>
> I think the confusion comes more because I use VMS examples and you
> use Unix examples. I know nothing about the Unix kernel and you don't
> seem have looked VMS a lot.
I don't think so. Although I must admit that I sometimes makes comment
about VMS based on my knowledge about RSX instead of looking up details.
Almost always it turns out that the knowledge is applicable, but
occasionally I totally mess up. I have used VMS a lot, but admittedly
much less so in the last 20 years.
It happens that I do the same thing with RT-11, based on my knowledge of
OS-8, which I have used a lot as well. But there, the similarities are
less accurate, so it's more dangerous to make the comparison. So I
mostly use it as a help to try figure out how to do things myself, and
where to start looking, instead of making assumptions about the internals.
> I don't think the techniques used in RUST or RT-11 are impossible in
> other OSes. In fact, I'm curious where the RT-11 techniques came from.
> The V2.0 team leader who implemented this stuff had previously worked
> on both RSTS and TOPS-something I think.
I really don't know much about the RT-11 history, apart from the basic
design being uncannily similar to OS/8. :-)
RSTS/E is rather messy and incapable in this respect (asynchronous
things in RSTS/E, you must be kidding... :-) ). TOPS-10 I know little
of. TOPS-20 I know a little more, but still far from enough.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-22 15:53 ` Johnny Billquist
@ 2012-02-22 16:48 ` paramucho
2012-02-22 21:17 ` Johnny Billquist
0 siblings, 1 reply; 222+ messages in thread
From: paramucho @ 2012-02-22 16:48 UTC (permalink / raw)
On Wed, 22 Feb 2012 16:53:33 +0100, Johnny Billquist <bqt@softjar.se>
wrote:
<snip>
>> In fact, there are only three "regular" VMS system calls which issue
>> "system waits": hibernate, wait-for-event-flag and wait-for-
>> event-group (or something like that). The entire system call is
>> nothing more than a "wait" (so partial completion does not occur).
>
>No. You are forgetting all the resource waits. These are the true
>"waiting in kernel until can continue" which is different than RSX.
>The hibernate and wait-for conditions exist just like in RSX. These are
>system calls that restarted whenever interrupted. They have just about
>no context, and thus can very easily be restarted automatically, which
>is what is done.
>
>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.
But it's not similar to what happens in RT-11 and RUST. Resource waits
(such as getting an I/O queue element) do not block asts. The code
example I had in the previous post was an example of that. It's quite
different to VMS.
And "once again", (1) the USR is the ACP, not the system, (2) it does
not block asts at all, (3) it doesn't wait for commands. The only
"blocks" it has are when it's performing directory operations, but
that's what an ACP does. Where else do you think it blocks?
And the other main case I didn't mention are page fault waits, but
these just repeat the page fault etc. That's logical.
>Like I said - the wait-for state, as well as the hibernating, are just
>like in RSX. Although it's not called hibernate in RSX. It's probably
>most equal to the BLOCKED state, although it could also be the STOPPED
>state. (Why RSX have both is fun. They have different effects for the
>purpose of swapping, but are otherwise equal, where STOPPED means the
>swapping priority drops to 0, so that it is very eligible to be swapped
>out, while BLOCKED retain the normal swap priority. There are system
>calls to do both.)
VMS has HIBER and SUSPEND.
<snip>
>You seem to have a very good grasp of RT-11, it seems to me.
It is burned into my brain...
<snip>
>> Ast delivery is (hardware) controlled by the REI instruction which
>> compares the mode of pending asts against the destination mode of the
>> REI. For example, user mode asts are note delivered when the REI
>> destination mode is kernel. Essentially, from what I can see, asts
>> just have to wait. So, effectively, VMS is just as bad as RSX in this
>> regard.
>
>Yes, VMS works like RSX. :-)
>Not sure what you mean by the REI comment. Maybe the code looks
>different in VMS than RSX here, but in RSX, an AST is delivered by the
>kernel pushing the AST dependent parameters along with some context on
>the user stack, and then exit the kernel (using the REI as usual for any
>kernel operation) to get back to user state. The new PC, however, is
>then the AST address. At that point, ASTs are blocked by a piece of
>information in the process structure saying that an AST is in progress.
>When your user program have finished the AST, it will do a new system
>call, the EXIT AST (ASTX$ in RSX) system call. This system call will
>pick up the context on the user stack, and will then resume by a REI
>back to user mode to continue where it was before the AST. The (old) PC
>is one of the things that were sitting on the user stack, being pushed
>there at AST entry, and popped by the AST EXIT. As a part of the AST
>EXIT, ASTs are also enabled for the process again, and before the
>process is resumed, a check is made if any ASTs have been queued. If
>they have, the first one will be processed instead of the process
>resuming at the normal context.
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.
o For kernel "piggyback" asts, it just calls them (without a frame
I think, just a jsb).
o For other kernel asts it's fairly straight forward.
o For non-kernel it has to setup a similar environment to that which
describe above. Ast exit is caught and sent back to kernel mode.
It's the same in RT and RUST.
In RT and RUST there's only one ast in progress. In VMS an inner mode
ast can interrupt an outer mode ast. That means that a kernel mode ast
can interrupt a user mode ast.
In general terms the process of delivering an ast and catching the ast
exit are the same in RT, RUST, RSX and VMS.
<snip>
>System calls are restarted. You noted as much yourself, when you
>commented that the PC is backed up. That means that the system call will
>be re-executed. How can you not have seen that?
Only for the three system calls I mentioned: $hiber, $waitxx. It's
actually just a subtraction of 4 back to the start of the change mode
instruction. No other system calls are restarted--that's what I saw.
There is no "restart system call" routine.
<snip>
>>> RT-11 can, however, get away with some things that you cannot do in
>>> systems where user mode and kernel mode are totally separate and
>>> isolated from each other.
>>
>> RT-11/XM and RUST/XM are memory mapped PDP-11 systems where user mode
>> and kernel mode are separate. I'm not sure what your point is.
>
>My point was/is that RT-11 is a single user system, where protection and
>isolation between user mode programs and the kernel is not an essential
>part.
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).
>>> Assuming I'm right, I can see why a lot of discussion and confusion
>>> comes up between us. The conditions in RT-11 are rather different than
>>> other systems, meaning you can do stuff that is totally impossible in
>>> other OSes.
>>
>> I think the confusion comes more because I use VMS examples and you
>> use Unix examples. I know nothing about the Unix kernel and you don't
>> seem have looked VMS a lot.
>
>I don't think so. Although I must admit that I sometimes makes comment
>about VMS based on my knowledge about RSX instead of looking up details.
>Almost always it turns out that the knowledge is applicable, but
>occasionally I totally mess up. I have used VMS a lot, but admittedly
>much less so in the last 20 years.
I try to avoid the microfiche reader 'cos it just takes so long to
find stuff. The index fiche is starting to get very blurry.
I spent a lot of time reading the fiches back in the 80s. I started
writing a VAX O/S once. I managed to boot it , but then my real life
took over... After I closed my software company I worked as a VMS
consultant for a while (until I got sucked into management), but I had
a little desktop VMS system at home for many years.
And this used to be my favorite reading (I found it here today):
http://bitsavers.org/pdf/dec/vax/vms/training/
EY-00014-DP_VMS_Internals_and_Data_Structures_1984.pdf
There are later versions there as well.
>It happens that I do the same thing with RT-11, based on my knowledge of
>OS-8, which I have used a lot as well. But there, the similarities are
>less accurate, so it's more dangerous to make the comparison. So I
>mostly use it as a help to try figure out how to do things myself, and
>where to start looking, instead of making assumptions about the internals.
>
>> I don't think the techniques used in RUST or RT-11 are impossible in
>> other OSes. In fact, I'm curious where the RT-11 techniques came from.
>> The V2.0 team leader who implemented this stuff had previously worked
>> on both RSTS and TOPS-something I think.
>
>I really don't know much about the RT-11 history, apart from the basic
>design being uncannily similar to OS/8. :-)
The first RT-11 developers were ex-OS8. The V1 RT-11 sources had
macros which mimicked PDP-8 code. The OS8 heritage has been both good
and bad.
>RSTS/E is rather messy and incapable in this respect (asynchronous
>things in RSTS/E, you must be kidding... :-) ). TOPS-10 I know little
>of. TOPS-20 I know a little more, but still far from enough.
:-)
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-22 16:48 ` paramucho
@ 2012-02-22 21:17 ` Johnny Billquist
2012-02-23 12:42 ` paramucho
0 siblings, 1 reply; 222+ messages in thread
From: Johnny Billquist @ 2012-02-22 21:17 UTC (permalink / raw)
On 2012-02-22 17.48, paramucho wrote:
> On Wed, 22 Feb 2012 16:53:33 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
> <snip>
>
>>> In fact, there are only three "regular" VMS system calls which issue
>>> "system waits": hibernate, wait-for-event-flag and wait-for-
>>> event-group (or something like that). The entire system call is
>>> nothing more than a "wait" (so partial completion does not occur).
>>
>> No. You are forgetting all the resource waits. These are the true
>> "waiting in kernel until can continue" which is different than RSX.
>> The hibernate and wait-for conditions exist just like in RSX. These are
>> system calls that restarted whenever interrupted. They have just about
>> no context, and thus can very easily be restarted automatically, which
>> is what is done.
>>
>> 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.
> But it's not similar to what happens in RT-11 and RUST. Resource waits
> (such as getting an I/O queue element) do not block asts. The code
> example I had in the previous post was an example of that. It's quite
> different to VMS.
Yeah. VMS works a lot like RSX (have I said that before?), except that
RSX don't have resource waits. Instead you always get back to the user
program in the similar situations, and then you have a "wait for
significant event" system call that you can use to wait for a suitable
time to try again. And of course, that system call is just like all the
others - it waits in a state that is not sitting in the kernel.
> And "once again", (1) the USR is the ACP, not the system, (2) it does
> not block asts at all, (3) it doesn't wait for commands. The only
> "blocks" it has are when it's performing directory operations, but
> that's what an ACP does. Where else do you think it blocks?
Really my mistake here. Of course calls to the USR don't block ASTs. I
knew that. I don't know what I was thinking.
While I don't totally agree with the comparison with an ACP, I guess it
is a fair comparison in some ways.
> And the other main case I didn't mention are page fault waits, but
> these just repeat the page fault etc. That's logical.
Yeah. Page faults are naturally blocky. Can't really help that.
>> Like I said - the wait-for state, as well as the hibernating, are just
>> like in RSX. Although it's not called hibernate in RSX. It's probably
>> most equal to the BLOCKED state, although it could also be the STOPPED
>> state. (Why RSX have both is fun. They have different effects for the
>> purpose of swapping, but are otherwise equal, where STOPPED means the
>> swapping priority drops to 0, so that it is very eligible to be swapped
>> out, while BLOCKED retain the normal swap priority. There are system
>> calls to do both.)
>
> VMS has HIBER and SUSPEND.
Ah. I had forgotten about SUSPEND. Guess that means VMS and RSX maps
pretty much 1:1.
>> 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?
>>> Ast delivery is (hardware) controlled by the REI instruction which
>>> compares the mode of pending asts against the destination mode of the
>>> REI. For example, user mode asts are note delivered when the REI
>>> destination mode is kernel. Essentially, from what I can see, asts
>>> just have to wait. So, effectively, VMS is just as bad as RSX in this
>>> regard.
>>
>> Yes, VMS works like RSX. :-)
>> Not sure what you mean by the REI comment. Maybe the code looks
>> different in VMS than RSX here, but in RSX, an AST is delivered by the
>> kernel pushing the AST dependent parameters along with some context on
>> the user stack, and then exit the kernel (using the REI as usual for any
>> kernel operation) to get back to user state. The new PC, however, is
>> then the AST address. At that point, ASTs are blocked by a piece of
>> information in the process structure saying that an AST is in progress.
>> When your user program have finished the AST, it will do a new system
>> call, the EXIT AST (ASTX$ in RSX) system call. This system call will
>> pick up the context on the user stack, and will then resume by a REI
>> back to user mode to continue where it was before the AST. The (old) PC
>> is one of the things that were sitting on the user stack, being pushed
>> there at AST entry, and popped by the AST EXIT. As a part of the AST
>> EXIT, ASTs are also enabled for the process again, and before the
>> process is resumed, a check is made if any ASTs have been queued. If
>> they have, the first one will be processed instead of the process
>> resuming at the normal context.
>
> 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.
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.)
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.
> In RT and RUST there's only one ast in progress. In VMS an inner mode
> ast can interrupt an outer mode ast. That means that a kernel mode ast
> can interrupt a user mode ast.
Yeah. Just saw that, which is nice.
> In general terms the process of delivering an ast and catching the ast
> exit are the same in RT, RUST, RSX and VMS.
I would expect so, yes.
>> System calls are restarted. You noted as much yourself, when you
>> commented that the PC is backed up. That means that the system call will
>> be re-executed. How can you not have seen that?
>
> Only for the three system calls I mentioned: $hiber, $waitxx. It's
> actually just a subtraction of 4 back to the start of the change mode
> instruction. No other system calls are restarted--that's what I saw.
> There is no "restart system call" routine.
Right. I don't think an explicit "restart system call" routine would
make any sense. Backing up the PC is the "restart system call".
Why make it any more complicated than that?
And other type of waits might not allow ASTs while waiting.
>>>> RT-11 can, however, get away with some things that you cannot do in
>>>> systems where user mode and kernel mode are totally separate and
>>>> isolated from each other.
>>>
>>> RT-11/XM and RUST/XM are memory mapped PDP-11 systems where user mode
>>> and kernel mode are separate. I'm not sure what your point is.
>>
>> My point was/is that RT-11 is a single user system, where protection and
>> isolation between user mode programs and the kernel is not an essential
>> part.
>
> 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.
>> I don't think so. Although I must admit that I sometimes makes comment
>> about VMS based on my knowledge about RSX instead of looking up details.
>> Almost always it turns out that the knowledge is applicable, but
>> occasionally I totally mess up. I have used VMS a lot, but admittedly
>> much less so in the last 20 years.
>
> I try to avoid the microfiche reader 'cos it just takes so long to
> find stuff. The index fiche is starting to get very blurry.
>
> I spent a lot of time reading the fiches back in the 80s. I started
> writing a VAX O/S once. I managed to boot it , but then my real life
> took over... After I closed my software company I worked as a VMS
> consultant for a while (until I got sucked into management), but I had
> a little desktop VMS system at home for many years.
>
> And this used to be my favorite reading (I found it here today):
>
> http://bitsavers.org/pdf/dec/vax/vms/training/
> EY-00014-DP_VMS_Internals_and_Data_Structures_1984.pdf
>
> There are later versions there as well.
I think I have that one as a hardcopy somewhere back in Sweden. Not with
me where I reside right now. :-(
>> It happens that I do the same thing with RT-11, based on my knowledge of
>> OS-8, which I have used a lot as well. But there, the similarities are
>> less accurate, so it's more dangerous to make the comparison. So I
>> mostly use it as a help to try figure out how to do things myself, and
>> where to start looking, instead of making assumptions about the internals.
>>
>>> I don't think the techniques used in RUST or RT-11 are impossible in
>>> other OSes. In fact, I'm curious where the RT-11 techniques came from.
>>> The V2.0 team leader who implemented this stuff had previously worked
>>> on both RSTS and TOPS-something I think.
>>
>> I really don't know much about the RT-11 history, apart from the basic
>> design being uncannily similar to OS/8. :-)
>
> The first RT-11 developers were ex-OS8. The V1 RT-11 sources had
> macros which mimicked PDP-8 code. The OS8 heritage has been both good
> and bad.
Like I said, I can sometimes really see similarities. But OS/8 is much
simpler in lots of ways.
OS/8 in combination with RTS-8 might be a bit like RT-11 FB, I think,
but I have not explored that much...
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
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
0 siblings, 2 replies; 222+ messages in thread
From: paramucho @ 2012-02-23 12:42 UTC (permalink / raw)
On Wed, 22 Feb 2012 22:17:23 +0100, Johnny Billquist <bqt@softjar.se>
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.
<snip>
>>> 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.
<snip>
>> 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
<snip>
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-23 12:42 ` paramucho
@ 2012-02-23 13:51 ` paramucho
2012-02-23 15:17 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: paramucho @ 2012-02-23 13:51 UTC (permalink / raw)
On Thu, 23 Feb 2012 12:42:09 GMT, paramucho@hotmail.com (paramucho)
wrote:
BTW: the following document:
http://bitsavers.org/pdf/dec/vax/vms/training/EY-0016E-ID-0001_VMS_Internals_Source_Listings_1982.pdf
has source listings of a lot of the stuff we've been talking about.
ASTDEL AST delivery etc
SYSPCNTRL Suspend/Resume, Hibernate/Wake
SYSWAIT Event flags
SCHED The scheduler
and other stuff.
I could have saved myself an hour with the microfiches if I'd seen
this file...
Ian
^ permalink raw reply [flat|nested] 222+ messages in thread
* Re: PDP11 Values from MFPT
2012-02-23 12:42 ` paramucho
2012-02-23 13:51 ` paramucho
@ 2012-02-23 15:17 ` Johnny Billquist
1 sibling, 0 replies; 222+ messages in thread
From: Johnny Billquist @ 2012-02-23 15:17 UTC (permalink / raw)
On 2012-02-23 13.42, paramucho wrote:
> On Wed, 22 Feb 2012 22:17:23 +0100, Johnny Billquist<bqt@softjar.se>
> 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.
Uh? How do you figure? An AST is local to that process. No other process
knows or cares. And neither does the OS, in any part except for doing
work for that process.
> 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)
Threads really don't buy you anything if you have a proper solution
already. Threads are a different way of solving that processes might
hang in system calls. Do it in separate threads instead. That way, it
becomes "ok" for things to hang in system calls. :-)
I've been thinking about writing a thread library for RSX, just for the
fun of it. Because of the way RSX works, you can do a full thread
implementation purely in user space.
Threads are useful in that it is easier to write programs in high level
languages using threads than asynchronous I/O. The problem is that they
need more memory, which is a problem on a PDP-11, and the reason I have
not really started writing anything.
(There is also the potential problem with some HLL that they might be
using a fixed event flag, making waits in several threads tricky to work
in practice.)
> 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.
True.
> 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.
I would expect it to be a part of the context, and thus be thread
specific. But I have not looked.
>>> 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...
The hardware AST on VAX is, I think, a required part of the architecture.
I'm trying to remember how the hardware AST differs from the software
controlled interrupt requests.
I should probably go back and check the processor handbook.
>> 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).
Thanks. Then it does work the way I thought.
Johnny
^ permalink raw reply [flat|nested] 222+ messages in thread
end of thread, other threads:[~2012-02-23 15:17 UTC | newest]
Thread overview: 222+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox