From owner-freebsd-mobile Mon Aug 9 9: 6: 2 1999 Delivered-To: freebsd-mobile@freebsd.org Received: from titanium.yy.ics.keio.ac.jp (titanium.yy.ics.keio.ac.jp [131.113.47.73]) by hub.freebsd.org (Postfix) with ESMTP id D03D7150F4 for ; Mon, 9 Aug 1999 09:05:51 -0700 (PDT) (envelope-from sanpei@sanpei.org) Received: from oxygen.yy.ics.keio.ac.jp (oxygen.yy.ics.keio.ac.jp [131.113.47.3]) by titanium.yy.ics.keio.ac.jp (8.8.8+3.0Wbeta13/3.7W) with ESMTP id BAA01805; Tue, 10 Aug 1999 01:02:29 +0900 (JST) Received: from lavender.yy.cs.keio.ac.jp (ppp114.dialup.st.keio.ac.jp [131.113.27.114]) by oxygen.yy.ics.keio.ac.jp (8.9.3+3.2W/3.7W) with ESMTP id BAA01502; Tue, 10 Aug 1999 01:02:26 +0900 (JST) Received: (from sanpei@localhost) by lavender.yy.cs.keio.ac.jp (8.9.3/3.7W) id BAA01757; Tue, 10 Aug 1999 01:02:23 +0900 (JST) Message-Id: <199908091602.BAA01757@lavender.yy.cs.keio.ac.jp> To: mobile@freebsd.org, iwasaki@jp.FreeBSD.org Subject: Re: [APM] kernel panic with apm command(Sotec WinBookPro). In-Reply-To: Your message of "Mon, 09 Aug 1999 01:46:12 +0900" References: <199908081642.BAA01817@tasogare.imasy.or.jp> X-Mailer: Mew version 1.70 on Emacs 19.34.1 / Mule 2.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 10 Aug 1999 01:02:23 +0900 From: MIHIRA Sanpei Yoshiro Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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: 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: 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