Re: How to reboot a computer immediately by programming?
- From: "Rod Pemberton" <spamtrap@xxxxxxxxxx>
- Date: Wed, 27 Sep 2006 02:45:20 -0400
----- Original Message -----
From: "Robert Redelmeier" <redelm@xxxxxxxxxxxxxxx>
Newsgroups: comp.lang.asm.x86
Sent: Tuesday, September 26, 2006 6:54 PM
Subject: Re: How to reboot a computer immediately by programming?
"Robert Redelmeier" <redelm@xxxxxxxxxxxxxxx> wrote in message
news:qciSg.5339$GR.5073@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Rod Pemberton <spamtrap@xxxxxxxxxx> wrote in part:null
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
(i.e.,selector(s) using the lidt instruction. And, then call an interrupt
into instruction). (This is the only true "correct" method.)
This is a variation of a "triple fault", and only resets the
processor.
Yes, history:
http://blogs.msdn.com/larryosterman/archive/2005/02/08/369243.aspx
No change to memory or devices.
Maybe. The lidt restarts the CPU in RM at FFFF:0000h, i.e. BIOS reset. The
memory location 40:72h and CMOS location 0fh determine what type of reset is
performed: cold, warm, exit PM, a number of return from virtual modes
including one which jumps to the address in 40:67h, and motherboard
manufacturer specific test modes. If a cold or warm boot is selected, the
memory and devices the BIOS and CPU normally reset should be properly reset.
the2) IBM method: (RM or PM but not Ring 3) Output FEh to port 64h using
to'out' instruction, thereby forcing 8042 compatible keyboard controllers
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.
What you're indicating is that the CPU reset and BIOS reset don't
necessarily reset all hardware... I'm not sure how the reset is actually
wired in the PC, but that seems to be different from my experiences. Since
I don't have schematics for this and haven't needed to look at them until
now, I can't comment further.
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.
True.
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?
Rod Pemberton
.
- References:
- How to reboot a computer immediately by programming?
- From: Lighter
- Re: How to reboot a computer immediately by programming?
- From: Rod Pemberton
- Re: How to reboot a computer immediately by programming?
- From: Robert Redelmeier
- How to reboot a computer immediately by programming?
- Prev by Date: Re: How to reboot a computer immediately by programming?
- Next by Date: Having trouble posting?
- Previous by thread: Re: How to reboot a computer immediately by programming?
- Next by thread: Re: How to reboot a computer immediately by programming?
- Index(es):