PDA

Click to See Complete Forum and Search --> : Shutting down a computer through software->


Peter Swinkels
May 31st, 2004, 05:54 AM
On a Pentium II and upward (if I am right) software
can shutdown the computer without the user having
to use the power switch. Does any one know the instructions to do this or where to find this information?

Some more explanation:
This code will reboot the computer:

MOV al, 0xFe
MOV dx, 0x64
OUT dx, al

What I would like is code that turns the computer off
instead of rebooting it. I don't need to know how
to call a Windows API or what ever to do it for me.
It needs to be operating system independant
like the rebooting example I posted.

yeohhs
Jun 5th, 2004, 08:35 AM
It depends on the Operating System.

For example, in Windows, you could write assembly code to call the Win32 API ExitWindowsEx to logoff and shutdown Windows. :-)

You can find Win32 assembly code that does this at:
http://www.geocities.com/yeohhs

Peter Swinkels
Jun 5th, 2004, 10:41 AM
Thanks for trying to help, perhaps I should have
mentioned that the code should be operating system
independant.

What like to know is what ExitWindowsEx for example
(or any routine that shuts the computer down)
does to make the computer shut down.

CornedBee
Jun 5th, 2004, 11:06 AM
On system halt, the OS will emit an ACPI command. Look up ACPI "Advanced Configuration and Power Interface", e.g. at
www.acpi.info
and you'll find more. ACPI calls require kernel mode rights though, so you can't do it from within a normal Windows or Linux application.

Peter Swinkels
Jun 5th, 2004, 11:10 AM
ACPI calls require kernel mode rights though, so you can't do it from within a normal Windows or Linux application.


Oh, but I don't intend to use it from inside Windows
or so. I am attempting to write my own kernel.
See my last post in the "Project Requests" :)

Thanks for helping.