Path: utzoo!attcan!uunet!ccicpg!turnkey!conexch!rob From: rob@conexch.UUCP (Robert Collins) Newsgroups: comp.sys.intel Subject: Re: Returning the 80286 to Real Mode Message-ID: <12365@conexch.UUCP> Date: 11 Nov 88 08:12:15 GMT References: <1081@xenon.idec.stc.co.uk> <11367@conexch.UUCP> <3493@pt.cs.cmu.edu> Reply-To: rob@conexch.UUCP (Robert Collins) Organization: The Consultants' Exchange, Orange County, CA. (714) 842-6348 Lines: 59 In article <3493@pt.cs.cmu.edu> ralf@b.gp.cs.cmu.edu (Ralf Brown) writes: +(someone from Intel will no doubt correct any errors in the following) + +In article <11367@conexch.UUCP> rob@conexch.UUCP (Robert Collins) writes: +}If memory serves me correctly, IBM states that the processor shutdown +}will typically take 60ms to take place. One the processor shuts down, + +More like 600 microseconds. If it were 60ms, VDISK could only service 16 +requests per second, for a maximum possible throughput of 64K/s (8 512-byte +sectors). + Thank you, as I said...if memory serves me correctly. You are very much right about the 600 microseconds. But, I might point out that 600uS is the time for the keyboard controller to respond to the command. But, I suppose the time to actually shut down the processor is negligable. We found, that the ACTUAL time to perform the shutdown was closer to 1mS (as opposed to 600uS). +}So, the bottom line is this: Kludge #3 takes ~60ms. Kludge #4 takes +}another few ms. In other words, it's SLOW! There is another MUCH +}more elegant way to cause a processor shutdown without using the +}keyboard controller. In fact, it takes ~1ms (or less). This method +}involves telling the processor you will service NO interrupts, (lidt to +}a idt w/ 0 entries), then generate an interrupt. Since the processor +}can't service the interrupt, it generates an exception. The exception +}also can't be service (since you hosed IDT), which will in turn will +}reset the processor. The former method is rather well documented in + +The processor is only reset by an external signal. What happens is that +the triple exception generated by the above puts the processor in SHUTDOWN +mode. The PC/AT contains external circuitry to assert the reset line when +the processor goes into SHUTDOWN. Since the processor is reset, you still +need kludges #1, 2, and 4 (magic CMOS byte, return address, FAR jump in +BIOS). + Sorry if I said "reset" I meant shutdown. Though, I'll admit, I didn't know (nor know of the) difference between the two. And sorry if I implied the other kludges weren't necesary. They most certainly are necesary, but using the keyboard controller isn't! >}executing a 386 instruction on the 286 will cause the desired exception. >It generates an "undefined opcode" exception. And that's the whole key. Generating the "invalid opcode" exception will lead to a processor shutdown. Which switches back to real mode, and starts execution back at 0f000:0fff0. When we did the timing tests, we found that this method was about 88% faster than using the keyboard controller...the time was closer to 400uS from the time the invalid ipcode was executed to the time control was returned to the original program. -- "Worship the Lord your God, and serve him only." Mat. 4:10 Robert Collins UUCP: ucbvax!ucivax!icnvax!conexch!rob HOMENET: (714) 995-7344 UUCP: uunet!ccicpg!turnkey!conexch!rob WORKNET: (714) 229-0284