Re: How to reboot a computer immediately by programming?



Rod Pemberton <spamtrap@xxxxxxxxxx> wrote in part:
Basically, correct. By "user mode" you mean privilege level
3 (i.e., Ring 3). By "kernel mode" you mean privilege
level 0 (i.e. Ring 0). In privilege 3, you can't (well,
aren't supposed to be able to anyway) reset the computer
via software at all. I'm unsure about Ring 1 & 2...

With `ioperm()` [Linux & perhaps *BSD], you can get [root]
permissions to write to ports -- like 0FEh to 64h.

I'm listing the ones I know. I'm interested in any other methods both
legitimate and "cpu bugs" or hacks for any generation of CPU...


1) Intel 286 method: (RM or PM but not Ring 3) Initialize the idt with null
selector(s) using the lidt instruction. And, then call an interrupt (i.e.,
into instruction). (This is the only true "correct" method.)

This is a variation of a "triple fault", and only resets the
processor. No change to memory or devices.

2) IBM method: (RM or PM but not Ring 3) Output FEh to port 64h using the
'out' instruction, thereby forcing 8042 compatible keyboard controllers to
reset the PC. (This is the original method used IBM on the PC.)

This is probably closest to pressing the reset button.
The reset signal should go throughout the system.

3) BIOS method (RM), far call to FFFF:0000h. This may
require setting values at 0472h and/or CMOS 0fh. See Ralph
Brown's Interrupt list for more information.

Again, a soft reset that only works if the BIOS hasn't been remapped.
What BIOS does depends on its' programming.

4) Int 0x19 (RM), this interrupt is supposed to restart the
BIOS bootstrap loader, but it usually doesn't work because
it has been revectored by the OS or other reasons.

Ditto

5) Int 0x18 (RM), obsolete interrupt. Some BIOS' will
reset the computer via a call to this interrupt.

Ditto?

-- Robert

.