Re: rebooting

Linus Torvalds (torvalds@cs.helsinki.fi)
Tue, 1 Oct 1996 09:54:49 +0300 (EET DST)


On Mon, 30 Sep 1996, Albert Cahalan wrote:
>
> >> 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.

Note that Linux already does something that is equivalent to this, after
having tried the keyboard controller a few times (more like a hundred, if
I remember correctly). Anyway, if the keyboard controller doesn't do
anything to the kernel, the kernel will do something like this (from
memory, I'm too lazy to check):

lidt(null_idt);

which essentially zeroes out the exception table information. The next
interrupt that comes in will result in a triple fault, and shutdown. And on
most PC chips (all that I've seen) the shutdown line will lead to a reset..

But try out 2.1.0 first: that does a cold reset with the keyboard
controller as default, and it may turn out to work for you. If it
doesn't, you can test the alternative method by just ifdef'ing out the
keyboard controller reset code.

Linus