Re: aic7xxx + apmbios

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Mon, 11 Mar 1996 08:10:14 +0100


On 5 Mar 96 at 22:39, Rik Faith wrote:

> > BTW: "a battery status of unknown is reported as 65535%. Wouldn't=20
> > 100% be enough (assuming there wouldn't be any output without power=
)
>=20
> What reports this? I can't find it to fix it:
>=20
> The boot-time message specifically checks and should print "unknown".
>=20
> /proc/apm should print -1%
>=20
> Thanks, Rik.

This is what my APM BIOS 1.1 reports:

bash# cat /proc/apm=20
0.8 1.1 0x03 0x01 0xff 0xff 65535% -1 ?
bash# uname -a
Linux sirius 1.3.71 #2 Sat Mar 9 22:37:21 MET 1996 i586
bash#=20

As already explained, I don't like the percentage of 65535 not too
much; therefore I suggest the following patch against 1.3.71:
(Warning: My editor did fold long lines)
Index: apm_bios.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/windl/REPOSITORY/linux/drivers/char/apm_bios.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 apm_bios.c
--- 1.1.1.1 1996/03/04 07:46:02
+++ apm_bios.c 1996/03/10 15:58:44
@@ -19,6 +19,8 @@
* Documentation
* January 1996, Rik Faith (faith@cs.unc.edu):
* Make /proc/apm easy to format (bump driver version)
+ * March 1996, Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
+ * Limit percentage of 65535% to 100%
*
* History:
* 0.6b: first version in official kernel, Linux 1.3.46
@@ -307,7 +309,7 @@
=20
static struct timer_list apm_timer;
=20
-static char driver_version[] =3D "0.8";/* no spaces=
=20
*/
+static char driver_version[] =3D "0.8uw";/* no=20
spaces */
=20
#ifdef APM_DEBUG
static char * apm_event_name[] =3D {
@@ -926,9 +928,9 @@
if (!(error =3D apm_get_power_status(&bx, &cx, &dx))) {
ac_line_status =3D (bx >> 8) & 0xff;
battery_status =3D bx & 0xff;
- if ((cx & 0xff) !=3D 0xff)
- percentage =3D cx & 0xff;
-
+ percentage =3D cx & 0xff;
+ if (percentage > 100)
+ percentage =3D 100;
if (apm_bios_info.version > 0x100) {
battery_flag =3D (cx >> 8) & 0xff;
if (dx !=3D 0xffff) {

Also I've found out that with the configuration
CONFIG_APM=3Dy
# CONFIG_APM_IGNORE_USER_SUSPEND is not set
# CONFIG_APM_DO_ENABLE is not set
CONFIG_APM_CPU_IDLE=3Dy
CONFIG_APM_DISPLAY_BLANK=3Dy

I get a message from the kernel:
[...]
kernel: APM BIOS version 1.1 Flags 0x03 (Driver version 0.8)
kernel: Entry f000:8030 cseg16 f000 dseg f8a4 cseg len ff63, dseg=20
len a0
kernel: Connection version 1.1
kernel: AC on line, battery status unknown, battery life unknown
kernel: battery flag 0xff, battery life unknown
[...]
kernel: apm_bios: set display standby: Unrecognized device ID

The device in question should be my graphics card (ATI Graphics Ultra
Pro Turbo (Mach64)) which is also known as (/proc/pci):

Bus 0, device 11, function 0:
VGA compatible controller: ATI 210888GX (rev 3).
Medium devsel. =20
Non-prefetchable 32 bit memory at 0xfa000000.

or as (ati.test):

ATI 88800 graphics controller detected.
Chip type 00D7 (=D7), class 0, revision 3.
ATI 68860 or similar RAMDAC detected.
This is a Mach64 video adapter.

Accelerator video RAM: 2048kB
VGA video RAM: 256kB
The extended registers (ATIExtReg) are at 0x01CE.

The latest Mach64 X11 server calls it "Mach64 GX Rev 3".
------------
Ulrich Windl Klinikum der Universitaet Regensburg
Rechenzentrum DV-med Franz-Josef-Strauss-Allee 11
Tel: +49 941 944-5879 D-93053 Regensburg
FAX: +49 941 944-5882
Just imagine my mail address were <Ulrich.Windl@rz.uni.r.de>...