LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 838|回复: 3

怎么编译一个模块,然后加到内核里???

[复制链接]
发表于 2007-5-4 21:21:15 | 显示全部楼层 |阅读模式
我装了一个lm_sensors想查看cpu温度
用了sensors-detect来发现设备,最后系统提示

#----cut here----
# I2C adapter drivers
i2c-i801
# Chip drivers
# Warning: the required module eeprom is not currently installed
# on your system. For status of 2.6 kernel ports check
# http://www.lm-sensors.org/wiki/Devices. If driver is built
# into the kernel, or unavailable, comment out the following line.
eeprom
# Warning: the required module w83627ehf is not currently installed
# on your system. For status of 2.6 kernel ports check
# http://www.lm-sensors.org/wiki/Devices. If driver is built
# into the kernel, or unavailable, comment out the following line.
w83627ehf
#----cut here----


让我加载一个 w83627ehf 模块。

我搜了一下,发现内核源码里有 ./drivers/hwmon/w83627ehf.c  有这么源文件。

怎么编译它,然后再加载到内核里呢?

谢谢。
发表于 2007-5-4 21:52:18 | 显示全部楼层
如果你用的内核是源里面的,这些模块都是已经编译好了的。
直接"modprobe 模块名"即可.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-5-4 22:01:52 | 显示全部楼层
Post by 高热
如果你用的内核是源里面的,这些模块都是已经编译好了的。
直接"modprobe 模块名"即可.

不是,现在我只是在kernel的tar里找到w83627ehf.c,编译好的是w83627ehf.o吧?
我怎么才能把他编译成.o呢?
回复 支持 反对

使用道具 举报

发表于 2007-5-7 23:56:59 | 显示全部楼层
我的ubuntu里已经有编译好的模块:
/lib/modules/2.6.17-10-generic/kernel/drivers/hwmon/w83627ehf.ko
$ sudo modprobe w83627ehf
应该就可以加载了。你可以locate w83627ehf看看你的系统里有没有。自己编译比较麻烦。
--
uBuntu + Acer Aspire 5052 + qemu (Windows 2003 server)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表