mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
Translated
This commit is contained in:
parent
81f83ce931
commit
621911c909
@ -1,110 +0,0 @@
|
||||
Translating------------------geekpi
|
||||
|
||||
09 The Linux Kernel: Configuring the Kernel Part 5
|
||||
================================================================================
|
||||

|
||||
|
||||
The Linux kernel is large with numerous features that can be configured. There are still many more features that can be configured.
|
||||
|
||||
The next kernel feature that can be configured is a x86 random number generator (x86 architectural random number generator (ARCH_RANDOM)). Remember, we are configuring the kernel source code for an AMD64 system. This number generator uses the x86 RDRAND instructions for Intel processors. It is not necessary for general use, so I will disable this for a more lightweight kernel.
|
||||
|
||||
Next, we can enable or disable "Supervisor Mode Access Prevention (X86_SMAP)". This is a security feature used by some Intel processors. SMAP will only allow the kernel to access user-space in some instances. This helps to protect user-space. There is a performance and size cost if enabled, but the cost is small. Since I am configuring for an AMD system, I will disable this feature.
|
||||
|
||||
|
||||
Developers can enable "EFI runtime service support (EFI)". Only enable this on systems with EFI firmware. With this feature, the kernel can use available EFI services. EFI is a specification of how the operating system interacts with the hardware, so EFI firmware is hardware code that uses this specification. I disabled the support since I do not have a system with EFI firmware.
|
||||
|
||||
This is a useful security method that should be enabled (Enable seccomp to safely compute untrusted bytecode (SECCOMP)). This security feature is used with number crunching applications (software that performs extensive calculations) that use untrusted bytecode. Bytecode (p-code/portable code) is code that is made to be read efficiently by an interpreter. Bytecode is not source code, but it is not assembly or binary code either. Untrusted code is code that may cause system/data damage. The untrusted bytecode that may ruin the system or harm data are isolated in a separate address space via seccomp. This is done by using file descriptors as methods of transport. In general, it is best to enable security features even at the cost of performance unless you are making a kernel that absolutely needs incredible performance abilities.
|
||||
|
||||
Here is another security feature (Enable -fstack-protector buffer overflow detection (CC_STACKPROTECTOR)). A buffer overflow (buffer overrun) is where data is written past its memory boundary and into adjacent memory. This can be a security threat. Some malware uses buffer overruns to exploit systems. Enabling this will use the "-fstack-protector" GCC parameter. GCC is a Linux compiler; this compiler will compile the kernel when you are done configuring the options. This compiler parameter will add a canary value (special security code) on the stack just before the return address. The value is validated before the return. When a buffer overflow occurs, the canary value will get overwritten. When this happens, a kernel panic is initiated. As many know, a kernel panic means the system will crash, but that is better than the system or data being permanently ruined. With a kernel panic, the system can be rebooted, but if a buffer overrun gains a chance to damage the system, a simple reboot will not fix the destruction. You must compile the kernel with GCC version 4.2 or higher to support the parameter.
|
||||
|
||||
NOTE: To figure out what version you have, type “gcc --version” in the command-line.
|
||||
|
||||
After that, we can configure the timer frequency. The configuration tool recommends 250Hz, so we will use that value.
|
||||
|
||||
Timer frequency
|
||||
1. 100 HZ (HZ_100)
|
||||
> 2. 250 HZ (HZ_250)
|
||||
3. 300 HZ (HZ_300)
|
||||
4. 1000 HZ (HZ_1000)
|
||||
choice[1-4?]: 2
|
||||
|
||||
Using 1000HZ is generally considered too fast for many systems. The timer frequency determines how often the timer interrupt is used. This helps the system operate on a timeline. Applications do not just execute a command randomly. Rather, they wait until a timer interrupt has gone off. This keeps process organized and structured. The time between interrupts on a timer frequency of 100HZ is 10ms, 250HZ is 4ms, and 1000HZ is 1ms. Now, many developers will instantly think that 1000HZ is the best. Well, it depends what effects you will be fine with. A large timer frequency means more power consumption and with more energy being utilized, more heat will be produced. More heat means the hardware may wear down faster.
|
||||
|
||||
NOTE: If a particular feature does not matter to you specifically or you are not sure what to choose, use the default value chosen by the configuration tool. For example, for the kernel that I am making, it does not matter to me which timer value to use. In summary, if you do not have a specific reason to select any of the choices, the default is fine.
|
||||
|
||||
This interesting system call may be useful to some users (kexec system call (KEXEC)). The kexec call shuts down the current kernel to start another or restart the current. The hardware is not powered-off and this call works without help from the firmware. The bootloader is not executed. (The bootloader is the software that starts the operating system) This restart takes place at the level of the operating system not the hardware. Using this system call is faster than performing a standard power-off or restart. This keeps the hardware on. This system call will not work on all systems. For maximum performance, enable hotplugging.
|
||||
|
||||
To use kexec, use the command below replacing “<kernel-image>” with the kernel that will be used after reboot. Also, replace “<command-line-options>” with some of those kernel parameters we had discussed previously. (I will go into greater depth in a later article.)
|
||||
|
||||
kexec -l <kernel-image> --append="<command-line-options>”
|
||||
|
||||
Specifically, I would type “kexec -l /boot/vmlinuz-3.8.0-27-generic –append="root=/dev/sda1””
|
||||
|
||||
NOTE: The hardware does need to be reset sometimes, so do not depend on kexec entirely.
|
||||
|
||||
Next, we have a debugging feature that works with kexec (kernel crash dumps (CRASH_DUMP)). When kexec is called, a crash dump is generated. Unless you need to debug kexec, this is not needed. I disabled this feature.
|
||||
|
||||
Again, we have another kexec feature (kexec jump (KEXEC_JUMP)). kexec jump allows users to switch between the original kernel and the one started by kexec.
|
||||
|
||||
It is best to use the default value for the address the kernel starts (Physical address where the kernel is loaded (PHYSICAL_START) [0x1000000]).
|
||||
|
||||
This next kernel option (Build a relocatable kernel (RELOCATABLE)) allows the kernel to be placed somewhere else in the memory. The kernel file will be 10% larger, but this excess is removed from memory on execution. Many may wonder why this is important. Before kernel 2.6.20, rescue kernel had to be configured and compiled differently to be able to run on a different memory address. After this feature was invented, developers no longer needed to make two kernels. A rescue kernel will not load where the first kernel is/was loaded because that portion of memory is occupied or corrupted. (If you are using a rescue kernel then obviously the first kernel had errors)
|
||||
|
||||
This feature should be enabled on systems where CPUs can be added unless there is a specific reason for not doing so (Support for hot-pluggable CPUs (HOTPLUG_CPU)). The configuration tool may auto-enable this ability. With this feature, you can active/deactivate a CPU on a system that has many processors. This does not mean adding a new CPU to a system. All CPUs must already be in the system.
|
||||
|
||||
The next option will allow us to set whether the above ability is enabled by default (Set default setting of cpu0_hotpluggable (BOOTPARAM_HOTPLUG_CPU0)). It is better to have this feature inactive for performance purposes until it is needed.
|
||||
|
||||
This debugging feature allows developers to debug the CPU hotplug abilities (Debug CPU0 hotplug (DEBUG_HOTPLUG_CPU0)). I disabled this feature.
|
||||
|
||||
To support older versions of glibc (<2.3.3), enable this feature (Compat VDSO support (COMPAT_VDSO)). This will apply the old-style address via map on the 32-bit VDSO. Glibc is Gnu C LIBrary; this is the GNU Project's implementation of the C standard library.
|
||||
|
||||
If the system the kernel is intended for lacks a fully functional boot-loader, then enable this feature (Built-in kernel command line (CMDLINE_BOOL)). This will allow users to use a command-line on the kernel itself so administrators can fix kernel issues. If the bootloader has a command-line (like Grub), then this feature is not needed.
|
||||
|
||||
Now, we can configure ACPI and power. First, we are given the choice to allow the system to suspend to RAM (Suspend to RAM and standby (SUSPEND)). Advanced Configuration and Power Interface (ACPI) is an open standard for device configuration and power management. Suspending a system places data on RAM and the hardware goes into a low-power state. The system is not shutdown entirely. This is useful if a user needs to put the computer in a low-power state but wants to retain the currently open applications. Shutting-down a system completely powers off a system and clears the memory.
|
||||
|
||||
Next, we can enable hibernation (Hibernation (aka 'suspend to disk') (HIBERNATION)). Hibernation is like suspend mode, but all data in the memory is saved to the hard-drive and the device is completely powered-off. This allows the user to continue using their open applications when the system is powered back on.
|
||||
|
||||
Here, we can set the default resume partition (Default resume partition (PM_STD_PARTITION)). Very few developers and administrators will need this feature. When a system returns from hibernation, it will load off of the default resume partition.
|
||||
|
||||
After that, we can enable "Opportunistic sleep (PM_AUTOSLEEP)". This lets the kernel to initiate suspend or sleep mode when no active wakeup calls are called. This means that an idling system will initiate suspend mode to save energy. I enabled this feature.
|
||||
Next, we are asked about "User space wakeup sources interface (PM_WAKELOCKS)". Enabling this will allow wakeup source objects to be activated, deactivated, and created by the user space via a sysfs-based interface. Wakeup source objects track the source of wakeup events.
|
||||
|
||||
Sysfs is a virtual filesystem located /sys/. This virtual filesystem contains information about devices. When going to /sys/, it appears to be part of the hard-drive, but this is really a mount point. The files are actually found in the memory. This is the same concept for /proc/.
|
||||
|
||||
NOTE: “/sysfs/” is a folder while “/sysfs” would be a file on the root named “sysfs”. Many Linux users mix up the two naming conventions.
|
||||
|
||||
If the above option is enabled, then you can set the "Maximum number of user space wakeup sources (0 = no limit) (PM_WAKELOCKS_LIMIT)". It may be best to select the default. Then, you can enable the garbage collector (Garbage collector for user space wakeup sources (PM_WAKELOCKS_GC)). Garbage collection is a memory management method.
|
||||
|
||||
NOTE: On systems that need more memory, it is usually best in most cases to enable as many garbage collectors as possible. Otherwise, the memory will fill up faster and be disorganized.
|
||||
|
||||
The next power option concerns IO devices (Run-time PM core functionality (PM_RUNTIME)). This option will permit IO hardware to go into low power states on run time. The hardware must allow this feature; not all hardware will do this.
|
||||
|
||||
As with many other components of the kernel, the power-management code also has debugging support, if enabled (Power Management Debug Support). I will disable this option.
|
||||
|
||||
NOTE: Notice that the options/questions from the configuration tool that I quote/display are no longer showing the option code (the letters in all caps between the parenthesis). This is because I am no using the ncurses-based configuration tool (make menuconfig) instead of the default tool to get the options/settings/questions. Remember, “make config” lacks the ability to save the current progress.
|
||||
|
||||
After that, the configuration tool will enable "ACPI (Advanced Configuration and Power Interface) Support". It is best to allow this power management specification. Usually, the configuration file will enable this feature.
|
||||
|
||||
To allow backwards compatibility, enable "Deprecated /proc/acpi files". The new implementation uses the newer functions in /sys/. I disabled this option. A similar question asks about "Deprecated power /proc/acpi directories". Usually, if you disable the files, you will not need the folders, so I disabled them. Some older applications may use these files and folders. If you are compiling a new kernel for an old Linux system, it may be best to enable this option.
|
||||
|
||||
Next, we have another file interface that can be enabled/disabled (EC read/write access through). This will create an embedded controller interface in /sys/kernel/debug/ec/. Embedded controllers usually are found in laptops to read the sensors. The Linux kernel accesses the embedded controllers through ACPI code given by the BIOS tables of the system.
|
||||
|
||||
Here is another old feature that can be enabled for backwards compatibility (Deprecated /proc/acpi/event support). The acpid daemon may read /proc/acpi/event to manage ACPI-generated events. Instead of this interface, the daemon uses netlink events or input layer to get these events to the user-space. The acpid daemon manages ACPI events.
|
||||
|
||||
The next option allows developers to enable a feature that will inform the kernel whether it is using AC or battery (AC adapter). The next option provides battery information from /proc/acpi/battery/ (Battery).
|
||||
|
||||
To allow the kernel to behave differently when the power/sleep button is pressed or when the lid is closed, enable this option (Button). These events are controlled in /proc/acpi/event/. For instance, this will make the system suspend when the laptop lid is closed if in the user account power options such a behavior is enabled. On many Linux distros, users can go to the system settings to make the laptop stop suspending when the lid is closed.
|
||||
|
||||
The next ACPI extension to be enable/disabled is for video adapters (Video).
|
||||
|
||||
ACPI fans can be enabled/disabled (Fan). It is best to enable ACPI fans management. This will help to conserve energy.
|
||||
|
||||
We are getting further in configuring the kernel, but there is still more to do in the next articles.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linux.org/threads/the-linux-kernel-configuring-the-kernel-part-5.4424/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,110 @@
|
||||
09 Linux内核: 配置内核 (Part 5)
|
||||
================================================================================
|
||||

|
||||
|
||||
Linux内核拥有许多特性可以被配置。还有许多的特性要配置。
|
||||
|
||||
下一个可以配置的特性是x86的随机数生成器(x86 architectural random number generator (ARCH_RANDOM))。记住,我们现在配置的是AMD64系统的内核代码。这个随机数生成器使用Intel x86的RDRAND指令。这并不通用,所以为了一个更轻量的内核我禁用了它。
|
||||
|
||||
接着,我们可以启用或者禁用"Supervisor Mode Access Prevention (X86_SMAP)"。这是Intel处理器使用的安全特性。SWAP在一些实例中只会允许内核访问用户空间。这个有助于保护用户空间。如果启用,这里有一点性能和大小的开销,但是开销很小。由于我是用的是AMD系统,所以我禁用了这个特性。
|
||||
|
||||
开发者可以启用"EFI runtime service support (EFI)"。只有在有EFI固件的系统上启用它。拥有这个特性,内核可以使用可用的EFI服务。EFI是一个操作系统和硬件如何交流的规范,所以EFI固件是使用这个规范的硬件代码。因为我没有EFI固件,所以我禁用了它。
|
||||
|
||||
这是一个应该被启用的有用的安全方式(Enable seccomp to safely compute untrusted bytecode (SECCOMP))。这个安全特性在使用不受信任的字节码的数值计算(执行大量计算的软件)中使用。字节码(可移植代码)是一种被解释器有效读取的代码。字节码不是源代码,但它也不是汇编或者二进制代码。不受信任的代码是一种可能导致系统/数据损坏的代码。可能会破坏系统或者毁坏数据的不受信任的代码通过seccomp被隔离在独立的地址空间中。这是通过文件描述符传输的方法。通常上,最好启用这个安全特性即使会有一些性能开销,除非你在制作一个需要惊人性能的内核。
|
||||
|
||||
这里是另外一个安全特性(Enable -fstack-protector buffer overflow detection (CC_STACKPROTECTOR))。缓冲溢出是数据被写超出了它的内存界限并且进入了邻近的内存中。这是一个安全威胁。一些恶意软件使用缓冲区溢出来利用系统。启用这个会使用GCC选项 "-fstack-protector"。GCC是一个Linux编译器。这个编译器会在你配置完成后编译内核。这个编译器参数会在返回地址前在栈上加入一个canary值(特殊的安全代码)。这个值会在返回前被验证。当内存溢出发生时,canary值会得到覆盖消息。当这个发生时,会触发一个内存错误(kernel panic)。如许多人知道的那样,内核错误意味着系统将要崩溃,但是这比系统或者数据永久损害的好。发生内核错误,系统会重启,但是如果缓冲移除得到了一个损坏系统的机会,一个简单的重启无法修复破坏。你必须用GCC 4.2或者更高版本支持这个参数的GCC来编译内核。
|
||||
|
||||
注意:为了得到你使用的版本号,在命令行内键入"gcc --version"。
|
||||
|
||||
在这之后,我们可以配置定时器频率。配置工具建议使用250Hz,所以我们使用这个值。
|
||||
|
||||
Timer frequency
|
||||
1. 100 HZ (HZ_100)
|
||||
> 2. 250 HZ (HZ_250)
|
||||
3. 300 HZ (HZ_300)
|
||||
4. 1000 HZ (HZ_1000)
|
||||
choice[1-4?]: 2
|
||||
|
||||
使用1000Hz通常来讲对许多系统而言太快了。定时器频率决定着定时器中断被使用的频率。这有助于在时间线上的系统操作。程序并不是随机地执行一条命令。相反它们会等到定时器中断结束。这保持着有组织和结构的处理。频率为100Hz的定时器中断之间的时间是10ms,250Hz是4ms,1000Hz是1ms。现在许多开发者会马上想到1000Hz是最好的。好吧,这取决于你对开销的要求。一个大的定时器频率意味着更多的能源消耗和更多的能源被利用(在定时器上),产生更多的热量。更多的热量意味着硬件损耗的更快。
|
||||
|
||||
注意:如果某个特定的特性对你并不重要或者你不确定该选择什么,就使用配置工具选择的默认值。比如,就我现在正在配置的内核而言,使用哪个定时器对我并不重要。总的来说,如果你没有特别的原因去选择任何一个选项时,就使用默认值。
|
||||
|
||||
这个有趣的系统调用可能会对一些用户有用(kexec system call (KEXEC))。kexec调用会关闭当前内核去启动另外一个或者重启当前内核。硬件并不会关闭并且这个调用可以无需固件的帮助工作。bootloader没有被执行。(bootloader是启动操作系统的软件) 这个重启发生在操作系统级别上而不是硬件上。使用这个系统调用会快于执行一个标准的关机或者重启。这保持硬件在开启状态。这个系统调用并不能工作在所有系统上。为了高性能,启用热插拔。
|
||||
|
||||
To use kexec, use the command below replacing “<kernel-image>” with the kernel that will be used after reboot. Also, replace “<command-line-options>” with some of those kernel parameters we had discussed previously. (I will go into greater depth in a later article.)
|
||||
为了使用kexec,对重启后要使用的内核使用如下命令替换"<kernel-image>"。同样,使用之前我们讲过的内核参数替换"<command-line-options>" (我会在以后的文章中更深入的讨论。)
|
||||
|
||||
kexec -l <kernel-image> --append="<command-line-options>”
|
||||
|
||||
Specifically, I would type “kexec -l /boot/vmlinuz-3.8.0-27-generic –append="root=/dev/sda1””
|
||||
特别地,我这里输入"kexec -l /boot/vmlinuz-3.8.0-27-generic –append="root=/dev/sda1""
|
||||
|
||||
注意:硬件有时不必重启,所以这不依赖于kexec。
|
||||
|
||||
下面,我们有一个适用于kexec的调试特性(kernel crash dumps (CRASH_DUMP))。当kexec被调用时,一个崩溃信息(crash dump)会生成。除非你有必要调试kexec,否则这个并不必要。我禁用了这个特性。
|
||||
|
||||
再者,我们有另外一个kexec特性(kexec jump (KEXEC_JUMP))。kexec跳允许用户在原始内核和kexec启动的内核之间切换。
|
||||
|
||||
最好对内核启动地址使用默认值(Physical address where the kernel is loaded (PHYSICAL_START) [0x1000000])。
|
||||
|
||||
下一个内核选项(Build a relocatable kernel (RELOCATABLE))允许内核可以放在内存的任何地方。内核文件会增大10%,但是超出部分会在执行时从内存移除。许多人也许想知道这为什么很重要。在2.6.20内核前,救援内核(rescue kernel)不得不被配置和编译运行在不同的内存地址上。当这个特性发明后,开发者不必再编译两个内核。救援内核不会在第一个已加载的内核地地方加载因为内存部分已被占用或者损坏。(如果你正在使用救援内核,那么明显第一个内核发生了错误)
|
||||
|
||||
这个特性应该在可以增加CPU的系统中启用,除非你有特别的理由不去这么做(Support for hot-pluggable CPUs (HOTPLUG_CPU))。配置工具会自动启用这个特性。在这个特性下,你可以在一个拥有很多处理器的系统上激活/停用一个CPU。这并不意味着在系统中加入新的CPU。所有的CPU必须已经在系统中。
|
||||
|
||||
下面的选项会让我们选择设置上面的特性是否默认启用(Set default setting of cpu0_hotpluggable (BOOTPARAM_HOTPLUG_CPU0))。为了性能最好禁用这个特性直到需要的时候。
|
||||
|
||||
这个调试特性允许开发者调试CPU热插拔特性(Debug CPU0 hotplug (DEBUG_HOTPLUG_CPU0))。我禁用了它。
|
||||
|
||||
为了兼容旧版本的glibc(<2.3.3),启用这个特性(Compat VDSO support (COMPAT_VDSO))。这适用于通过映射32位在VDSO(虚拟动态链接共享对象)的旧式地址。Glibc是GNC C库;这是GNU工程实现的C标准库。
|
||||
|
||||
如果系统内核被用于一个缺乏完整功能的bootloader上,那么启用这个特性(Built-in kernel command line (CMDLINE_BOOL))。这允许用户在内核自身上使用一条命令行,那么管理员可以修复内核问题。如果bootloader已经有了一条命令行(像grub),那么这个特性不必启用。
|
||||
|
||||
现在我们可以配置ACPI和电源了。首先,我们被要求选择系统是否可以挂起内存(Suspend to RAM and standby (SUSPEND))。高级配置和电源接口(ACPI)是一种对于设备配置和电源管理的开放标准。挂起系统会将数据放在内存上同时硬件进入一种低功耗的状态。系统不会完全关机。如果用户需要计算机进入一个低功耗的状态但是希望保留当前已打开程序时是非常有用的。关闭一个系统会完全关闭系统电源并且清理内存。
|
||||
|
||||
下面,我们可以启用睡眠(Hibernation (aka 'suspend to disk') (HIBERNATION))。睡眠就像挂起模式,但是内存中所有数据被保存到硬盘上并且设备完全关闭。这允许用户在电源恢复后继续使用他们已打开的程序。
|
||||
|
||||
这里,我们可以设置默认的恢复分区(Default resume partition (PM_STD_PARTITION))。非常少的开发者和管理员需要这个特性。当系统从睡眠中恢复时,他会加载默认的恢复分区。
|
||||
|
||||
在这之后,我们可以启用"Opportunistic sleep (PM_AUTOSLEEP)"。这会让内核在没有活跃的唤醒调用被调用时进入挂起或者睡眠状态。这意味着空闲系统将会进入挂起模式以节省电源。我启用了这个特性。
|
||||
|
||||
接下来,我们被询问关于"User space wakeup sources interface (PM_WAKELOCKS)"。启用这个特性将会允许激活源对象被激活,停用,并通过基于sysfs接口由用户空间创建。激活源对象会追踪唤醒事件源。
|
||||
|
||||
sysfs是位于/sys的虚拟文件系统。这个虚拟文件系统包含了关于设备的信息。当进入/sys时,它似乎是硬盘的一部分,但是这个并不是一个真正的挂载点。这些文件实际存在于内存中。这与/proc是同一个概念。
|
||||
|
||||
注意:"/sysfs"是一个文件夹而"/sysfs"或许是一个根目录下名为"sysfs"的文件。许多Linux用户会混淆这两种命名约定。
|
||||
|
||||
如果启用了上面的选项,那么你可以设置Maximum number of user space wakeup sources (0 = no limit) (PM_WAKELOCKS_LIMIT)"。最好选择默认。那么你就可以启用垃圾收集器(Garbage collector for user space wakeup sources (PM_WAKELOCKS_GC))。垃圾收集是一种内存管理方式。
|
||||
|
||||
注意: 在需要更多内存的系统中,通常最好在大多数情况下尽可能启用垃圾收集。不然内存会消耗得更快且杂乱。
|
||||
|
||||
下一个电源选项关于IO设备(Run-time PM core functionality (PM_RUNTIME))。这个选项允许IO硬件在运行时进入低功耗状态。硬件必须支持这个才行,不是所有硬件都会这么做。
|
||||
|
||||
与其他许多内核组件一样,如果启用了(Power Management Debug Support),电源管理代码同样有调试支持。我禁用了这个选项。
|
||||
|
||||
注意: 注意这些我引用/显示的配置工具上的选项/问题不再显示选项代码(括号间所有的大写字母)。这是因为我没有使用基于ncurses的配置工具(make menuconfig)而是使用默认工具去得到选项/设置/问题。记住,"make config"缺乏保存当前进度的能力。
|
||||
|
||||
在这之后,配置工具会启用"ACPI (Advanced Configuration and Power Interface) Support"。最好允许这个电源管理规范。通常上,配置工具会启用这个特性。
|
||||
|
||||
为了允许向后兼容,启用"Deprecated /proc/acpi files"。新的实现使用更新的在/sys下的实现。我禁用了这个选项.一个相似的问题询问关于"Deprecated power /proc/acpi directories"。通常上,如果你禁用了这些文件,你不再需要这些文件夹,所以我禁用了他们。一些旧的程序可能会使用这些文件和文件夹。如果你在给旧的的Linux系统上编译一个新的内核,最好启用这个选项。
|
||||
|
||||
下面,我们有另外一个文件接口可以启用或者禁用(EC read/write access through)。这会创建一个嵌入式控制器接口在/sys/kernek/debug/ec下。嵌入式控制器通常在笔记本中读取传感器。内核代码通过系统的BIOS表提供的ACPI代码访问嵌入式控制器。
|
||||
|
||||
这里有另外一个可以启用或者禁用的向后兼容特性 (Deprecated /proc/acpi/event support)。acpi守护进程可能会读取/proc/api/event来管理ACPI生成的驱动。不同于这个接口,守护进程使用netlink事件或者输入层来得到送给用户空间的事件。acpi守护进程管理ACPI事件。
|
||||
|
||||
下一个选项允许开发者启用一个特性,它会通知内核现在使用的是AC(AC Adapter)还是电池。下一个选项从/proc/acpi/battery/ (Battery)中提供电池信息。
|
||||
|
||||
为了内核在电源/睡眠按钮按下或者盖子合上时表现不同,启用这个选项(Button)。这些事件在/proc/acpi/event/中控制。比如,这样的行为如果在用户账户电源选项启用时,当笔记本电脑的盖子关闭后系统将会挂起。
|
||||
|
||||
下一个ACPI扩展是对视频适配器的(Video)。
|
||||
|
||||
ACPI风扇可以被启用/禁用(Fan)。最好启用ACPI风扇管理。这有助于保存能源。
|
||||
|
||||
我们正在进一步配置内核中,但在接下来的文章中还有更多要做。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://www.linux.org/threads/the-linux-kernel-configuring-the-kernel-part-5.4424/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user