Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Mar 1999 14:06:54 +0100 (CET)
From:      Stefan `Sec` Zehl <sec@42.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/10746: apm poweroff fails on 3.1 (worked on 2.2.6)
Message-ID:  <199903231306.OAA13360@matrix.42.org>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903231306.OAA13360>