Hi,
Just a doubt...
#define MODULE 1
#define __KERNEL__ 1
What are those for? What do they do?
4/29/03 12:19:51 PM, Andi Kleen <ak@suse.de> wrote:
>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));
>}
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>
>
Rafael Costa dos Santos
ThinkFreak Comércio e Soluções em Hardware e Software
Rio de Janeiro / RJ / Brazil
rafael@thinkfreak.com.br
+ 55 21 9432-9266
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed Apr 30 2003 - 22:00:36 EST