Results 1 to 5 of 5

Thread: Shutting down a computer through software->

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    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.

  2. #2
    Junior Member
    Join Date
    Dec 2003
    Posts
    22
    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
    FREE downloads: Assembly, C, C++, C# and .NET source codes and sample ebooks at http://www.yeohhs.com

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945
    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.

  4. #4
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945
    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
  •  



Click Here to Expand Forum to Full Width