mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: joe briggs <jbriggs@briggsmedia.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: software reset
Date: 29 Apr 2003 17:19:51 +0200	[thread overview]
Message-ID: <p73vfwx2uw8.fsf@oldwotan.suse.de> (raw)
In-Reply-To: <200304291037.13598.jbriggs@briggsmedia.com.suse.lists.linux.kernel>

joe briggs <jbriggs@briggsmedia.com> writes:

> Can anyone tell me how to absolutely force a reset on a i386?  Specifically, 
> is there a system call that will call the assembly instruction to assert the 
> RESET bus line? I try to use the "reboot(LINUX_REBOOT_CMD_RESTART,0,0,NULL)" 
> call, but it will not always work.  Occassionally, I experience a "missed 
> interrupt" on a Promise IDE controller, and while I can telnet into the 
> system, I can't reset it.  Any help greatly appreciated!  Since these systems 
> are 1000's of miles away, the need to remotely reset it paramont.

The most reliable way is to force a triple fault; load zero into
the IDT register and then trigger an exception. The linux kernel 
does that in fact for reboot and so far I haven't seen any machine failing
to reset yet.

-Andi

If you don't trust reboot you can use something like (untested!).
Compile with -c and load with insmod. I'm pretty sure it will reset
your box.

#define MODULE 1
#define __KERNEL__ 1
#include <linux/module.h>

int init_module(void)
{ 
        static struct { 
                short limit;
                unsigned ptr;
        } desc = { 64000, 0 }; 

        asm volatile("lidt %0" : "m" (desc)); 
        asm volatile("movl %0,%%esp ; int $3" : "g" (0)); 
} 


       reply	other threads:[~2003-04-29 15:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200304291037.13598.jbriggs@briggsmedia.com.suse.lists.linux.kernel>
2003-04-29 15:19 ` Andi Kleen [this message]
2003-04-30  7:50   ` Jamie Lokier
2003-04-30 11:04     ` Eric W. Biederman
2003-04-30 16:15       ` Gabriel Paubert
2003-04-30 17:02         ` Eric W. Biederman
2003-04-30 17:19           ` Gabriel Paubert
2003-04-30 19:31           ` Jamie Lokier
2003-04-30 23:00   ` Rafael Santos
2003-04-30 23:14     ` Andi Kleen
2003-04-30 23:20   ` H. Peter Anvin
2003-05-07  6:55 Perez-Gonzalez, Inaky
  -- strict thread matches above, loose matches on Subject: below --
2003-04-29 14:37 joe briggs
2003-04-30 23:12 ` James Stevenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p73vfwx2uw8.fsf@oldwotan.suse.de \
    --to=ak@suse.de \
    --cc=jbriggs@briggsmedia.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®