|
-
May 31st, 2004, 05:54 AM
#1
Thread Starter
Frenzied Member
Shutting down a computer through software->
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.
Last edited by Peter Swinkels; Jun 5th, 2004 at 10:43 AM.
-
Jun 5th, 2004, 08:35 AM
#2
Junior Member
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
-
Jun 5th, 2004, 10:41 AM
#3
Thread Starter
Frenzied Member
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.
-
Jun 5th, 2004, 11:06 AM
#4
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jun 5th, 2004, 11:10 AM
#5
Thread Starter
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|