System reset using triple fault

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Cemre
Member
Member
Posts: 31
Joined: Fri Nov 09, 2007 5:25 am

System reset using triple fault

Post 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.
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Post 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?
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
Jef
Member
Member
Posts: 112
Joined: Tue Jan 08, 2008 7:25 am
Location: Greece
Contact:

Post 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)
Keep coding...
...the sky is the limit

AsteriOS project: http://www.mindfields.gr/main/index.php ... &Itemid=27
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post 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
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: System reset using triple fault

Post 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.)
Post Reply