home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / msdos / programm / 8174 < prev    next >
Encoding:
Text File  |  1992-07-30  |  2.3 KB  |  55 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!mcsun!sun4nl!dutrun!donau!zen.et.tudelft.nl!cornet
  3. From: cornet@zen.et.tudelft.nl (Jan-Pieter Cornet)
  4. Subject: Re: Reboot from protected mode
  5. Message-ID: <1992Jul30.115954.12123@donau.et.tudelft.nl>
  6. Sender: news@donau.et.tudelft.nl (UseNet News System)
  7. Nntp-Posting-Host: zen.et.tudelft.nl
  8. Organization: Delft University of Technology, Dept. of Electrical Engineering
  9. References: <sankey.711008151@unixg.ubc.ca> <1992Jul29.221323.9051@uoft02.utoledo.edu>
  10. Date: Thu, 30 Jul 1992 11:59:54 GMT
  11. Lines: 42
  12.  
  13. billp@jupiter.cse.utoledo.edu (bill parquet) writes:
  14.  
  15. >sankey@unixg.ubc.ca (Todd Sankey) writes:
  16. >:  Does anyone have a description or code snippet or anything to
  17. >: describe how to reboot the PC from protected mode?
  18.  
  19. >Rebooting and kicking the computer out of protected mode are pretty similar.
  20.  
  21. >To reboot just do:  mov   al,0feh
  22. >            out   64h, al
  23.  
  24. >(It seems to be 100% effective on my 286, but it sometimes causes my 486
  25. >to crash). 
  26.  
  27. Please don't use this kind of reboot. This is known to crash lots and lots
  28. of brands of computers, because the keyboard chip can easily get confused,
  29. resulting in a complete keyboard hang, which remarkably looks like a crash
  30. (sometimes it won't even reset the CPU, sometimes it will, I don't know
  31. exactly what is going on here).
  32.  
  33. To get out of protected mode on a 386+, simply use the instruction devoted
  34. to that operation, I can't remember it exactly, I thought you could simply
  35. clear MSW bit 0, but you might have to clear CR0 bit 0 too.
  36.  
  37. On a 286, the fastest way to get out of protected mode is to cause a triple
  38. fault resulting in a shutdown, which (non-buggy ;) external circuitry
  39. converts to a reset almost immediately (the keyboard chip takes quite a
  40. while to perform the reset, that's why the HLT; JMP loop is there, and
  41. that's why this method is faster).
  42.  
  43. You can cause a triple fault by lowering the IDT limit to 0, and cause
  44. an exception, for example by doing MOV AX,[FFFF].
  45.  
  46. Of course the last strategy also works on 386+ machines, albeit slower
  47. than the "dedicated" protected mode return on these chips (oh, I forgot,
  48. you also have to put the real mode return adres at 000467, and put
  49. some CMOS word to something, I forgot which exactly. Sorry I can't be
  50. more precise at the moment...)
  51.  
  52. -- 
  53. -- Jan-Pieter
  54. cornet@duteca.et.tudelft.nl
  55.