https://wiki.archlinux.org/api.php?action=feedcontributions&user=Winguru&feedformat=atomArchWiki - User contributions [en]2024-03-29T14:52:54ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=DSDT&diff=106495DSDT2010-05-17T14:56:42Z<p>Winguru: </p>
<hr />
<div>[[Category:Boot process (English)]]<br />
[[Category:Kernel (English)]]<br />
[[Category:HOWTOs (English)]]<br />
[[Category: Power management (English)]]<br />
DSDT (Differentiated System Description Table) is a part of the [[ACPI]] specification and it supplies configuration information about a base system. ACPI capable computers come with a preinstalled DSDT from the manufacturer. A common linux problem is missing ACPI functionality (fans not running, screens not turning off when the lid is closed, etc.) stemming from DSDTs made with Windows specifically in mind. The solution that this article will try to detail is replacing the default DSDT with a 'fixed' version. Note that this fix can also be accomplished during installation ("Will you need support for custom DSDT?") but requires you to have a custom DSDT ready at hand. AFAICT there is no difference between using the installation method and doing it later.<br />
<br />
==Replacing the DSDT==<br />
<br />
==="Lions and tigers and bears, oh my!"===<br />
This fix does mess about with some fairly fundamental stuff on your Arch install. However, note that ''as long as you can restart your Arch install (e.g. using the fallback image), nothing about what this howto describes is irreversible''. See the section 'Recovery' for details. If you're very unsure, you might wish to [[Disk cloning | clone your disk]] beforehand.<br />
<br />
===Step one: Get hold of fixed DSDT===<br />
A DSDT file is originally written in ACPI Source language (an .asl/.dsl file). Using a compiler this can produce an 'ACPI Machine Language' file (.aml) or a hex table (.hex). To incorporate the file in your Arch install, you'll need to get hold of a compiled .aml file. - whether this means compiling it yourself or trusting some guy on the internet is up to you.<br />
==== "Compiling it yourself" ====<br />
In short, you can use Intel's ASL compiler (in the repos) to turn your systems DSDT table (residing in /sys/firmware/acpi/tables/DSDT) into source code, locate and fix the errors (the compiled files will typically have been made using Microsoft's compiler rather than Intel's more stringent one... need we say more?), and recompile. This process is detailed far more comprehensively and better at the [http://en.gentoo-wiki.com/wiki/ACPI/Fix_common_problems Gentoo wiki]. It's well written and the process is a lot easier than it sounds and far faster than reading about it. ''Page appears to have been lost in the great gentoo-wiki-meltdown of 2008 - [http://www.gentoo-wiki.info/ACPI/Fix_common_problems this] looks like a copy of the original.''<br />
<br />
==== "Some guy on the internet" ====<br />
* There is a database of sorts of user produced fixes on sourceforge: http://acpi.sourceforge.net/dsdt/. Sadly, this is not very well maintained and more than half the entries are just weird noise spam. If you do download a file from there, it'll most likely be a compressed .asl file, so you'll need to unzip it and compile it. You should really read the Gentoo wiki for that but the upshot is: get iasl from the community repo, unzip the file into a directory of its own and run<br />
<pre>iasl -tc ''.asl/.dsl file''</pre><br />
on it and if it says no errors and no warnings you should be good to go.<br />
* Arch users with the same laptop as you are a minority of a minority of a minority. Try browsing other distro/linux forums for talk about the same model. Likelihood is that they have the same problems and either because there is a lot of them (Ubuntu) or because they're tech wizards (Gentoo?) someone there has produced a working DSDT and maybe even provides a precompiled version (again, use at your own risk).<br />
* Google Is Your Friend: Try keeping it sweet and short - model name and dsdt will probably produce results.<br />
<br />
Remember, regardless of how you get a file, you'll need a compiled ACPI Machine Language file for the next step.<br />
<br />
===Step Two: Get the file loaded at startup===<br />
<br />
Note : DSDT hooks for mkinitcpio have been removed as of kernel 2.6.30, please compile dsdt directly into the kernel as explained here : http://www.lesswatts.org/projects/acpi/overridingDSDT.php<br />
<br />
==== Disclaimer ====<br />
This part is going to describe how to rebuild your startup image (kernel26.img) so that your custom DSDT file will get loaded instead of the maunfacturer's. This is fairly technical subject mattter (which I don't understand much of) so this is pretty much pure howto. See [[Configuring mkinitcpio]] for a more detailed description of the things at work here. If things go wrong this shifts the blame back to you.<br />
<br />
==== Using mkinitcpio to create a new boot image ====<br />
* Cp your compiled file to /lib/initcpio/custom.dsdt<br />
* The last line of /etc/mkinitcpio.conf (HOOKS="....") lists in standard arch style "the hooks that are executed on image creation and on runtime in the exact order they are listed". You'll need to add 'dsdt' to this list if it's not already there. Save the file.<br />
* mkinitcpio is the program that creates the startup image based on /etc/mkinitcpio.conf. Get it from the repos: <br />
<pre>pacman -S mkinitcpio.</pre><br />
* Run mkinitcpio as root. Simply entering <br />
<pre>mkinitcpio</pre><br />
will do a dry test run. Note that a succes here or when you run the command for real is no guarantee that the generated image will actually work. The 'succes' announced is whether or not an image file was generated. <br />
<pre>mkinitcpio -p kernel26</pre> <br />
will create both the standard and the fallback image. If you're feeling less adventurous, you might wish to first try <br />
<pre>mkinitcpio -g /boot/kernel26.img</pre><br />
which will only create the standard image, so you can... well fall back on the other one in case things don't work out. If/when they do work out, you can always run the command with the -p option after the first test.<br />
<br />
=== Step three: Test your new image ===<br />
If mkinitcpio succesfully created an image, you should be ready to reboot now. If things go well, you'll boot into your ordinary Arch setup, the only difference being a properly working fan, lid, whatever misbehaved. If they don't <br />
* Make a note of the error messages<br />
* Restart<br />
* Choose the fallback image option from GRUB (assuming you didn't overwrites that one too)<br />
<br />
====Recovery from a bad image====<br />
Remove the dsdt hook from /etc/mkinitcpio.conf, delete the custom.dsdt file and use mkinitcpio to create the images again:<br />
<pre>mkinitcpio -p kernel26</pre> <br />
<br />
If you want to persist, try one of the following:<br />
* Read the other wiki articles (really) and try again.<br />
* Try forums (again)<br />
* Read/edit wiki<br />
* Leave distro in anger, vow revenge<br />
<br />
== External Links ==<br />
* [http://en.gentoo-wiki.com/wiki/ACPI/Fix_common_problems The Gentoo wiki article]<br />
* [http://acpi.sourceforge.net/dsdt/index.php The sourceforge database]<br />
* [http://www.cpqlinux.com/acpi-howto.html#fix_broken_dsdt Howto for fixing errors in DSDT files]<br />
* [http://news.skelter.net/articles/2008/07/28/bill-gates-on-sabotaging-acpi-for-linux Bill Gates on Making ACPI Not Work with Linux] - when things go wrong it's nice to have someone to yell at...</div>Winguru