Hi!

I noticed that the power-off button on my Abit BH-6 board can cooperate with system 
software.
So I tried to tweak my linux system ( redhat 6.0 ) to perform a clean shutdown, 
whenever
I press the power-off button. Normally it would just power-off, leaving file-systems 
'dirty'.

Has anyone done this already ?

I did some experiments and discovered the following :

 - when I press the power-off button , the APM BIOS sends a APM_USER_SUSPEND ( 0x000a 
) event
to the OS. With normal kernel APM support and standard apmd, the system would simply 
respond with
a set_power_state(APM_STATE_SUSPEND) call, but that wont make the computer go to 
SUSPEND mode
but to POWER_OFF !!  ( normaly it goes to SUSPEND , this happens only its a response to
the press of the power button ).

I patched the kernel to make a set_power_state(APM_STATE_REJECT) to prevent the 
computer being
powered off and then send a signasl to user-land ( I just used the APM_USER_SUSPEND 
event )
Then I changed apmd to perform "shutdown -h now" when an APM_USER_SUSPEND event is 
received 
and that's it ; it does not send a request to go to suspenmd mode back to kernel.


It seems that the APM specification lacks an event for power-button-press and Abit 
decided
to send a APM_USER_SUSPEND event .

 
--
David Balazic , student
E-mail   : [EMAIL PROTECTED]     |     living in  sLOVEnija
home page: http://surf.to/stein
Computer: Amiga 1200 + Quantum LPS-340AT
--

Reply via email to