When you push POWER BUTTON, most old PCs may turn off PC's power instantly. I think it is not good for PC UNIX and beginners. If your machine has Intel 82371AB( or 82371EB), your Linux Box may be Shutdown by Power Button !! Of course only software! NOTE: If POWER BUTTON was pressed over 4 seconds, force turn off power in any time. All of this packages is free software. Be careful, this packages is experimental version( pre alpha)!!! --------------------------------------- Required hardware and software. - PC/AT compatible PC. - Intel 82371AB(PIIX4) or Intel 82371EB(PIIX4E). - Linux-2.0.x or Linux-2.2.x ( I have checked 2.0.36 and 2.2.11 ). - Your kernel must support "module" and "misc device". --------------------------------------- Check your machine. On Linux, do next commands. #grep 82371 /proc/pci If you found a line Bridge: Intel 82371AB PIIX4 ACPI ..., this driver may be work. --------------------------------------- Check your machine 2nd. I have prepared test FD image. See http://www.netfort.gr.jp/~matsu/i82371/index-e.html Get "diskimage-19990826.gz" , do gunzip, prepare 1440kb FD and write image. $ls diskimage-19990826.gz ... $gzip -d diskimage-19990826.gz As root. #fdformat /dev/fd0u1440 #dd if=diskimage-19990826 of=/dev/fd0 And boot from this FD. Login as root. Do "chkpw" command. Push POWER BUTTON. If display message as "Power Button pressed ...", good!, your machine can shutdown by POWER BUTTON!( if use this package ) --------------------------------------- Build and Check. Get "piix4acpi-19990826.tar.gz", extract and make. $ls piix4acpi-19990826.tar.gz ... $tar zxf piix4acpi-19990826.tar.gz $cd piix4acpi-19990826/module $make $ls .... piix4acpi.o ... Install module to kernel as root. $su #insmod ./piix4acpi.o Check message. #tail /var/log/messages or #dmesg "acpi: Power Management IO space found at ..." is a correct message. Make device file as root. #mknod /dev/piix4acpi c 10 160 Make and run check program. $cd ../sample $make $./chkpw When you press POWER BUTTON, if you found message as "Power Button pressed ...", Good!, module installation is successful. Polling interval is 1 seccond, this time is enough one, because Power Button Pressed bit has lached. Of cause, display message has less than 1 second delay. Stop check program "chkpw" by typing ^C. If you need, change "chkpw.c" or make new program. "chkpw.c" is very small program. If you want only do "Shutdown by POWER BUTTON", you do next as root. #./chkpw "shutdown -h now" & NOTE: Before do this, you must prepare your kernel to power off by "halt". --------------------------------------- Install builded module( do your hands). Copy module. #cp module/piix4acpi.o /lib/modules/x.y.z/misc #depmod -a x.y.z is Kernel version No. like as 2.2.11 Change scripts or Configuration file. Slackware: add "/sbin/modprobe piix4acpi" to /etc/rc.d/rc.modules Debian: add "piix4acpi" to /etc/modules RedHat: Sorry, I don't know. See manual. Copy user program. Copy "chkpw" to any where you like. for example, #cp sample/chkpw /usr/local/sbin If you need, Chage script. If you are using Slackware, add next line to /etc/rc.d/rc.local /usr/local/sbin/chkpw "/sbin/shutdown -h now" In other distribution, I don't know, but like as above. --------------------------------------- Acknowledgements. I thank Tsubouchi Nobuo(Kyoto Sangyo University) and Akihiro Mukai. They gave me a good Hint for this program. I thank Plamo Linux. All of this development was made on Plamo Linux. I thank Every one who contribute to Linux and Open source. NOTE: Kyoto Sangyo Univ.(http://www.kyoto-su.ac.jp/) has many Linux machines for education. And these machines can shutdown by POWER BUTTON. But this system isn't open source currently. NOTE: Plamo Linux is a Linux distribution based on Slackware for Japanes. --------------------------------------- Author. Norimasa Matsumoto matsu@netfort.gr.jp http://www.netfort.gr.jp/~matsu ( sorry, most pages are Japanes )