Path: utzoo!attcan!uunet!munnari.oz.au!cluster!metro!natmlab.dap.csiro.au!ditsyda!evans From: evans@ditsyda.oz (Bruce Evans) Newsgroups: comp.os.minix Subject: Re: Protected Mode Entry/Exit Keywords: Protected Mode Message-ID: <2558@ditsyda.oz> Date: 8 Mar 90 13:30:39 GMT References: <726@blenheim.nsc.com> Reply-To: evans@ditsyda.oz (Bruce Evans) Organization: CSIRO DIT Sydney, Australia Lines: 45 In article <726@blenheim.nsc.com> des@dtg.nsc.com (Desmond Young) writes: > How does Minix exit protected mode ? By resetting or turning off the processor. > Does it ever need to ? Only to reboot. >[How to reset on ATs using the keyboard controller.] > Since this can be slow..... (reset time non-trivial), there must > be a better way. Is this a closely guarded secret at Microsoft? I don't think so (on a 286). On a 386, it is easy. I used it a lot while developing the Minix protected mode kernel, running users in protected mode and the system in real mode. > The only way I can think of is to cause a multiple MMU fault. A documented way is to load the interrupt descriptor table with a bad value, the cause an interrupt. The processor "shuts down". I don't know if this means that it resets. I must have shut it down many times while debugging, and it always seemed to reset. > In case you are wondering why these questions. If you have an > "XT" machine with a 286 processor, you do not have a keyboard > to give you a reset, and you do not have a CMOS RAM to store a > flag. So, the questions are to determine whether you may run > Minix in protected mode on a 286-based non-AT machine. Do you have such a strange machine, and volunteer to make rebooting work? :-) In practice the reset button is a good way to reboot. I have had strange results rebooting an AT in real mode. My debugger catches an illegal opcode at 0xFFFF:0xFFF0. This is the usual reset vector, and examination shows the instruction there is the nornal, legal jump. Jumping to this location (which is what the kernel does if the keyboard controller doesn't reset) works fine. The debugger doesn't work in protected mode (on a 286) and the reboot looks normal. Maybe it causes a pile of exceptions and the processor shuts down? Everything works as I expect in all modes on a 386. -- Bruce Evans evans@ditsyda.oz.au