Rebooting the computer

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
User avatar
imate900
Member
Member
Posts: 80
Joined: Sat Feb 28, 2009 11:43 am

Rebooting the computer

Post by imate900 »

(I apperantly test my OSes in VirtualBox)

I do:

Code: Select all

int 0x19
but I can't reboot the machine. Can you help me? Is there some special way to do this?
Current work on a OS: SauOS (project homepage: http://code.google.com/p/sauos/)
Image
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: Rebooting the computer

Post by JohnnyTheDon »

The easiest (and most effective) way is through the keyboard controller
kay10
Member
Member
Posts: 30
Joined: Mon Apr 13, 2009 6:10 am
Location: Oldenburg, Germany

Re: Rebooting the computer

Post by kay10 »

You could try something like this:

Code: Select all

db 0xEA
dw 0x0000
dw 0xFFFF
This is a far jump to a BIOS function to reboot the system when I'm right.

EDIT: too slow...

EDIT 2: I think this method might only work in real mode
User avatar
imate900
Member
Member
Posts: 80
Joined: Sat Feb 28, 2009 11:43 am

Re: Rebooting the computer

Post by imate900 »

JohnnyTheDon wrote:The easiest (and most effective) way is through the keyboard controller
Now, my OS locks up when I do "reboot". I can send you the source code and floppy I use. In fact, I'll attach it:
Attachments
ross.zip
My OS
(2.74 KiB) Downloaded 114 times
Current work on a OS: SauOS (project homepage: http://code.google.com/p/sauos/)
Image
User avatar
imate900
Member
Member
Posts: 80
Joined: Sat Feb 28, 2009 11:43 am

Re: Rebooting the computer

Post by imate900 »

kay10 wrote:You could try something like this:

Code: Select all

db 0xEA
dw 0x0000
dw 0xFFFF
This is a far jump to a BIOS function to reboot the system when I'm right.

EDIT: too slow...

EDIT 2: I think this method might only work in real mode
I love you!!!! It reboots!

EDIT: my OS is real mode.
Current work on a OS: SauOS (project homepage: http://code.google.com/p/sauos/)
Image
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: Rebooting the computer

Post by earlz »

I always thought the easiest way to reboot(in protected mode) was to trash the IDT, then divide by zero.. triple-fault==reboot.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Rebooting the computer

Post by jal »

earlz wrote:I always thought the easiest way to reboot(in protected mode) was to trash the IDT, then divide by zero.. triple-fault==reboot.
The easiest way to stop a car is to run it into a tree. Not recommended either.


JAL
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Rebooting the computer

Post by Love4Boobies »

kay10 wrote:You could try something like this:

Code: Select all

db 0xEA
dw 0x0000
dw 0xFFFF
This is a far jump to a BIOS function to reboot the system when I'm right.

EDIT: too slow...

EDIT 2: I think this method might only work in real mode
That's not a function to reboot the BIOS, it's the BIOS itself. That's what gets ran once you turn your PC on. However, it might not be a good idea to do things this way; The BIOS may expect a certain state for hardware and you're not going to have that by jumping into the BIOS initialization code. It's sort of like re-executing the MBR (provided it's still in the rightful memory location); you'll still have the same video mode (say graphics), etc. Some of the things probably won't affect you very much (the video mode is likely to change properly unless you're using DOS in which case you won't see anything).

The safest way is using ACPI or APM if they're there. If you want to use black magic, triple fault is also an easy ticket to reboot :)
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply