keenor 发表于 2003-5-31 17:45:42

[接龙之N]Loadable module support

Loadable module support

这个地方有三个选项:

[*] Enable loadable module support
[*]   Set version information on all module symbols
[*]   Kernel module loader

分别说明如下:
Enable loadable module support:

CONFIG_MODULES:

Kernel modules are small pieces of compiled code which can be
inserted in or removed from the running kernel, using the programs
insmod and rmmod. This is described in the file
Documentation/modules.txt, including the fact that you have
to say "make modules" in order to compile the modules that you chose
during kernel configuration.Modules can be device drivers, file
systems, binary executable formats, and so on. If you think that you
may want to make use of modules with this kernel in the future, then
say Y here.If unsure, say Y.

内核模块是一段编译过的代码,这些代码可以在系统运行过程中使用insmod命令加载,使用rmmod命令卸掉。Documentation/modules.txt描述了这个问题。如果你激活了这个选项,那么之后你还要执行make modules来编译内核模块,使用make modules_install来安装编译完的内核模块。模块可能是设备驱动程序,文件系统的实现等等。为什么要有内核模块呢?内核模块是Linux系统用于扩展他的功能的。使用内核模块的优点有:他们可以被动态的加载,而且不需要重新编译内核。由于这些优点,他们常常被特殊的设备(或者文件系统),例如声卡、网卡等使用。比如你要加载e100网卡的驱动:
# insmod e100
卸载就是:
# rmmod e100
内核模块是一些后缀为.o的文件,在/lib/modules/<你的内核版本号>/下面,对应上面的命令,有个文件叫做e100.o在/lib/modules/<你的内核版本号>/kernel/drivers/net(当然你先要编译它)

Set version information on all module symbols:

CONFIG_MODVERSIONS:

Usually, modules have to be recompiled whenever you switch to a new
kernel.Saying Y here makes it possible, and safe, to use the
same modules even after compiling a new kernel; this requires the
program modprobe. All the software needed for module support is in
the modutils package (check the file Documentation/Changes
for location and latest version).NOTE: if you say Y here but don't
have the program genksyms (which is also contained in the above
mentioned modutils package), then the building of your kernel will
fail.If you are going to use modules that are generated from
non-kernel sources, you would benefit from this option.Otherwise
it's not that important.So, N ought to be a safe bet.

一个版本的内核要使用相应版本的内核模块,因为不同版本的内核可能有差别(废话,要不分什么版本)。这个选项可以在编译内核模块的时候加入版本信息,这样当内核与模块版本不同时模块无法被插入。这个选项是为了安全考虑的。如果激活这个选项,你需要modprobe这个工具。而所有所需的工具都在modutils这个软件包里(别担心,你的linux发行版一定有所需的工具了)。注意:如果你激活这个选项,那么你需要genksyms这个工具(同样包含在modutils这个软件包里),如果没有,编译内核将失败(括号内容跟前面的前面一个括号里的一样)。建议你将这一项中是选中,不然是对安全的冒险。

Kernel module loader:

CONFIG_KMOD:

Normally when you have selected some drivers and/or file systems to
be created as loadable modules, you also have the responsibility to
load the corresponding modules (using the programs insmod or
modprobe) before you can use them. If you say Y here however, the
kernel will be able to load modules for itself: when a part of the
kernel needs a module, it runs modprobe with the appropriate
arguments, thereby loading the module if it is available. (This is a
replacement for kerneld.) Say Y here and read about configuring it
in Documentation/kmod.txt.

通常当你把驱动程序或文件系统的实现等编译为模块之后,在你使用他们时需要手动加载那些模块(insmod和rmmod)。但如果这一项被激活,那么内核将有能力为自己加载内核模块:当内核的某一部分需要模块时,它就使用适当的参数来运行modprobe,于是如果相应的模块存在的话,就将被加载。这个选项是用来替换kerneld的。详细请看Documentation/kmod.txt。

greenforce 发表于 2003-5-31 19:08:09

好,,不错...全给翻译了吧~~~!

keenor 发表于 2003-6-1 00:09:24

这个东西实在是太庞大了,凭我一人之力无论如何不能完成。况且里面我不明白的还有很多。我尽量拣一些自己熟悉的,比较特别的来说。
你最好多拉几个人,分派些任务。这样也利于交流。

greenforce 发表于 2003-6-1 00:49:42

我稍微熟悉一点 SCSI 和 RAID 设备这些.可惜翻译功底不过关.
大白话说出来怕人笑话,误人子弟.
大家都这么认真负责.
我试试看.做点贡献.

keenor 发表于 2003-6-1 01:15:58

好啊好啊
大家都出点力,这个接龙就能搞下去了
我等着看呢
呵呵

Dragonfly 发表于 2003-6-1 06:07:09

if u never try it, how u know u can do it?
and anyway after u do it, here we have somany people to support u.:wink:

Dragonfly 发表于 2003-6-1 06:12:28

minor issues,
1) if u are developing a module, for example, hello.o and u do not put it in /lib/module/... u can use insmod hello.o.
2) most of time, modprobe is better than insmod, modprobe can also load the modules that u module depends on.
3) for the modversions, u can deselect it for some special purpose, but u had better choose it as keenor said.

Dragonfly 发表于 2003-6-1 22:03:15

in fact they are almost same. configure.help content com from the doc in config.in

断弦linuxer 发表于 2003-6-25 09:57:46

哇~~~你们是最可爱的银勒~~ :lol::lol:

Dragonfly 发表于 2003-6-25 10:11:04

soso. hope everybody can be more active on this!

xingy 发表于 2004-12-20 16:28:05

非常好啊,这些东西实在是太少了
页: [1]
查看完整版本: [接龙之N]Loadable module support