在Linux中设置ACPI字段 [英] Setting an ACPI field in Linux

查看:65
本文介绍了在Linux中设置ACPI字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个上网本,可以按我的喜好稍微早一点运行风扇.我找到了一种仅Windows的解决方案来减少风扇噪音,但是我在这台计算机上使用的是Ubuntu.

I've a netbook that is running the fan a bit to early for my liking. I've found a Windows-only solution to reducing the fan noise but I'm using Ubuntu on this computer.

在Windows解决方案中,该人员正在使用一个名为笔记本硬件控制(NHC)的程序,据我所知,该程序正在读取和设置ACPI值.( http://hpmini110c.siteboard.eu/f3t31-lueftersteuerung-fuer-den-mini.html (7z文件中的相关源,其中的.cs文件中有一个C#文件,其中包含用于设置风扇开启的逻辑)

In the Windows solution the guy is using a program called Notebook Hardware Control (NHC) which, from what I can make out, is reading and setting ACPI values. (http://hpmini110c.siteboard.eu/f3t31-lueftersteuerung-fuer-den-mini.html, relevant source in the 7z-file, the .cs-file in there is a C#-file with the logic for setting the fan on)

我想找到一种在Linux环境中进行复制的方法的部分是:

The part I would like to find a way to replicate in a Linux environment is:

# Where the value is being set
write = ACPI.FIELD.Write("_SP.PCIO.SBRG.ECO.CTPM", 40);
# Reading the temperature
int temp1 = 0;
bool _tmp = APCI.FIELD.Read("_SB.PCIO.SBRG.ECO.TPM1", ref temp1)

老实说,我对此事不屑一顾,但是如果有人可以向正确的方向推动我,我将不胜感激!

I'll be honest that I'm over my head on this, but if someone could nudge me in the right direction I'd be very grateful!

推荐答案

Michal Kottman创建了一个内核模块,该模块允许您执行这样的ACPI命令.它设计用于调用命令来切换视频卡,但也可以用于其他用途.可从 Github 获取,安装说明如下:

Michal Kottman created a kernel module which allows you to execute such ACPI commands. It was designed for calling commands to toggle video cards, but can be used for other purposed as well. It's available from Github, installation instructions below:

  1. 安装与当前内核匹配的内核头文件
  2. 获取源代码并进行构建

  1. Install the kernel headers matching the current kernel
  2. Get the source and build it

git clone git://github.com/mkottman/acpi_call.git
cd acpi_call
make

  • 加载模块:

  • Load the module:

    /sbin/insmod acpi_call.ko
    

    如果一切顺利,您现在应该有了一个/proc/acpi/call 文件".

    If everything went well, you should now have a /proc/acpi/call "file".

    要执行命令,请将其写入/proc/acpi/call .我猜您是用 _SP 进行了拼写错误,因此将其替换为 \ _ SB :

    To execute a command, write it to /proc/acpi/call. I guess you made a typo with _SP and therefore replaced it by \_SB:

    echo '\_SB.PCIO.SBRG.ECO.CTPM' > /proc/acpi/call
    

  • 要获取此命令的结果,请检查内核日志( dmesg )或读取结果:

    cat /proc/acpi/call
    

    读取后,该值将被清除,因此,如果以后要重复使用,请确保将输出保存在某处.

    After reading it, the value will be cleared so be sure to save the output somewhere if you want to re-use it later.

    这篇关于在Linux中设置ACPI字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆