Soft Off

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Phibred
Member
Member
Posts: 31
Joined: Sun Jun 26, 2005 11:00 pm
Location: Toronto, Ontario, Canada
Contact:

Soft Off

Post by Phibred »

Hey,
Does any one know how to do a 'Soft Off', like how Windows and Linux 'turn off the computer automatically'. I've been searching for a bit but I can't find it in the Linux Kernel.

Thanks,
It will come from the ashes of the old era.
-- James Vaughan
dembol
Posts: 5
Joined: Wed Nov 24, 2004 12:00 am
Location: Gdynia, Poland
Contact:

Re: Soft Off

Post by dembol »

Hi

First, you should write the APM driver for your OS because APM provides API for machine power management. If you would like to do a 'Soft off' you should call APM's set_power_state() routine with the power state APM_POWER_STATE_OFF

Look at my code: http://dembol.inwestuj.com/cgi-bin/sour ... apm.c#L150
<a href="http://agnix.sourceforge.net">agnix.sourceforge.net</a>
Phibred
Member
Member
Posts: 31
Joined: Sun Jun 26, 2005 11:00 pm
Location: Toronto, Ontario, Canada
Contact:

Re: Soft Off

Post by Phibred »

I'll have to take a good long look at that one. It just seams like a lot of overhead for just turnning the computer off though, but I see its use for laptop drivers and such.

I'll try to post my assembler version of the apm driver so people doing asm can enjoy that.
It will come from the ashes of the old era.
-- James Vaughan
Post Reply