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 d10mr14216810pbw.6.1326910345551; Wed, 18 Jan 2012 10:12:25 -0800 (PST) Path: lh20ni196842pbb.0!nntp.google.com!news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!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 19:12:24 +0100 Organization: Update Computer Club Message-ID: References: <4f12e49d$0$295$14726298@news.sunsite.dk> <4f175c07.15409279@nntp.aioe.org> <4f16e707.10168332@nntp.aioe.org> NNTP-Posting-Host: 178-83-31-172.dynamic.hispeed.ch Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1326910345 11630 178.83.31.172 (18 Jan 2012 18:12:25 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Wed, 18 Jan 2012 18:12:25 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: <4f16e707.10168332@nntp.aioe.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-01-18 17:02, paramucho wrote: > On Wed, 18 Jan 2012 12:28:28 +0100, Johnny Billquist > wrote: > > >>> 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