From owner-freebsd-bugs Tue Mar 23 5:10:19 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 0186E15264 for ; Tue, 23 Mar 1999 05:10:18 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.2/8.9.2) id FAA56702; Tue, 23 Mar 1999 05:10:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from matrix.42.org (matrix.42.org [194.246.250.200]) by hub.freebsd.org (Postfix) with ESMTP id 232BC14C2B for ; Tue, 23 Mar 1999 05:07:14 -0800 (PST) (envelope-from sec@42.org) Received: (from sec@localhost) by matrix.42.org (8.8.8/8.8.5) id OAA13360 (sender ); Tue, 23 Mar 1999 14:06:54 +0100 (CET) Message-Id: <199903231306.OAA13360@matrix.42.org> Date: Tue, 23 Mar 1999 14:06:54 +0100 (CET) From: Stefan `Sec` Zehl Reply-To: sec@42.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: kern/10746: apm poweroff fails on 3.1 (worked on 2.2.6) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 10746 >Category: kern >Synopsis: apm poweroff fails on 3.1 (worked on 2.2.6) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Mar 23 05:10:00 PST 1999 >Closed-Date: >Last-Modified: >Originator: Stefan `Sec` Zehl >Release: FreeBSD 2.2.7-STABLE i386 >Organization: >Environment: My 3.1-STable box. make world'ed 2 days ago. FreeBSD btl.42.org 3.1-STABLE FreeBSD 3.1-STABLE #0: Tue Mar 23 02:25:33 CET 1999 sec@btl.42.org:/usr/src/sys/compile/BTL i386 >Description: on 2.2.6 I applied the apm_poweroff patch, and my box would power off on "halt -p" without problem. This is what i used on 2.2.6: --- sys/i386/apm/apm.c.orig Mon Nov 10 15:40:40 1997 +++ sys/i386/apm/apm.c Tue May 12 16:39:02 1998 @@ -229,6 +229,21 @@ return 0; } +/* + * Turn off the entire system. + */ +void +apm_power_off(void) +{ + u_long eax, ebx, ecx; + + if (!apm_softc.active) + return; + eax = (APM_BIOS << 8) | APM_SETPWSTATE; + ebx = PMDV_ALLDEV; + ecx = PMST_OFF; + apm_int(&eax, &ebx, &ecx); +} /* APM Battery low handler */ static void now on 3.1 (where the code is already there) it doesn't work anymore. I added a few debug statements liek that: /* * Turn off the entire system. */ static void apm_power_off(int howto, void *junk) { u_long eax, ebx, ecx, edx; printf("trying to shutdown\n"); /* Not halting powering off, or not active */ if (!(howto & RB_POWEROFF) || !apm_softc.active) return; eax = (APM_BIOS << 8) | APM_SETPWSTATE; ebx = PMDV_ALLDEV; ecx = PMST_OFF; edx = 0; printf("actually trying to shutdown\n"); if(apm_int(&eax, &ebx, &ecx, &edx)) printf("Entire system shutdown failure: errcode = %ld\n", 0xff & (eax >> 8)); } and all I get on 'halt -p' is: syncing disks... 10 10 done trying to shutdown actually trying to shutdown Entire system shutdown failure: errcode = 96 The operating system has halted. Plese press any key to reboot. >How-To-Repeat: halt -p >Fix: none known. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message