📄 acpi-debug.html
字号:
the lowest five (5) and top five (5) lines in the trace.</p><p>Then, try to isolate the problem by booting with <acronymclass="ACRONYM">ACPI</acronym> disabled. If that works, you can isolate the <acronymclass="ACRONYM">ACPI</acronym> subsystem by using various values of <varclass="OPTION">debug.acpi.disable</var>. See the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpi&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">acpi</span>(4)</span></a> manual pagefor some examples.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN17209" name="AEN17209">11.16.3.4 System Powers Up AfterSuspend or Shutdown</a></h3><p>First, try setting <var class="OPTION">hw.acpi.disable_on_poweroff=</var>``0'' in <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=loader.conf&sektion=5"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">loader.conf</span>(5)</span></a>. Thiskeeps <acronym class="ACRONYM">ACPI</acronym> from disabling various events during theshutdown process. Some systems need this value set to ``1'' (the default) for the samereason. This usually fixes the problem of a system powering up spontaneously after asuspend or poweroff.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN17219" name="AEN17219">11.16.3.5 Other Problems</a></h3><p>If you have other problems with <acronym class="ACRONYM">ACPI</acronym> (working witha docking station, devices not detected, etc.), please email a description to the mailinglist as well; however, some of these issues may be related to unfinished parts of the<acronym class="ACRONYM">ACPI</acronym> subsystem so they might take a while to beimplemented. Please be patient and prepared to test patches we may send you.</p></div></div><div class="SECT2"><h2 class="SECT2"><a id="ACPI-ASLANDDUMP" name="ACPI-ASLANDDUMP">11.16.4 <acronymclass="ACRONYM">ASL</acronym>, <tt class="COMMAND">acpidump</tt>, and <acronymclass="ACRONYM">IASL</acronym></a></h2><p>The most common problem is the <acronym class="ACRONYM">BIOS</acronym> vendorsproviding incorrect (or outright buggy!) bytecode. This is usually manifested by kernelconsole messages like this:</p><pre class="SCREEN">ACPI-1287: *** Error: Method execution failed [\\_SB_.PCI0.LPC0.FIGD._STA] \\(Node 0xc3f6d160), AE_NOT_FOUND</pre><p>Often, you can resolve these problems by updating your <acronymclass="ACRONYM">BIOS</acronym> to the latest revision. Most console messages are harmlessbut if you have other problems like battery status not working, they're a good place tostart looking for problems in the <acronym class="ACRONYM">AML</acronym>. The bytecode,known as <acronym class="ACRONYM">AML</acronym>, is compiled from a source languagecalled <acronym class="ACRONYM">ASL</acronym>. The <acronym class="ACRONYM">AML</acronym>is found in the table known as the <acronym class="ACRONYM">DSDT</acronym>. To get a copyof your <acronym class="ACRONYM">ASL</acronym>, use <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpidump&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">acpidump</span>(8)</span></a>. Youshould use both the <var class="OPTION">-t</var> (show contents of the fixed tables) and<var class="OPTION">-d</var> (disassemble <acronym class="ACRONYM">AML</acronym> to<acronym class="ACRONYM">ASL</acronym>) options. See the <ahref="acpi-debug.html#ACPI-SUBMITDEBUG">Submitting Debugging Information</a> section foran example syntax.</p><p>The simplest first check you can do is to recompile your <acronymclass="ACRONYM">ASL</acronym> to check for errors. Warnings can usually be ignored buterrors are bugs that will usually prevent <acronym class="ACRONYM">ACPI</acronym> fromworking correctly. To recompile your <acronym class="ACRONYM">ASL</acronym>, issue thefollowing command:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">iasl your.asl</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="ACPI-FIXASL" name="ACPI-FIXASL">11.16.5 Fixing Your <acronymclass="ACRONYM">ASL</acronym></a></h2><p>In the long run, our goal is for almost everyone to have <acronymclass="ACRONYM">ACPI</acronym> work without any user intervention. At this point,however, we are still developing workarounds for common mistakes made by the <acronymclass="ACRONYM">BIOS</acronym> vendors. The Microsoft interpreter (<ttclass="FILENAME">acpi.sys</tt> and <tt class="FILENAME">acpiec.sys</tt>) does notstrictly check for adherence to the standard, and thus many <acronymclass="ACRONYM">BIOS</acronym> vendors who only test <acronymclass="ACRONYM">ACPI</acronym> under Windows never fix their <acronymclass="ACRONYM">ASL</acronym>. We hope to continue to identify and document exactly whatnon-standard behavior is allowed by Microsoft's interpreter and replicate it so FreeBSDcan work without forcing users to fix the <acronym class="ACRONYM">ASL</acronym>. As aworkaround and to help us identify behavior, you can fix the <acronymclass="ACRONYM">ASL</acronym> manually. If this works for you, please send a <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=diff&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">diff</span>(1)</span></a> of the old andnew <acronym class="ACRONYM">ASL</acronym> so we can possibly work around the buggybehavior in <acronym class="ACRONYM">ACPI-CA</acronym> and thus make your fixunnecessary.</p><p>Here is a list of common error messages, their cause, and how to fix them:</p><div class="SECT3"><h3 class="SECT3"><a id="AEN17274" name="AEN17274">11.16.5.1 _OS dependencies</a></h3><p>Some <acronym class="ACRONYM">AML</acronym> assumes the world consists of variousWindows versions. You can tell FreeBSD to claim it is any <acronymclass="ACRONYM">OS</acronym> to see if this fixes problems you may have. An easy way tooverride this is to set <var class="OPTION">hw.acpi.osname</var>=``Windows 2001'' in <ttclass="FILENAME">/boot/loader.conf</tt> or other similar strings you find in the <acronymclass="ACRONYM">ASL</acronym>.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN17283" name="AEN17283">11.16.5.2 Missing Returnstatements</a></h3><p>Some methods do not explicitly return a value as the standard requires. While <acronymclass="ACRONYM">ACPI-CA</acronym> does not handle this, FreeBSD has a workaround thatallows it to return the value implicitly. You can also add explicit Return statementswhere required if you know what value should be returned. To force <ttclass="COMMAND">iasl</tt> to compile the <acronym class="ACRONYM">ASL</acronym>, use the<var class="OPTION">-f</var> flag.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN17290" name="AEN17290">11.16.5.3 Overriding the Default<acronym class="ACRONYM">AML</acronym></a></h3><p>After you customize <tt class="FILENAME">your.asl</tt>, you will want to compile it,run:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">iasl your.asl</kbd></pre><p>You can add the <var class="OPTION">-f</var> flag to force creation of the <acronymclass="ACRONYM">AML</acronym>, even if there are errors during compilation. Remember thatsome errors (e.g., missing Return statements) are automatically worked around by theinterpreter.</p><p><tt class="FILENAME">DSDT.aml</tt> is the default output filename for <ttclass="COMMAND">iasl</tt>. You can load this instead of your <acronymclass="ACRONYM">BIOS</acronym>'s buggy copy (which is still present in flash memory) byediting <tt class="FILENAME">/boot/loader.conf</tt> as follows:</p><pre class="PROGRAMLISTING">acpi_dsdt_load="YES"acpi_dsdt_name="/boot/DSDT.aml"</pre><p>Be sure to copy your <tt class="FILENAME">DSDT.aml</tt> to the <ttclass="FILENAME">/boot</tt> directory.</p></div></div><div class="SECT2"><h2 class="SECT2"><a id="ACPI-DEBUGOUTPUT" name="ACPI-DEBUGOUTPUT">11.16.6 GettingDebugging Output From <acronym class="ACRONYM">ACPI</acronym></a></h2><p>The <acronym class="ACRONYM">ACPI</acronym> driver has a very flexible debuggingfacility. It allows you to specify a set of subsystems as well as the level of verbosity.The subsystems you wish to debug are specified as ``layers'' and are broken down into<acronym class="ACRONYM">ACPI-CA</acronym> components (ACPI_ALL_COMPONENTS) and <acronymclass="ACRONYM">ACPI</acronym> hardware support (ACPI_ALL_DRIVERS). The verbosity ofdebugging output is specified as the ``level'' and ranges from ACPI_LV_ERROR (just reporterrors) to ACPI_LV_VERBOSE (everything). The ``level'' is a bitmask so multiple optionscan be set at once, separated by spaces. In practice, you will want to use a serialconsole to log the output if it is so long it flushes the console message buffer. A fulllist of the individual layers and levels is found in the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpi&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">acpi</span>(4)</span></a> manualpage.</p><p>Debugging output is not enabled by default. To enable it, add <varclass="OPTION">options ACPI_DEBUG</var> to your kernel config if <acronymclass="ACRONYM">ACPI</acronym> is compiled into the kernel. You can add <varclass="OPTION">ACPI_DEBUG=1</var> to your <tt class="FILENAME">/etc/make.conf</tt> toenable it globally. If it is a module, you can recompile just your <ttclass="FILENAME">acpi.ko</tt> module as follows:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /sys/modules/acpi/acpi&& make clean &&make ACPI_DEBUG=1</kbd></pre><p>Install <tt class="FILENAME">acpi.ko</tt> in <tt class="FILENAME">/boot/kernel</tt>and add your desired level and layer to <tt class="FILENAME">loader.conf</tt>. Thisexample enables debug messages for all <acronym class="ACRONYM">ACPI-CA</acronym>components and all <acronym class="ACRONYM">ACPI</acronym> hardware drivers (<acronymclass="ACRONYM">CPU</acronym>, <acronym class="ACRONYM">LID</acronym>, etc.) It will onlyoutput error messages, the least verbose level.</p><pre class="PROGRAMLISTING">debug.acpi.layer="ACPI_ALL_COMPONENTS ACPI_ALL_DRIVERS"debug.acpi.level="ACPI_LV_ERROR"</pre><p>If the information you want is triggered by a specific event (say, a suspend and thenresume), you can leave out changes to <tt class="FILENAME">loader.conf</tt> and insteaduse <tt class="COMMAND">sysctl</tt> to specify the layer and level after booting andpreparing your system for the specific event. The <tt class="COMMAND">sysctl</tt>s arenamed the same as the tunables in <tt class="FILENAME">loader.conf</tt>.</p></div><div class="SECT2"><h2 class="SECT2"><a id="ACPI-REFERENCES" name="ACPI-REFERENCES">11.16.7References</a></h2><p>More information about <acronym class="ACRONYM">ACPI</acronym> may be found in thefollowing locations:</p><ul><li><p>The <a href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-acpi"target="_top">FreeBSD ACPI mailing list</a></p></li><li><p>The <acronym class="ACRONYM">ACPI</acronym> Mailing List Archives <ahref="http://lists.freebsd.org/pipermail/freebsd-acpi/"target="_top">http://lists.freebsd.org/pipermail/freebsd-acpi/</a></p></li><li><p>The old <acronym class="ACRONYM">ACPI</acronym> Mailing List Archives <ahref="http://home.jp.FreeBSD.org/mail-list/acpi-jp/"target="_top">http://home.jp.FreeBSD.org/mail-list/acpi-jp/</a></p></li><li><p>The <acronym class="ACRONYM">ACPI</acronym> 2.0 Specification <ahref="http://acpi.info/spec.htm" target="_top">http://acpi.info/spec.htm</a></p></li><li><p>FreeBSD Manual pages: <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpi&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">acpi</span>(4)</span></a>, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpi_thermal&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">acpi_thermal</span>(4)</span></a>, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpidump&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">acpidump</span>(8)</span></a>, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=iasl&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">iasl</span>(8)</span></a>, <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpidb&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">acpidb</span>(8)</span></a></p></li><li><p><a href="http://www.cpqlinux.com/acpi-howto.html#fix_broken_dsdt"target="_top"><acronym class="ACRONYM">DSDT</acronym> debugging resource</a>. (UsesCompaq as an example but generally useful.)</p></li></ul></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="acpi-overview.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="boot.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Power and Resource Management</td><td width="34%" align="center" valign="top"><a href="config-tuning.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">The FreeBSD Booting Process</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting <<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>>.<br />For questions about this documentation, e-mail <<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>>.</small></p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -