Subject: How to load your custom ACPI DSDT with NetBSD
To: None <port-i386@NetBSD.org, port-amd64@NetBSD.org>
From: Rui Paulo <rpaulo@fnop.net>
List: port-amd64
Date: 01/05/2006 17:19:53
--M9NhX3UHpAaciwkO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

If you are experiencing problems related to buggy ACPI tables, then
most likely you'll have kernel messages similar to:

acpibat0: failed to evaluate _BST: AE_NOT_FOUND
ACPI-0451: *** Error: Looking up [Z00C] in namespace, AE_NOT_FOUND
SearchNode 0xc0f2a000 StartNode 0xc0f2a000 ReturnNode 0x0
ACPI-1341: *** Error: Method execution failed [\_SB_.BAT1._BST] (Node
0xc0f2ac80), AE_NOT_FOUND

(this was the problem of my Acer Aspire 1691 laptop and would prevent
me from reading battery status information)

Why hardware vendors and OEMs are unable to conform to the ACPI spec
is beyond the scope of this email, but suffice to say that you can fix
the tables yourself.

With the changes I just checked in, you only need to do some simple
steps as described in src/sys/dev/acpi/acpica/Osd/OsdMisc.c:

/*
 * for debugging DSDT (try this at your own risk!):
 *
 * 1. dump your raw DSDT (with acpidump(*1) etc.)
 * 2. disassemble with iasl -d (*2)
 * 3. modify the ASL file
 * 4. compile it with iasl -tc
 * 5. copy *.hex to src/sys/dev/acpi/acpica/Osd/dsdt.hex
 *    -or-
 *    options ACPI_DSDT_FILE="\"yourdsdt.hex\"" in
 *    your config file and yourdsdt.hex in the build directory
 * 6. options ACPI_DSDT_OVERRIDE in your kernel config file
 *    and rebuild the kernel
 *
 * (*1) /usr/pkgsrc/sysutils/acpidump
 * (*2) /usr/pkgsrc/sysutils/acpi-iasl
 */

If you don't know how to fix the tables yourself (or you just don't
want to spend time) go to http://acpi.sourceforge.net/dsdt/index.php,
find your laptop's manufacturer/model tuple and download one of the
custom DSDT's and do as above but skiping the first 3 steps.

Thanks to Juan and Quentin for the help provided :-)

		-- Rui Paulo

--M9NhX3UHpAaciwkO
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iD8DBQFDvVU5ZPqyxs9FH4QRAv5MAJ46JWnhs4zQNlpyg0DLHTh1DP9yvwCfX4pf
Vlbt/cVkqMvxJDnhTs4acjE=
=AxTM
-----END PGP SIGNATURE-----

--M9NhX3UHpAaciwkO--