|
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。 |
|