public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Drunkard Zhang <gongfan193@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	trivial@kernel.org, Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: Dead URL in Documentation/acpi/dsdt-override.txt
Date: Wed, 29 May 2013 23:38:48 -0500	[thread overview]
Message-ID: <1369888728.2776.46@driftwood> (raw)
In-Reply-To: <CAJiejCSQOGP-8fyKgw2pgkGNZ9uQSG0vU_OsQDuK8iMJkq5sOA@mail.gmail.com> (from gongfan193@gmail.com on Tue May 28 21:45:35 2013)

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

On 05/28/2013 09:45:35 PM, Drunkard Zhang wrote:
> The domain name www.lesswatts.org in
> Documentation/acpi/dsdt-override.txt is unresolvable, so the URL is
> dead too.

Judging solely from the t-shirt they gave me at OLS 2008, I knew the  
website probably wasn't long for the world. (It lasted longer than I  
expected.)

> I found some good docs in this topic:
> 
> http://wiki.debian.org/OverridingDSDT

The original is at  
http://web.archive.org/web/20120328105600/http://www.lesswatts.org/projects/acpi/overridingDSDT.php  
and since all this file does is link you to the (now defunct) web page,  
I'll just copy it inline. (And cc: Arjan, who was the contact for that  
website...)

(Sorry for the attachment, but balsa is crap and I've forgotten step  
twelve of sending a non-whitespace damaged inline patch through it.  
Something about frogs.)

Rob

[-- Attachment #2: blah2.patch --]
[-- Type: text/x-patch, Size: 4248 bytes --]

From: Rob Landley <rob@landley.net>

Copy text from archive.org copy of lesswatts.org inline, replacing dead link.

Signed-off-by: Rob Landley <rob@landley.net>
---

 Documentation/acpi/dsdt-override.txt |  110 ++++++++++++++++++++++++-
 1 file changed, 107 insertions(+), 3 deletions(-)


diff --git a/Documentation/acpi/dsdt-override.txt b/Documentation/acpi/dsdt-override.txt
index febbb1b..7011e0d 100644
--- a/Documentation/acpi/dsdt-override.txt
+++ b/Documentation/acpi/dsdt-override.txt
@@ -2,6 +2,110 @@ Linux supports a method of overriding the BIOS DSDT:
 
 CONFIG_ACPI_CUSTOM_DSDT builds the image into the kernel.
 
-When to use this method is described in detail on the
-Linux/ACPI home page:
-http://www.lesswatts.org/projects/acpi/overridingDSDT.php
+Overriding a DSDT
+
+-- Why override a DSDT?
+
+The DSDT (Differentiated System Description Table) is the primary AML table in
+the BIOS. Per the description of acpidump, the DSDT can be extracted from the
+machine, the ASL modified, and a new AML DSDT can be compiled. The sections
+below show two ways to tell Linux to use this modified DSDT instead of the
+version that came with the BIOS.
+
+In the early days of Linux/ACPI, DSDT modifications were common to work around
+both BIOS bugs and Linux bugs. However, the stated goal of the Linux/ACPI
+project today is that Linux should run on un-modified firmware. Thus, the DSDT
+database at the old http://acpi.sourceforge.net web site is now largely a
+historical artifact.
+
+-- Where do I get iasl for dis-assembling and compiling tables?
+
+iASL is part of the ACPICA release at http://acpica.org.  Note that "iasl -d"
+can now not only dis-assemble a DSDT and SSDT, but also most other ACPI table
+images.
+
+-- What if I also want to override the SSDTs?
+
+If you need to modify the code present in an SSDT, then combine all of the
+SSDTs into a DSDT override, modify it as necessary, and boot with
+"acpi_no_auto_ssdt" to prevent Linux from automatically loading the SSDTs
+listed in the RSDT/XSDT.
+
+-- Is it important if my DSDT doesn't re-compile
+
+Not necessarily. Many static ASL bugs that are rejected by iASL have
+workarounds present in the Linux kernel. This is because even if you might be
+able to modify and override your DSDT, most users with a system like yours
+cannot.
+
+Of course you need to get the DSDT to re-compile if you want to run your
+modifications.
+
+-- How to print to the Linux console from AML
+
+When CONFIG_ACPI_DEBUG=y and when acpi.debug_level & 0x8, ASL stores to the
+special object "Debug" will come out in the dmesg. eg
+
+  Store("hello world!", Debug)
+
+  Store(Local0, Debug)
+
+
+  [ACPI Debug] String: [0x0C] "hello world!"
+
+  [ACPI Debug] Integer: 0x00000042
+
+-- How to Build a custom DSDT into the kernel
+
+Get original DSDT:
+
+  # cp /proc/acpi/dsdt DSDT
+
+or
+
+  # acpidump > acpidump.out
+  $ acpixtract DSDT acpidump > DSDT.dat
+
+Disassemble it
+
+  $ iasl -d DSDT.dat
+
+Make your changes:
+
+  $ vi DSDT.dsl
+
+Build it:
+
+  $ iasl -tc DSDT.dsl
+
+Put it where the kernel build can include it:
+
+  $ cp DSDT.hex $SRC/include/
+
+Add this to the kernel .config:
+
+  CONFIG_STANDALONE=n
+  CONFIG_ACPI_CUSTOM_DSDT=y
+  CONFIG_ACPI_CUSTOM_DSDT_FILE="DSDT.hex"
+
+Make the kernel and off you go!
+
+  You should see in dmesg: 
+  Table [DSDT] replaced by host OS
+
+-- How to build a custom DSDT into an initrd
+
+If you are unable to re-build the kernel, or you'd like to run the same kernel
+binary on multiple machines that require different DSDT overrides, then the
+initrd method should suit your needs. This method is enabled using
+CONFIG_ACPI_CUSTOM_DSDT_INITRD, and you can tell if a kernel binary includes
+it by finding the following line in the console log:
+
+  "ACPI: Checking initramfs for custom DSDT"
+
+The process for creating the DSDT image is the same as above. But note that the
+format of the table included in the initramfs is binary (iasl -ta), while if
+you build a DSDT into the kernel, C-source code is used (iasl -tc).
+
+In case your mkinitrd tool does not support this feature, a script is provided

      parent reply	other threads:[~2013-05-30  4:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29  2:45 Dead URL in Documentation/acpi/dsdt-override.txt Drunkard Zhang
2013-05-29  8:33 ` Fwd: " Drunkard Zhang
2013-05-30  4:38 ` Rob Landley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1369888728.2776.46@driftwood \
    --to=rob@landley.net \
    --cc=arjan@linux.intel.com \
    --cc=gongfan193@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox