On Mon, Dec 11, 2000 at 05:48:51PM -0600, Eric Seppanen wrote:
> > On Mon, 11 Dec 2000, Eric Seppanen wrote:
> > 
> > > And wouldn't access to reboot from /proc mean that the system would
> > > shutdown prematurely?  Since init will call the reboot syscall when
> > > it's time to reboot, why would you want to add an alternate mechanism?
> > 
> > actually, it's useful. It's pretty much a nicer version of the "Magic
> > SysReq key". If you're running ext3 then an instantaneous reboot is kind
> > of handy, and you're not going to be hurt by doing it. 
> 
> OK, knock yourself out :)

Oh yeah, if anyone wants to live dangerously and find out if their Intel
PIIX4(E) southbridge can reset the machine, feel free to try this out.  It
will try to toggle the reset register from userspace.

#include <sys/io.h>
#include <stdio.h>

const unsigned short PIIX4_RESET_REGISTER=0xCF9;

int main()
{
        if (iopl(3) < 0) {
                perror("iopl");
                return 1;
        }
        outb_p(2, PIIX4_RESET_REGISTER);
        outb_p(6, PIIX4_RESET_REGISTER);
        return 0;
}

Reply via email to