HOWTO: Fix A Buggy DSDT file

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
User avatar
67GTA
Level 6
Level 6
Posts: 1301
Joined: Wed Jun 06, 2007 9:49 pm
Location: Kentucky, USA

HOWTO: Fix A Buggy DSDT file

Post by 67GTA »

This guide will help you fix your DSDT file to fix common ACPI problems on any Debian based OS. With Mint 6/Ubuntu 8.10, I started having a lot of problems with my laptop thermal temps, and not wanting to boot without holding down a keyboard key. This was in my case because of a buggy DSDT file. To read more about ACPI/DSDT go here: http://forums.opensuse.org/how-faq-read ... -dsdt.html It is the catalyst behind this how to. The process is a little different for Debian based operating systems. This how to will show you how to do it with Mint/Ubuntu.

WARNING: This might mess up your operating system. Even if you have zero errors after fixing the DSDT, it may still cause you to not be able to boot your OS. It will not harm your PC or hardware.

The first thing we need to do is install the Intel DSDT compiler. Open a terminal and run

Code: Select all

sudo apt-get install iasl

Then we need to get a copy of your current DSDT and save it in your home folder with this command

Code: Select all

sudo cat /proc/acpi/dsdt > dsdt.dat
Then we will disassemble it with iasl with this command

Code: Select all

iasl -d dsdt.dat
Edit by Husse Typo corrected in the above command
You should now have a file called dsdt.dsl in your home folder. This is the file you will be editing. Once you are done making changes, we will use it to make a new DSDT file. The next step is to use iasl to recompile the dsdt.dsl file to see any errors/warnings/optimizations with this command. Replace <yourusername> with your username.

Code: Select all

iasl -tc /home/<yourusername>/dsdt.dsl
This will show you the output of the recompiling process. At this point, you can use the output to find errors in the DSDT and attempt to fix them by editing the dsdt.dsl file with your favorite text editor. Go into the preferences for your text editor and turn on "line numbering". Then open dsdt.dsl with your text editor. You can use the output of the last command to find the errors by their line number. The following is an example of a common error. "dsdt.dsl 349" means the error is on line 349 of the dsdt.dsl file. Go to that line in your dsdt.dsl file with the text editor to fix it and save.

Code: Select all

dsdt.dsl   349:     Method (\_WAK, 1, NotSerialized)
Warning  1079 -                 ^ Reserved method must return a value (_WAK)
Each time you make a change in the dsdt.dsl file, be sure to save it, and then recompile to see the new output with

Code: Select all

iasl -tc /home/<yourusername>/dsdt.dsl
This will recompile it with the new changes and give you a new output to see if things look better :D Below are several links with common DSDT errors and their fixes.

http://forums.opensuse.org/how-faq-read ... -dsdt.html
https://wiki.edubuntu.org/LaptopTestingTeam/HPdv5z
http://forums.opensuse.org/archives/sf- ... -dsdt.html
http://forums.gentoo.org/viewtopic.php?t=122145

You might get lucky and find one already fixed for your make/model here: http://acpi.sourceforge.net/dsdt/view.php If so then you can skip to the last two commands.

Once you have successfully edited the dsdt.dsl file, we should have a dsdt.aml in your home folder. This was the goal of the how to.

WARNING: The commands up till this point have not made any changes to your system. You can simply delete the files that have been created. After the last two commands, you will be using a custom DSDT at boot. This is the point of no return.

These commands will rename the dsdt.aml file and copy it to your /etc/initramfs-tools folder. Then we will update the initrd image to include the DSDT override at boot. The very last command will update the initrd image. You need to replace "kernel version" with your kernel version. You can see it by running

Code: Select all

uname -r
in a terminal.

Code: Select all

sudo cp dsdt.aml /etc/initramfs-tools/DSDT.aml

Code: Select all

sudo update-initramfs -u -k kernel-version
Now cross your fingers and reboot :wink: To see if it stuck, you can look in your dmesg output. Open a terminal and run

Code: Select all

dmesg > /home/yourusername/Desktop/dmesg
This will put your dmesg output into a text file on your desktop. You should see a line similar to this:

Code: Select all

[    0.020495] ACPI: Checking initramfs for custom DSDT
[    0.353464] ACPI: Found DSDT in DSDT.aml.
[    0.353470] ACPI: Override [DSDT-   MCP67], this is unsafe: tainting kernel
[    0.353478] ACPI: Table DSDT replaced by host OS
[    0.353482] ACPI: DSDT 00000000, 7CB3 (r1 NVIDIA    MCP67  6040000 INTL 20061109)
[    0.353487] ACPI: DSDT override uses original SSDTs unless "acpi_no_auto_ssdt"
Places to check before and after are: dmesg output and /proc/acpi. I would especially check /proc/acpi/fan and /proc/acpi/thermal_zone to see if they are populated after this tutorial if they weren't before. Another trick I've learned during this process is to specify the operating system at boot. More about this is explained in the links I provided. I found that by adding

Code: Select all

acpi_osi="Linux"
to the boot options, the operating system even saw my hardware differently at boot. This seems to be very affective on HP laptops with Vista preinstalled. I outlined these steps here: http://www.linuxmint.com/forum/viewtopi ... 60&t=18222 The DSDT code is very hard to read, and I myself don't understand all of it. I left my HP desktop with 0 errors, and 4 warnings. Everything works, so I left the warnings. My laptop DSDT is perfect. It is a HP dv6815nr if someone with the same model wants to use my custom DSDT file. DSDT files are PC specific. Do not try using a DSDT from another PC unless it has the same hardware as yours.

EDIT: I forgot to mention that if you get a satisfactory DSDT, save the DSDT.aml file copied to /etc/initramfs-tools somewhere so it won't get lost. You can reuse it for any Linux OS on the same machine.
"The only thing necessary for the triumph of evil is for good men to do nothing." Edmund Burke
User avatar
67GTA
Level 6
Level 6
Posts: 1301
Joined: Wed Jun 06, 2007 9:49 pm
Location: Kentucky, USA

Re: HOWTO: Fix A Buggy DSDT file

Post by 67GTA »

It is possible it will fix it. 99% of acpi problems come from DSDT errors. Send me a copy of your dmesg, and I'll be happy to take a peek.
"The only thing necessary for the triumph of evil is for good men to do nothing." Edmund Burke
Husse

Re: HOWTO: Fix A Buggy DSDT file

Post by Husse »

I deleted one of my posts directly above 67GTA's post - it turned out that the suggestion in that post did not work
I have a custom DSDT now - thanks 67GTA - and I think boot is somewhat faster
I really tried this to see if it solved my shut down problem but it did not
(My computer stops at acpid: exiting and is never shut down)
User avatar
67GTA
Level 6
Level 6
Posts: 1301
Joined: Wed Jun 06, 2007 9:49 pm
Location: Kentucky, USA

Re: HOWTO: Fix A Buggy DSDT file

Post by 67GTA »

Possible solution:

Code: Select all

http://ubuntuforums.org/showpost.php?p=6099553&postcount=18
My machines hang at shutdown until I applied this to 8.10(Intrepid), but an update has fixed it recently.
"The only thing necessary for the triumph of evil is for good men to do nothing." Edmund Burke
Post Reply

Return to “Tutorials”