Page 1 of 1

System reset using triple fault

Posted: Sun Feb 03, 2008 3:32 pm
by Cemre
Hello,

Upto now, ( and still ) I am using triple-fault as a system reset mechanism. When the user wants to reset the system, after making necessary OS stopping, I set-up an idt with limit zero and issue a software interrupt, the CPU triple faults and system automatically resets.

Questions are:
1) is this method good? is it guaranteed to reset the system on all types of systems?

2) I have started programming multiple cpu ( SMP ) lately ( using bochs, I have no real hardware yet ). What happens to other cpus when one of the cpu triple-faults? do they continue executing?

Best regards.

Posted: Sun Feb 03, 2008 3:55 pm
by lukem95
why dont you just use

Code: Select all

outb (0x64, 0xFE);
or (in ASM)

Code: Select all

outb 0x64, 0xFE
and change when you want to port the OS?

Posted: Mon Feb 04, 2008 6:08 pm
by Jef
I wondering too, but i didn't put yet the option to restart my OS, so i never search for.
But, while we talking about it, thanks for the answer,...
and can you tell us how to make a shutdown? (i mean to turn off by software the pc)

Posted: Mon Feb 04, 2008 8:43 pm
by piranha
and can you tell us how to make a shutdown? (i mean to turn off by software the pc)
You need ACPI.

-JL

Re: System reset using triple fault

Posted: Tue Feb 05, 2008 3:59 am
by mathematician
Cemre wrote:Questions are:
1) is this method good? is it guaranteed to reset the system on all types of systems?
Whether or not it is good, it was the method used in the early days of protected mode operating systems, because the 286 couldn't otherwise be switched out of protected mode once in it. (The BIOS was equipped with code, which is probably still there, which allowed a jump to the instruction immediately after the one which caused the reset. Then the program carried on as if nothing had happened.)