Page 1 of 1

halt (-p)and reboot the system in PM

Posted: Wed Apr 20, 2005 12:27 am
by njmarshal
HELLO ,everyone!
a nice day!
Now I wanna to add my os the function of halt (halt -p) and reboot !(but I dont konw how to do ?
I found some usefull information ,and I also need yoiur help

can anyone give me some code in gcc or nasm (gcc will be better) in this filed!

thanks ahead !

Re:halt (-p)and reboot the system in PM

Posted: Wed Apr 20, 2005 2:05 am
by Pype.Clicker
njmarshal wrote: HELLO ,everyone!
a nice day!
lucky you! here i have grey sky and wet floor.
Now I wanna to add my os the function of halt (halt -p) and reboot !(but I dont konw how to do ?
I found some usefull information ,and I also need yoiur help

can anyone give me some code in gcc or nasm (gcc will be better) in this filed!

thanks ahead !
there are several methods for rebooting, including
[*]load a 0-sized IDT and issue an interrupt (that'll triple fault and reset)
[*] the 'pulse RESET line from 8042 controller', which should be documented at Bona Fide

In order to shutdown the system, you need to use the APM/ACPI (preferably calling the BIOS). There should be code for that in The Mobius

Using INT15h (according to Tim's code which appears to be Menuet code)
  • disconnect interface (ax=5304, bx=0)
  • connect real mode interface (ax=5301,bx=0)
  • enable power management (ax=5308, cx=bx=1)
  • enable device power management(ax=530D, cx=bx=1)
  • engage power management (ax=530f,cx=bx=1)
  • driver version (ax=530E, bx=0, cx=102)
  • set power state(ax=5307, bx=1, cx=3)