From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: ffc31,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidf4c4f7386e,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.75.170 with SMTP id d10mr13328057pbw.6.1326885629668; Wed, 18 Jan 2012 03:20:29 -0800 (PST) Path: lh20ni195768pbb.0!nntp.google.com!news2.google.com!eweka.nl!feeder.eweka.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.stack.nl!newsfeed.Update.UU.SE!news.Update.UU.SE!not-for-mail From: Johnny Billquist Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Wed, 18 Jan 2012 12:20:28 +0100 Organization: Update Computer Club Message-ID: References: <4f12e49d$0$295$14726298@news.sunsite.dk> NNTP-Posting-Host: 178-83-31-172.dynamic.hispeed.ch Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1326885629 30511 178.83.31.172 (18 Jan 2012 11:20:29 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Wed, 18 Jan 2012 11:20:29 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <4f12e49d$0$295$14726298@news.sunsite.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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