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.74.201 with SMTP id w9mr2583981pbv.0.1328379784090; Sat, 04 Feb 2012 10:23:04 -0800 (PST) Path: lh20ni260335pbb.0!nntp.google.com!news1.google.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: paramucho@hotmail.com (paramucho) Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Sat, 04 Feb 2012 18:22:58 GMT Organization: Aioe.org NNTP Server Message-ID: <4f2e76d1.2957482@nntp.aioe.org> References: <4f175c07.15409279@nntp.aioe.org> <4f20c6e3$0$284$14726298@news.sunsite.dk> <4f215614.266356@nntp.aioe.org> <4f24a237$0$295$14726298@news.sunsite.dk> <4f2537ed.51306295@nntp.aioe.org> <4f28b73b$0$290$14726298@news.sunsite.dk> <4f291473.18988613@nntp.aioe.org> <4f2a3a1e.28631752@nntp.aioe.org> <4f2a8c5a.52418379@nntp.aioe.org> <4f2e5f77.65538828@nntp.aioe.org> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: CmgvwL3sOlojnxUjt8znzA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 1.5/32.451 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 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