Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Aug 1999 01:02:23 +0900
From:      MIHIRA Sanpei Yoshiro <sanpei@sanpei.org>
To:        mobile@freebsd.org, iwasaki@jp.FreeBSD.org
Subject:   Re: [APM] kernel panic with apm command(Sotec WinBookPro).
Message-ID:  <199908091602.BAA01757@lavender.yy.cs.keio.ac.jp>
In-Reply-To: Your message of "Mon, 09 Aug 1999 01:46:12 %2B0900"
References:  <199908081642.BAA01817@tasogare.imasy.or.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
  I applied Iwasaki-san's patch to my sys/i386/apm/apm.c.

  And I execute apm, kernel does not panic. But I think
/usr/sbin/apm needs some additional code(?).

% apm
APM version: 1.0
APM Managment: Enabled
AC Line status: on-line
Battery status: charging
Remaining battery life: unknown
Remaining battery time: unknown
Number of batteries: unknown
apm: Get resume timer: Invalid argument	<------------
%
----------
>> [probed message]
>> apm0: <APM BIOS> on motherboard
>> apm: APM BIOS version 0101
>> apm: Code16 0xc00f0000, Data 0xc00f0000
>> apm: Code entry 0x0000b321, Idling CPU disabled, Management disabled
>> apm: CS_limit=0xffff, DS_limit=0xffff
>> apm: found APM BIOS v1.1, connected at v1.0
>
>Odd. Why it connected at v1.0???

  I added some debug code. 
  I think my NOTE-PC has buggy BIOS.  If it call ``APM_DRVVERSION'',
BIOS return 0x530e of APM driver version, not 0x010x(1.0?).  0x530e
is eax value for APM_DRVVERSION...... BIOS of MY NOTE-PC does not
recognize DRVVERSION CALL.........

[probed message]
apm0: <APM BIOS> on motherboard
drv_version:  101				<-- debug message
DRIVER VERSION 1: 530e				<-- debug message
drv_version:  100				<-- debug message
apm: found APM BIOS v1.1, connected at v1.0

debug code
--- apm.c.org	Tue Aug 10 00:37:57 1999
+++ apm.c	Tue Aug 10 00:49:39 1999
@@ -212,8 +212,11 @@
 	sc->bios.r.ecx  = version;
 	sc->bios.r.edx = 0;
 
-	if (apm_bioscall() == 0 && sc->bios.r.eax == version)
+	if (apm_bioscall() == 0 && sc->bios.r.eax == version) {
+		printf("DRIVER VERSION 0: %x\n", sc->bios.r.eax);
 		return (0);
+	}
+	printf("DRIVER VERSION 1: %x\n", sc->bios.r.eax);
 	return (1);
 }
  
@@ -976,9 +979,12 @@
         * 1.02 driver resulted in a 1.02 connection.
         */
 	drv_version = apm_version > 0x102 ? 0x102 : apm_version;
-	for (; drv_version > 0x100; drv_version--)
+	for (; drv_version > 0x100; drv_version--) {
+		printf("drv_version: %4x\n", drv_version);
 		if (apm_driver_version(drv_version) == 0)
 			break;
+	}
+		printf("drv_version: %4x\n", drv_version);
 	sc->minorversion = ((drv_version & 0x00f0) >>  4) * 10 +
 		((drv_version & 0x000f) >> 0);
 	sc->majorversion = ((drv_version & 0xf000) >> 12) * 10 +
@@ -1176,7 +1182,7 @@
 		sc->bios.r.edi = args->edi;
 		if ((ret = apm_bioscall())) {
 			if (ret == -1) {
-				error = ENOSYS;
+				error = EINVAL;
 			} else {
 				sc->bios.r.eax &= 0xff;
 			}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




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