📄 acpi-overview.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Power and Resource Management</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="Configuration and Tuning" href="config-tuning.html" /><link rel="PREVIOUS" title="Adding Swap Space" href="adding-swap-space.html" /><link rel="NEXT" title="Using and Debugging FreeBSD ACPI" href="acpi-debug.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="adding-swap-space.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 11 Configuration and Tuning</td><td width="10%" align="right" valign="bottom"><a href="acpi-debug.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="ACPI-OVERVIEW" name="ACPI-OVERVIEW">11.15 Power and ResourceManagement</a></h1><i class="AUTHORGROUP"><span class="CONTRIB">Written by</span> Hiten Pandya and TomRhodes.</i> <p>It is very important to utilize hardware resources in an efficient manner. Before<acronym class="ACRONYM">ACPI</acronym> was introduced, it was very difficult andinflexible for operating systems to manage the power usage and thermal properties of asystem. The hardware was controlled by some sort of <acronymclass="ACRONYM">BIOS</acronym> embedded interface, such as <span class="emphasis"><iclass="EMPHASIS">Plug and Play BIOS (PNPBIOS)</i></span>, or <span class="emphasis"><iclass="EMPHASIS">Advanced Power Management (APM)</i></span> and so on. Power and ResourceManagement is one of the key components of a modern operating system. For example, youmay want an operating system to monitor system limits (and possibly alert you) in caseyour system temperature increased unexpectedly.</p><p>In this section of the FreeBSD Handbook, we will provide comprehensive informationabout <acronym class="ACRONYM">ACPI</acronym>. References will be provided for furtherreading at the end. Please be aware that <acronym class="ACRONYM">ACPI</acronym> isavailable on FreeBSD 5.X and above systems as a default kernel module. ForFreeBSD 4.9, <acronym class="ACRONYM">ACPI</acronym> can be enabled by adding theline <var class="LITERAL">device acpica</var> to a kernel configuration andrebuilding.</p><div class="SECT2"><h2 class="SECT2"><a id="ACPI-INTRO" name="ACPI-INTRO">11.15.1 What Is ACPI?</a></h2><p>Advanced Configuration and Power Interface (<acronym class="ACRONYM">ACPI</acronym>)is a standard written by an alliance of vendors to provide a standard interface forhardware resources and power management (hence the name). It is a key element in <spanclass="emphasis"><i class="EMPHASIS">Operating System-directed configuration and PowerManagement</i></span>, i.e.: it provides more control and flexibility to the operatingsystem (<acronym class="ACRONYM">OS</acronym>). Modern systems ``stretched'' the limitsof the current Plug and Play interfaces (such as APM, which is used in FreeBSD 4.X),prior to the introduction of <acronym class="ACRONYM">ACPI</acronym>. <acronymclass="ACRONYM">ACPI</acronym> is the direct successor to <acronymclass="ACRONYM">APM</acronym> (Advanced Power Management).</p></div><div class="SECT2"><h2 class="SECT2"><a id="ACPI-OLD-SPEC" name="ACPI-OLD-SPEC">11.15.2 Shortcomings ofAdvanced Power Management (APM)</a></h2><p>The <span class="emphasis"><i class="EMPHASIS">Advanced Power Management(APM)</i></span> facility controls the power usage of a system based on its activity. TheAPM BIOS is supplied by the (system) vendor and it is specific to the hardware platform.An APM driver in the OS mediates access to the <span class="emphasis"><iclass="EMPHASIS">APM Software Interface</i></span>, which allows management of powerlevels.</p><p>There are four major problems in APM. Firstly, power management is done by the(vendor-specific) BIOS, and the OS does not have any knowledge of it. One example ofthis, is when the user sets idle-time values for a hard drive in the APM BIOS, that whenexceeded, it (BIOS) would spin down the hard drive, without the consent of the OS.Secondly, the APM logic is embedded in the BIOS, and it operates outside the scope of theOS. This means users can only fix problems in their APM BIOS by flashing a new one intothe ROM; which is a very dangerous procedure with the potential to leave the system in anunrecoverable state if it fails. Thirdly, APM is a vendor-specific technology, whichmeans that there is a lot of parity (duplication of efforts) and bugs found in onevendor's BIOS, may not be solved in others. Last but not the least, the APM BIOS did nothave enough room to implement a sophisticated power policy, or one that can adapt verywell to the purpose of the machine.</p><p><span class="emphasis"><i class="EMPHASIS">Plug and Play BIOS (PNPBIOS)</i></span> wasunreliable in many situations. PNPBIOS is 16-bit technology, so the OS has to use 16-bitemulation in order to ``interface'' with PNPBIOS methods.</p><p>The FreeBSD <acronym class="ACRONYM">APM</acronym> driver is documented in the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=apm&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">apm</span>(4)</span></a> manualpage.</p></div><div class="SECT2"><h2 class="SECT2"><a id="ACPI-CONFIG" name="ACPI-CONFIG">11.15.3 Configuring <acronymclass="ACRONYM">ACPI</acronym></a></h2><p>The <tt class="FILENAME">acpi.ko</tt> driver is loaded by default at start up by the<a href="http://www.FreeBSD.org/cgi/man.cgi?query=loader&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">loader</span>(8)</span></a> and should<span class="emphasis"><i class="EMPHASIS">not</i></span> be compiled into the kernel.The reasoning behind this is that modules are easier to work with, say if switching toanother <tt class="FILENAME">acpi.ko</tt> without doing a kernel rebuild. This has theadvantage of making testing easier. Another reason is that starting <acronymclass="ACRONYM">ACPI</acronym> after a system has been brought up is not too useful, andin some cases can be fatal. In doubt, just disable <acronymclass="ACRONYM">ACPI</acronym> all together. This driver should not and can not beunloaded because the system bus uses it for various hardware interactions. <acronymclass="ACRONYM">ACPI</acronym> can be disabled with the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpiconf&sektion=8&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">acpiconf</span>(8)</span></a>utility. In fact most of the interaction with <acronym class="ACRONYM">ACPI</acronym> canbe done via <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpiconf&sektion=8&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">acpiconf</span>(8)</span></a>.Basically this means, if anything about <acronym class="ACRONYM">ACPI</acronym> is in the<a href="http://www.FreeBSD.org/cgi/man.cgi?query=dmesg&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">dmesg</span>(8)</span></a> output, thenmost likely it is already running.</p><div class="NOTE"><blockquote class="NOTE"><p><b>Note:</b> <acronym class="ACRONYM">ACPI</acronym> and <acronymclass="ACRONYM">APM</acronym> cannot coexist and should be used separately. The last oneto load will terminate if the driver notices the other running.</p></blockquote></div><p>In the simplest form, <acronym class="ACRONYM">ACPI</acronym> can be used to put thesystem into a sleep mode with <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpiconf&sektion=8&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">acpiconf</span>(8)</span></a>, the<var class="OPTION">-s</var> flag, and a <var class="LITERAL">1-5</var> option. Mostusers will only need <var class="LITERAL">1</var>. Option <var class="LITERAL">5</var>will do a soft-off which is the same action as:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">halt -p</kbd></pre><p>The other options are available. Check out the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=acpiconf&sektion=8&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">acpiconf</span>(8)</span></a>manual page for more information.</p></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="adding-swap-space.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="acpi-debug.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Adding Swap Space</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">Using and Debugging FreeBSD <acronymclass="ACRONYM">ACPI</acronym></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 + -