⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 acpi-debug.html

📁 这是很好的学习嵌入式LINUX的文章
💻 HTML
📖 第 1 页 / 共 2 页
字号:
partition. You can get a backtrace in <acronym class="ACRONYM">DDB</acronym> with <varclass="OPTION">tr</var>. If you have to handwrite the backtrace, be sure to at least getthe 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 <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">acpi</span>(4)</span> manual page for some examples.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN17069" name="AEN17069">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<span class="CITEREFENTRY"><span class="REFENTRYTITLE">loader.conf</span>(5)</span>. 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="AEN17079" name="AEN17079">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 <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">acpidump</span>(8)</span>. You should use both the <varclass="OPTION">-t</var> (show contents of the fixed tables) and <varclass="OPTION">-d</var> (disassemble <acronym class="ACRONYM">AML</acronym> to <acronymclass="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 <spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">diff</span>(1)</span> of the old and new<acronym class="ACRONYM">ASL</acronym> so we can possibly work around the buggy behaviorin <acronym class="ACRONYM">ACPI-CA</acronym> and thus make your fix unnecessary.</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="AEN17134" name="AEN17134">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="AEN17143" name="AEN17143">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="AEN17150" name="AEN17150">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 <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">acpi</span>(4)</span> manual page.</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&amp;&amp; make clean &amp;&amp;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.7.References</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 邮件列表</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 标准 <ahref="http://acpi.info/spec.htm" target="_top">http://acpi.info/spec.htm</a></p></li><li><p>FreeBSD 手册页: <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">acpi</span>(4)</span>, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">acpi_thermal</span>(4)</span>, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">acpidump</span>(8)</span>, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">iasl</span>(8)</span>, <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">acpidb</span>(8)</span></p></li><li><p><a href="http://www.cpqlinux.com/acpi-howto.html#fix_broken_dsdt"target="_top"><acronym class="ACRONYM">DSDT</acronym> 调试资源</a>. (使用 Compaq作为例子但通常情况下都很有用。)</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">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">起点</a></td><td width="33%" align="right" valign="top"><a href="boot.html"accesskey="N">前进</a></td></tr><tr><td width="33%" align="left" valign="top">电源和资源管理</td><td width="34%" align="center" valign="top"><a href="config-tuning.html"accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">FreeBSD引导过程</td></tr></table></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -