Re: rebooting

Albert Cahalan (
Mon, 30 Sep 1996 19:20:12 -0400 (EDT)

>> xor %esp,%esp
>> inc %esp
>> push %esp
>> That works on every x86 machine we've tested it on, including his with
>> the wacko keyboard controller, it's about as non-portable as it gets
>> though, so I doubt its suitable for the actual kernel, you should try it
>> in your machine, tho.
> Actually, this should work fine on any x86 machine - I guess this will
> cause the processor to enter shutdown mode (stack fault trying to run
> on an invalid stack), which on any machine I have come across causes
> reboot. Of course on a machine that was designed properly it would drop
> you into a rom monitor, like on a Sun or a Dec, but we are talking PCs
> here after all....
> Currently this works because we don't use a separate task for handling
> stack exceptions (by using a separate task it is possible to have a
> stack kept aside for the exception handler). This approach will fail
> if this changes.

The exception handler can detect the situation I think. Then it just
sets things up right and repeats the procedure. Alternately, disable
the exception handler first.

> Note that this causes a cold rather than warm reboot, so we don't
> ususally want to do this, but it could be useful to attempt to do
> a warm boot, and if we are still running say 1 second later try this
> approach.
> Does this sound reasonable?