3/15/12 Patching DSDT in recent Linux kernels without recompiling « Michael Kuron's Blog
Michael Kuron's Blog
« Using motd to warn you of upcoming fsck
NFS Performance: rsize and wsize »
Patching DSDT in recent Linux kernels without recompiling
Up until a year or two ago, the Linux kernel let you replace the ACPI DSDT by adding a customized version to
the initrd. However, more recent versions disable that by default. If you re using Grub2 as your bootloader
though, the alternative is simple: just add acpi /boot/dsdt.aml to your Grub config. If you prefer a more elegant
solution, just add the attached 01_acpi.txt to /etc/grub.d, renamed it to 01_acpi and chmod + it; then run
updategrub2 to rebuild your Grub config. It originally came from ubuntuforums.org and I removed the e flag in
the acpi line, which caused the new DSDT only to be visible to Grub, but not to the OS.
I believe the acpi command in Grub2 originally came from the Hackintosh community – messing around with
DSDTs is a lot more common there because Mac OS X is rather picky.
For those of you who don t know what I m talking about: the DSDT describes certain hardware features your
PC has, such as buttons, CPU power save modes, and lots of other things. Some mainboards have very poorly
done BIOSes that have equally messed up DSDT tables. I won t go into a lot of detail regarding how to fix those
here though (it s as simple as cat /proc/acpi/dsdt > dsdt.dat; iasl d dsdt.dat; editing dsdt.dsl to your liking;
iasl tc dsdt.dsl (this last step will probably produce a number of errors that can be solved by googling for the
error number and making the appropriate changes in dsdt.dsl)).
Another valuable hint for people messing around with DSDTs: the DSDT is not the only place that can contain
this kind of information, the other place would be the SSDT and possibly additional SSDTs. You can find them
in /sys/firmware/acpi/tables and decompile them just like the DSDT as described above. Instead of recompiling
the SSDT by itself, you could probably also consider merging it into your custom DSDT at the appropriate
places.
Tags: acpi, dsdt, kernel
This entry was posted on Thursday, March 17th, 2011 at 15:18 and is filed under Linux. You can follow any responses to this
entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
16 Responses to Patching DSDT in recent Linux kernels without recompiling
1. Eric says:
20110901 at 23:03
Just stumbled across this… glad to have found it. Thanks for the tip, it worked great for me on the 3.0.0
kernel in Ubuntu 11.10. My issue was with a Toshiba laptop not seeing the battery, so between your post
kuron-germany.de/2011/ /patching-dsdt-in-recent-linux-kernels-without-recompiling/ 1/5
3/15/12 Patching DSDT in recent Linux kernels without recompiling « Michael Kuron's Blog
and http://techinterplay.com/fixtoshibabatteryissuelinux.html I ve got my battery showing up and
working without a kernel recompile. Thanks!
2. Adrian says:
20111025 at 12:04
Glad to find the useful tip. Thanks.
I have a question about the last one sentence: “you could probably also consider merging it into your
custom DSDT at the appropriate places.” Could you kindly provide the steps for merging SSDT into the
custom DSDT?
3. Michael Kuron says:
20111025 at 17:44
@Adrian: Just copy the contents from SSDT.dsl to DSDT.dsl and place them at a syntactically correct
place (iasl will complain if you do it wrong). If identicallynamed sections exist both in DSDT and SSDT,
you can usually replace the one in DSDT with the one from SSDT (though you might want to google to
find out what that section name does — some sections appear to be allowed multiple times). If you upload
your disassembled DSDT and SSDT to pastebin.com or something, I could take a look at it and give it a
try.
4. rod says:
20111126 at 23:14
Eric, I m following your recomendation of using grub instead of recompiling kernel. The custom
downloadable kernel does work, but it kills the 3d nvidia acceleration with the propietary drivers. My
question is: in Patching DSDT post the man mention a DSDT.aml to add in grub… but the files after
extracting, disassemby and reasembli are .dat .hex and .dsl.
¿How exactly do you use your custom DSDT in grub? I am missing the step that trasform to .aml
Thanks
5. Michael Kuron says:
20111127 at 08:35
@rod:
iasl tc dsdt.dsl
6. Nicholas Hunsicker says:
20111128 at 22:57
Just wanted to say that I came over from the tech interplay page about fixing the toshiba battery issue as
kuron-germany.de/2011/ /patching-dsdt-in-recent-linux-kernels-without-recompiling/ 2/5
3/15/12 Patching DSDT in recent Linux kernels without recompiling « Michael Kuron's Blog
well, and I have this working now over here. For those that are totally clueless about messing with
/etc/grub.d you need to remember to run an updategrub2 afterward otherwise you re not going to see
any change.
7. ido says:
20111220 at 05:43
Thanks for the post. Combined with the post in techinterplay.com, now I don t have to endure “the
torturing 2 hours” of recompiling anymore just to have the battery indicator light up in my desktop.
By the way, I wonder what is the real function of e in the first line of 01_acpi files ?
8. Veer says:
20120128 at 23:24
Hello Michael Kuron ,
I have added the file 01_acpi.txt in to /etc/grub.d after changing the permission as you mentioned.
Then I have edited the file DSDT.dsl as per the instruction of techinterplay.com. And recompiled the
dsdt.dsl using the command iasl tc dsdt.dsl. Finally I updated the grub. Unfortunately the battery meter is
not showing up on my LinuxMint. Could you please assist me to resolve the issue?
9. Michael Kuron says:
20120128 at 23:29
Is that grub2? Did you remove the .txt extension and then chmod +x it? If you did everything correctly,
you ll get a line saying that it found an ACPI table when you run updategrub2 to rebuild the grub config.
10. Veer says:
20120128 at 23:43
Hello,
Thank you very much for your promptly reply. I have removed the extension and changed the permission
as you mentioned. However the update grub is not showing found acpi table. Should I try once again?
11. Veer says:
20120128 at 23:50
Hello Michael Kuron,
I apologize for the misinformation. I am using grub 1.99. Is it possible to fix the issue?
kuron-germany.de/2011/ /patching-dsdt-in-recent-linux-kernels-without-recompiling/ 3/5
3/15/12 Patching DSDT in recent Linux kernels without recompiling « Michael Kuron's Blog
12. Michael Kuron says:
20120128 at 23:55
I believe 1.99 is already grub2, I m running 1.98 and that s definitely grub2. Grub 1 lacks essential
features, most notably the acpi command itself, so that wouldn t work.
Other than what I wrote previously, there s nothing I can suggest (it should just work), so you re on your
own there. If you find out what s causing the issue, please do post it. A good starting point would be to
add an echo line to the script and see whether that gets output when running updategrub2. Also, please
make sure that your recompiled DSDT is at /boot/dsdt.aml (casesensitive), as that is where the script
looks.
13. Veer says:
20120129 at 00:12
Hello Michael Kuron,
Additional information if it will help the DSDT is located in /sys/firmware/acpi/tables/ instead of cat
/proc/acpi.
Thanks.
14. AMAR says:
20120302 at 15:28
Hi,
I am also getting error “Nonascii input file – DSDT.dsl” while recompiling the DSDT.dsl.
thanks.
15. Michael Kuron says:
20120302 at 15:36
Did iasl d dsdt.dat yield the proper text file which you edited and does that error occur when you do iasl
tc dsdt.dsl? Maybe your iasl version has a bug (I used 20100528 from Debian Squeeze which worked
fine) or your text editor screws up character encoding — it s kind of hard to tell without knowing the
details.
Also, there are many places around the internet that explain how to recompile a DSDT and how to use
iasl, neither of which my original blog post talked about — so I d prefer to keep the comments restricted
to the actual process of injecting the dsdt.aml.
kuron-germany.de/2011/ /patching-dsdt-in-recent-linux-kernels-without-recompiling/ 4/5
3/15/12 Patching DSDT in recent Linux kernels without recompiling « Michael Kuron's Blog
16. Jasmine Hassan says:
20120304 at 23:29
This should be added to Kernel Documentation/acpi/override*.txt
Danke shen
Leave a Reply
Name (required)
Mail (will not be published) (required)
Website
S bmi Commen
Notify me of followup comments by email.
Notify me of new posts by email.
Michael Kuron's Blog is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
kuron-germany.de/2011/ /patching-dsdt-in-recent-linux-kernels-without-recompiling/ 5/5