🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #556

Re: Reboot from protected mode

#556
From: Jan-Pieter Cornet
Date: Thu, 30 Jul 1992 11:59
42 lines
2401 bytes
billp@jupiter.cse.utoledo.edu (bill parquet) writes:

>sankey@unixg.ubc.ca (Todd Sankey) writes:
>:  Does anyone have a description or code snippet or anything to
>: describe how to reboot the PC from protected mode?

>Rebooting and kicking the computer out of protected mode are pretty similar.

>To reboot just do:  mov   al,0feh
>		    out   64h, al

>(It seems to be 100% effective on my 286, but it sometimes causes my 486
>to crash). 

Please don't use this kind of reboot. This is known to crash lots and lots
of brands of computers, because the keyboard chip can easily get confused,
resulting in a complete keyboard hang, which remarkably looks like a crash
(sometimes it won't even reset the CPU, sometimes it will, I don't know
exactly what is going on here).

To get out of protected mode on a 386+, simply use the instruction devoted
to that operation, I can't remember it exactly, I thought you could simply
clear MSW bit 0, but you might have to clear CR0 bit 0 too.

On a 286, the fastest way to get out of protected mode is to cause a triple
fault resulting in a shutdown, which (non-buggy ;) external circuitry
converts to a reset almost immediately (the keyboard chip takes quite a
while to perform the reset, that's why the HLT; JMP loop is there, and
that's why this method is faster).

You can cause a triple fault by lowering the IDT limit to 0, and cause
an exception, for example by doing MOV AX,[FFFF].

Of course the last strategy also works on 386+ machines, albeit slower
than the "dedicated" protected mode return on these chips (oh, I forgot,
you also have to put the real mode return adres at 000467, and put
some CMOS word to something, I forgot which exactly. Sorry I can't be
more precise at the moment...)

-- 
-- Jan-Pieter
cornet@duteca.et.tudelft.nl
Technical Details
Message-ID: <1992Jul30.115954.12123@donau.et.tudelft.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!dutrun!donau!zen.et.tudelft.nl!cornet
References: <sankey.711008151@unixg.ubc.ca> <1992Jul29.221323.9051@uoft02.utoledo.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!dutrun!donau!zen.et.tudelft.nl!cornet
From: cornet@zen.et.tudelft.nl (Jan-Pieter Cornet)
Subject: Re: Reboot from protected mode
Message-ID: <1992Jul30.115954.12123@donau.et.tudelft.nl>
Sender: news@donau.et.tudelft.nl (UseNet News System)
Nntp-Posting-Host: zen.et.tudelft.nl
Organization: Delft University of Technology, Dept. of Electrical Engineering
References: <sankey.711008151@unixg.ubc.ca> <1992Jul29.221323.9051@uoft02.utoledo.edu>
Date: Thu, 30 Jul 1992 11:59:54 GMT
Lines: 42