Purpose: A while ago I posted a blog entry dealing with “Kernel Panic” error messages because of the faulty ACPI code in the BIOS. In that post I explained how we can get rid of the kernel panic error message but did not cover how to know if your ACPI BIOS code is really buggy or not?

So let’s see how to find that out…

Many times we have seen that we need to pass the kernel boot parameter acpi=off nolapic to the Linux Kernel during the boot loader screen (GRUB or LILO) in order for it to boot successfully. I tried to dig deep into this issue as to why do we have to give these options for Linux and I found out something interesting which may also answer another common question as to “Why Windows XP just boots fine whereas Linux in this case has problems during booting?”

The problem may potentially be in the DSDT table which is a part of ACPI specification.

According to ACPI Spec Manual:

An OEM must supply a DSDT to an ACPI-compatible OS. The DSDT contains the Differentiated Definition Block, which supplies the implementation and configuration information about the base system. The OS always inserts the DSDT information into the ACPI Namespace at system boot time and never removes it.

So in case if the DSDT is buggy, it is likely that the operating systems might stop booting (just like Linux does) or give ACPI related errors messages when it boots. DSDT code is compiled into AML (ACPI Machine Language) using ASL compiler (ACPI Source Language). Generally, Microsoft’s ASL compiler is known to allow many errors and warnings to sneak in, resulting into a buggy DSDT which Linux is usually intolerant of.  So when we boot Linux with a buggy DSDT, Linux ACPI developers expect DSDT to be written in such a way which complies with ACPI specification along with Intel’s ASL compiler. This *may* be a reason as to why Windows XP boot and Linux does not because the buggy DSDT was compiled using Microsoft’s ASL compiler.

Let’s see this with an example for a system which we suspect might have a buggy firmware/BIOS and hence needs parameters like acpi=off nolapic:

Step 1: Download Intel’s ASL compiler

Let’s download and install the Intel’s ASL compiler from here.

# apt-get install iasl

Step 2: Obtain the original DSDT for your system

# cp /proc/acpi/dsdt DSDT.dat

Step 3: Disassemble the DSDT binary

Now let’s disassemble the DSDT binary (of our buggy computer BIOS) into DSDT.dsl code file like this:

# iasl -d dsdt.dat

which basically produces a dsdt.dsl file.

Output:
Intel ACPI Component Architecture
AML Disassembler version 20061109 [May 15 2007]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a

Loading Acpi table from file DSDT.dat
Acpi table [DSDT] successfully installed and loaded
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………………….
Parsing completed
Disassembly completed, written to “DSDT.dsl”
Step 4: Recompile the disassembled code

# iasl -tc dsdt.dsl

Now, if the DSDT code is not buggy then we should not get any error messages or warnings upon recompiling it. If it is buggy then we should get error messages.

Here is what I got for our system with a buggy BIOS (or firmware) from the above command:
ASL Input: dsdt.dsl - 3998 lines, 133239 bytes, 827 keywords
Compilation complete. 28 Errors, 1 Warnings, 0 Remarks, 572 Optimizations

Notice how we got 28 errors during the recompilation.

Additional Notes

Similarly let’s do the same process for APIC (nolapic parameter):

# iasl APIC.dsl

Output
Intel ACPI Component Architecture
ASL Optimizing Compiler version 20061109 [May 18 2007]
Copyright (C) 2000 - 2006 Intel Corporation
Supports ACPI Specification Revision 3.0a
APIC.dsl 12: [000
Error 4094 - ^ Invalid character (0x5B), expecting ASL keyword or name
APIC.dsl 12: [000
Error 4094 - ^ syntax error, unexpected PARSEOP_INTEGER, expecting PARSEOP_DEFINITIONBLOCK
ASL Input: APIC.dsl - 13 lines, 246 bytes, 0 keywords
Compilation complete. 2 Errors, 0 Warnings, 0 Remarks, 0 Optimizations

Notice how we got 2 errors (again) during the recompilation process.

Conclusion

Although I am not an ACPI/APIC expert but I suspect that because of these errors we have to disable the ACPI and Local APIC through the Linux kernel boot parameter when we boot the Linux kernel. If you disagree with this post please add your comment below.

Thanks!

Be Sociable, Share!