From: paramucho@hotmail.com (paramucho)
Subject: Re: PDP11 Values from MFPT
Date: Sat, 11 Feb 2012 13:15:52 GMT [thread overview]
Message-ID: <4f396a03.27713593@nntp.aioe.org> (raw)
In-Reply-To: jh3r6k$a1s$1@Iltempo.Update.UU.SE
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
next prev parent reply other threads:[~2012-02-11 13:16 UTC|newest]
Thread overview: 222+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-15 14:37 PDP11 Values from MFPT Jerome H. Fine
2012-01-18 6:03 ` paramucho
2012-01-18 11:28 ` Johnny Billquist
2012-01-18 13:05 ` glen herrmannsfeldt
2012-01-18 13:26 ` Johnny Billquist
2012-01-26 3:24 ` Jerome H. Fine
2012-01-26 13:38 ` Johnny Billquist
2012-01-29 1:32 ` Jerome H. Fine
2012-01-29 1:43 ` Johnny Billquist
2012-01-26 3:23 ` Jerome H. Fine
2012-01-18 16:02 ` paramucho
2012-01-18 18:12 ` Johnny Billquist
2012-01-19 14:30 ` paramucho
2012-01-19 16:42 ` Johnny Billquist
2012-01-19 20:32 ` glen herrmannsfeldt
2012-01-20 13:32 ` paramucho
2012-01-20 13:29 ` paramucho
2012-01-20 16:48 ` Johnny Billquist
2012-01-21 12:25 ` paramucho
2012-01-21 20:15 ` Johnny Billquist
2012-01-26 3:25 ` Jerome H. Fine
2012-01-26 6:09 ` paramucho
2012-01-26 6:30 ` paramucho
2012-01-26 13:50 ` Johnny Billquist
2012-01-29 1:52 ` Jerome H. Fine
2012-01-29 2:08 ` Johnny Billquist
2012-01-26 13:48 ` Johnny Billquist
2012-01-26 13:46 ` Johnny Billquist
2012-01-29 1:35 ` Jerome H. Fine
2012-01-18 12:41 ` glen herrmannsfeldt
2012-01-18 13:18 ` Johnny Billquist
2012-01-18 14:28 ` glen herrmannsfeldt
2012-01-18 15:14 ` Johnny Billquist
2012-01-18 21:54 ` glen herrmannsfeldt
2012-01-18 22:32 ` Al Kossow
2012-01-19 0:22 ` Johnny Billquist
2012-01-19 1:30 ` glen herrmannsfeldt
2012-01-19 14:32 ` Bob Koehler
2012-01-19 16:45 ` Johnny Billquist
2012-01-20 17:55 ` Bob Koehler
2012-01-20 18:38 ` Bill Gunshannon
2012-01-18 16:25 ` paramucho
2012-01-18 18:00 ` Johnny Billquist
2012-01-19 14:25 ` paramucho
2012-01-19 16:50 ` Johnny Billquist
2012-01-20 13:32 ` paramucho
2012-01-20 16:54 ` Johnny Billquist
2012-01-21 13:16 ` paramucho
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 [this message]
2012-02-11 21:09 ` Johnny Billquist
2012-02-12 17:23 ` paramucho
2012-02-12 18:35 ` paramucho
2012-02-13 17:30 ` paramucho
2012-02-14 13:14 ` Johnny Billquist
2012-02-14 16:20 ` paramucho
2012-02-14 17:30 ` Johnny Billquist
2012-02-13 23:18 ` Johnny Billquist
2012-02-14 16:20 ` paramucho
2012-02-14 17:47 ` Johnny Billquist
2012-02-14 18:17 ` paramucho
2012-02-14 19:54 ` Johnny Billquist
2012-02-15 12:58 ` paramucho
2012-02-15 17:12 ` Johnny Billquist
2012-02-16 13:54 ` paramucho
2012-02-16 20:15 ` Johnny Billquist
2012-02-17 12:41 ` paramucho
2012-02-17 17:13 ` Johnny Billquist
2012-02-18 11:24 ` Johnny Billquist
2012-02-18 14:28 ` paramucho
2012-02-18 20:07 ` Johnny Billquist
2012-02-18 11:55 ` paramucho
2012-02-18 20:58 ` Johnny Billquist
2012-02-20 2:29 ` Jerome H. Fine
2012-02-20 5:54 ` paramucho
2012-02-20 17:14 ` Jerome H. Fine
2012-02-20 18:05 ` Johnny Billquist
2012-02-21 6:16 ` paramucho
2012-02-21 17:38 ` Jerome H. Fine
2012-02-21 19:31 ` Johnny Billquist
2012-02-20 5:53 ` paramucho
2012-02-20 10:28 ` Johnny Billquist
2012-02-21 3:33 ` Jerome H. Fine
2012-02-21 6:17 ` paramucho
2012-02-21 10:23 ` Johnny Billquist
2012-02-21 11:37 ` paramucho
2012-02-21 14:16 ` Johnny Billquist
2012-02-21 16:42 ` paramucho
2012-02-21 19:43 ` Johnny Billquist
2012-02-22 12:21 ` paramucho
2012-02-22 14:12 ` paramucho
2012-02-22 15:26 ` Johnny Billquist
2012-02-22 14:33 ` paramucho
2012-02-22 15:53 ` Johnny Billquist
2012-02-22 16:48 ` paramucho
2012-02-22 21:17 ` Johnny Billquist
2012-02-23 12:42 ` paramucho
2012-02-23 13:51 ` paramucho
2012-02-23 15:17 ` Johnny Billquist
2012-02-20 2:22 ` Jerome H. Fine
2012-02-20 6:07 ` paramucho
2012-02-21 3:29 ` Jerome H. Fine
2012-02-21 8:06 ` paramucho
2012-02-21 10:38 ` Johnny Billquist
2012-02-21 11:54 ` paramucho
2012-02-21 14:20 ` Johnny Billquist
2012-02-21 15:13 ` paramucho
2012-02-21 15:20 ` Johnny Billquist
2012-02-22 2:51 ` Jerome H. Fine
2012-02-22 6:37 ` paramucho
2012-01-18 11:20 ` Johnny Billquist
2012-01-26 3:21 ` Jerome H. Fine
2012-01-26 14:12 ` Johnny Billquist
2012-01-26 15:26 ` paramucho
2012-01-29 1:41 ` Jerome H. Fine
2012-01-29 2:04 ` Johnny Billquist
2012-01-29 2:31 ` Johnny Billquist
2012-01-29 1:39 ` Jerome H. Fine
2012-01-29 1:45 ` Johnny Billquist
2012-01-30 2:21 ` Bob Supnik
2012-01-31 7:14 ` paramucho
2012-01-31 9:42 ` Johnny Billquist
2012-01-31 14:24 ` Bill Gunshannon
2012-01-31 20:17 ` Johnny Billquist
2012-01-31 21:39 ` Bill Gunshannon
2012-01-31 23:43 ` glen herrmannsfeldt
2012-02-01 3:56 ` Jerome H. Fine
2012-02-01 11:53 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
2012-02-02 0:20 ` Johnny Billquist
2012-02-02 2:22 ` Jerome H. Fine
2012-02-01 12:14 ` Johnny Billquist
2012-02-01 16:27 ` glen herrmannsfeldt
2012-02-01 5:28 ` Charles Richmond
2012-02-01 11:54 ` Johnny Billquist
2012-02-01 3:55 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
2012-02-01 12:03 ` Johnny Billquist
2012-02-01 3:54 ` Jerome H. Fine
2012-02-01 12:09 ` Johnny Billquist
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox