Reboot/Shutdown Code
Reboot/Shutdown Code
Hey, does anyone have some an idea how the reboot/shutdown source code go. Wiki source code of reboot does not seem quite complete. It does not work. Can you help me.I use Grub as my bootloader and use c language for Patricknet. I am working big time creating Patricknet Beta 0.3 which will be sometime next year when it will be released.
Re: Reboot/Shutdown Code
I use this to reboot. I forgot if it's official or not, but it reboots the machines I have tested it on.
I forgot why I did the stuff to 70,71.
Here's a port description.
http://bochs.sourceforge.net/techspec/PORTS.LST
Code: Select all
OutP(0x70,0x8F);
OutP(0x71,0x00);
OutP(0x70,0x00);
OutP(0x92,InP(0x92)|1);
Here's a port description.
http://bochs.sourceforge.net/techspec/PORTS.LST
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: Reboot/Shutdown Code
My reboot code. I can't remember where I got it from but it works.
-JL
Code: Select all
/* flush the keyboard controller */
unsigned temp;
do
{
temp = inb(0x64);
if((temp & 0x01) != 0)
{
(void)inb(0x60);
continue;
}
} while((temp & 0x02) != 0);
/* Reset! */
outb(0x64, 0xFE);
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: Reboot/Shutdown Code
As anyone who's worked on operating systems knows, there are multiple ways to reboot
The 0x92 bit is official and the 0x70 stuff is to enable resets.
The 0x92 bit is official and the 0x70 stuff is to enable resets.
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: Reboot/Shutdown Code
You could also trigger a triple fault.
-JL
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: Reboot/Shutdown Code
Some VMware versions (5.0, 5.5 at least) complain about triple faults not implemented or something similar.piranha wrote:You could also trigger a triple fault.
-JL
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Reboot/Shutdown Code
This was discussed many times before. The best option is probably ACPI. If that doesn't work, try something else (as said on different threads).
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]