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

.



Relevant Pages

  • Re: OT (slightly) What is the "best" processor for a new project?
    ... Early on, of course, you just mutter something under your breath and do a reset. ... Sometimes we have a timer interrupt do a reset, ... Truthfully, having worked with the FORTH, Inc. multitasker for over 30 years, in a very wide variety of applications, I have never encountered a situation that led us to consider a basic change in the algorithm. ... That includes "virtual" I/O, such as writing to a memory-mapped display. ...
    (comp.lang.forth)
  • Re: Bill Gates slow burns over control-alt-delete -- funny video
    ... only generates the standard "INT 1" interrupt. ... section of the boot sequence after the RAM and hardware detection tests ... than a minimum time, then the CPU is reset ... the system can't bypass the NMI ...
    (comp.os.linux.misc)
  • Re: dmesg: PCI interrupts are no longer routed automatically.........
    ... the ISR reads all the INTCSR ... If the PLX had been reset, then the INTCSR bits would all ... available before the chip could generate an interrupt. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: R: hc12,can i return from interrupt and jump elsewhere?
    ... then you can use a watchdog reset. ... reception of an interrupt event, ... .I'm trying to implement an USB protocol using a 9s12 microcontroller,that i ... It is raccomended that anytime an USB device receives a bus reset it has to ...
    (comp.arch.embedded)
  • Re: Universal grammar
    ... Paul> This is a software engineers vocabulary. ... Paul> reset and other h/w interrupts. ... Paul> between how a CPU reacts to signals on various interrupt ... Paul> hardware device interrupts cause the CPU interrupt whatever ...
    (sci.lang)