From owner-freebsd-hackers Fri Feb 27 08:11:32 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA10226 for freebsd-hackers-outgoing; Fri, 27 Feb 1998 08:11:32 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from penguin.wise.edt.ericsson.se (penguin-ext.wise.edt.ericsson.se [194.237.142.5]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA10218 for ; Fri, 27 Feb 1998 08:11:25 -0800 (PST) (envelope-from seb@erix.ericsson.se) Received: from super.du.etx.ericsson.se (root@super.du.etx.ericsson.se [150.236.14.16]) by penguin.wise.edt.ericsson.se (8.7.5/8.7.3/glacier-1.12) with ESMTP id RAA24496; Fri, 27 Feb 1998 17:11:18 +0100 (MET) Received: from scotch.du.etx.ericsson.se (seb@scotch.du.etx.ericsson.se [150.236.14.76]) by super.du.etx.ericsson.se (8.9.0.Alpha1/8.9.0.Alpha1/erix-1.4) with ESMTP id RAA12009; Fri, 27 Feb 1998 17:11:16 +0100 (MET) Received: by scotch.du.etx.ericsson.se (8.8.8/client-1.4) id RAA07659; Fri, 27 Feb 1998 17:11:15 +0100 (CET) To: freebsd-hackers@FreeBSD.ORG Cc: stefan@promo.de (Stefan Bethke) Subject: Re: Graceful shutdown by single keypress? References: <561614.3096881785@stefan.promo.de> From: Sebastian Strollo Date: 27 Feb 1998 17:11:15 +0100 In-Reply-To: stefan@promo.de's message of 19 Feb 98 11:56:25 GMT Message-ID: Lines: 50 X-Mailer: Gnus v5.3/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG stefan@promo.de (Stefan Bethke) writes: > [He wants to have a system, for a trade show, that can switch itself off] > I'm looking > into an ATX system with APM support that can switch itself off. > > Instead, I'd like to tell the operators to press the suspend key on the > system, and wait for it to switch itself off. As I currently have no APM > system to test this on (I will get the system the next few days), I'm > interested in experiences with APM on desktop machines, and the feasibility > of my idea. Also, if someone has any recommendations on a specific pentium > mainboard, I'd be happy to hear them. Yes, I think this is the way to go. (I don't have any recommendations for specific mainboards, but I have the power off functionality working on my desktop DELL.) > [alternative solution involving serial port removed] > > It would be acceptable for me to hack the kernel to add any necessary APM > power-off command, if needed. If you are running -current I think you could just hack a bit in sys/i386/apm/apm.c, in the function apm_processevent() just change from: OPMEV_DEBUGMESSAGE(PMEV_USERSUSPENDREQ); apm_suspend(); break; to: OPMEV_DEBUGMESSAGE(PMEV_USERSUSPENDREQ); shutdown_nice(); break; Disclaimer: I haven't tested it :-) (If someone think it is a bad idea please speak up.) Hmm, maybe there is even an interrupt/APM interface for the power off key? In -current this should then also power down your system. If you are running -stable the system won't power off, just halt.But I have added the powerdown things from -current in my system and could send you the patches if you want them. (BTW, is this something we could put into -stable? I think it is pretty neat that the machine powers down when I halt it, and as I said I have the diffs for -current if anyone is interested.) Which makes me think about another thing, in sys/kern/kern_shutdown.c in -current, shouldn't the call to cpu_power_down() be preceded by a "if (howto & RB_POWEROFF)"? (Especially since the reboot utility have command line option that actually adds that flag.) -- Sebastian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message