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 d10mr12599548pbw.6.1326866640106; Tue, 17 Jan 2012 22:04:00 -0800 (PST) Path: lh20ni194947pbb.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: Wed, 18 Jan 2012 06:03:56 GMT Organization: Aioe.org NNTP Server Message-ID: <4f175c07.15409279@nntp.aioe.org> References: <4f12e49d$0$295$14726298@news.sunsite.dk> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: yPe0Vz9rK3epnEf2vEo6yg.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 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. 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$ ; br 20$ ; ; 10$: mov #340,(r0) ; SR0 = 340 cmpb (r0),#140 ; E11 magic number bne 30$ ; not E11 btwar$ ; (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