Thursday, July 23, 2009

Fixing a Buggy ACPI BIOS Updated for Windows 8 and Linux Kernel 3.x


In the BIOS, there is a table that configures/determines a number of hardware values for ACPI and your system to use.

One of the features of ACPI is that the values and methods used can be differentiated at boot time depending on what OS you run. Each version of MS Windows has a unique identifier and while Linux can identify as "Linux", the Linux ACPI gurus have decided that Linux will always identify itself as "Windows NT". Even if you force Linux to identify itself as Linux, the Linux ACPI code still lies to the BIOS, except for the computers specifically listed in drivers/acpi/blacklist.

If you are running very new hardware intended for Windows Vista or Windows 8, you might get better performance on ACPI-related issues if you identify, or "spoof", your Linux OS as Vista or Windows 8. This is done by adding the boot-time kernel parameter of acpi_osi="Windows 2006" or "Windows 2012" respectively (and the quotes are necessary). still, it best to know exactly what version of windows your BIOS explicitly supports.

[I don't know if BSD has similar functionality. Anybody? Bueller? Anybody?]

If you want to know what your particular BIOS will actually allow for
an OS name, install the psutils and iasl packages, then follow these directions until you get the disassembled dsdt.dsl file and look at the section where you find the word "Windows". All the allowed values of the OS name for your BIOS will be right around there. My Acer laptop BIOS reports "Linux" as well as "Windows 2006" and my older desktop reports only "Microsoft Windows NT" as valid names.

NOTE
If you specify nothing, the default OS definition for the Linux kernel is "Microsoft Windows NT" and this information is found in acconfig.h.

From kernel-parameters.txt, is states that to spoof as Windows 98, use
acpi_osi="Microsoft Windows"

From uteval.c (used to be there, I don't know where it is found nowadays), the values given are:
"Windows 2000", /* Windows 2000 */
"Windows 2001", /* Windows XP */
"Windows 2001 SP1", /* Windows XP SP1 */
"Windows 2001 SP2", /* Windows XP SP2 */
"Windows 2001.1", /* Windows Server 2003 */
"Windows 2001.1 SP1", /* Windows Server 2003 SP1 */
"Windows 2006", /* Windows Vista */
"Windows 2009" will spoof for Windows 7
"Windows 2012" should spoof for Windows 8
"Windows 2013" should spoof for Windows 8.1
"Microsoft Windows" will spoof for Windows98

Some values can be found in a Microsoft White Paper.

Remember, the quotes are needed. And, if the value you are passing is not found in your ACPI BIOS, it will default to the ACPI BIOS default, whatever that is. You need to disassemble your ACPI BIOS as directed above to know for certain.

As a bonus, you might even be able to fix your broken DSDT and it's
easy to add it to your initrd.img.

REFERENCES

ACPI provides two mechanisms for determining the OS

Overriding the DSDT
http://powersave.sourceforge.net/powersave/DSDT.html

Linux ACPI FAQ
http://www.lesswatts.org/projects/acpi/faq.php

Linux ACPI Howto
http://web.archive.org/web/20070714030032/http://www.cpqlinux.com/acpi-howto.html

How to debug ACPI Problems

http://lwn.net/Articles/237085/

ACPIDUMP
http://www.linux-support.com/cms/en/magazine/man-pages/27771

DSDT: Overview
http://acpi.sourceforge.net/dsdt/index.php

Kernel Parameters
http://www.kernel.org/doc/Documentation/kernel-parameters.txt

HOWTO: Fix A Buggy DSDT file
http://forums.linuxmint.com/viewtopic.php?f=42&t=20719

How To Fix Your Buggy DSDT
http://forums.opensuse.org/how-faq-read-only/unreviewed-how-faq/386054-how-fix-your-buggy-dsdt.html

Store(Local0, Local0) generates an error
https://lists.linux-foundation.org/pipermail/bugme-new/2003-November/009350.html

Store(LocalX,LocalX) now produces an error
http://acpica.org/bugzilla/show_bug.cgi?id=785

HOWTO: Fix Common ACPI Problems (DSDT, ECDT, etc.)
http://forums.gentoo.org/viewtopic.php?t=122145

DSDT compilation issues
http://www.mail-archive.com/linux-acpi@vger.kernel.org/msg06782.html

Overriding a DSDT
http://www.lesswatts.org/projects/acpi/overridingDSDT.php
Sensors not updated causing CPU to heat after suspend/hibernate on laptop
https://bugs.launchpad.net/linux/+bug/182929

ACPI Specifications - Toshiba
http://uk.computers.toshiba-europe.com/innovation/download_whitepaper.jsp?service=UK&WHITEPAPER_ID=00000004c6

1 comment:

Georgi Georgiev said...

Hi to answer your question:

"[I don't know if BSD has similar functionality. Anybody? Bueller? Anybody?]
"

Yes BSD has similar functionality:

Check out this link - http://www.pc-freak.net/blog/how-to-disable-acpi-power-saving-support-in-freebsd-disable-acpi-on-bsd-kernel-boot-time/