个人工具
104.160.18.24
该IP地址的讨论
登录
查看“UbuntuHelp:Loadable Modules”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Loadable Modules”的源代码
来自Ubuntu中文
←
UbuntuHelp:Loadable Modules
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/Loadable_Modules}} {{Languages|UbuntuHelp:Loadable_Modules}} == What are loadable modules(Drivers) == Modules are to Linux what drivers are for Windows. Most modules come supplied with the linux distrubution, unlike windows which mostly come supplied form the hardware manufacturer. The Linux kernel can be extended to have more capabilities two basic ways: * Recompile the kernel with new capabilities "compiled-in" and reboot the new kernel * Build the kernel with loadable modules you might want occasionally. If you want a module's features to be added to your kernel, the the module can either automatically be loaded, or you can manually load it. When you are done using the module, you can either remove it from your kernel, or it can disappear automatically. When you configure and build your kernel, if you specify a kernel feature with a y then the software to support it will be part of your kernel (the features will be "compiled into" your kernel and always using up memory). If you specify the feature with an m then the feature will be a loadable module that can come and go as you wish (and will use memory only if the module is loaded). An n means the feature will not be enabled in the kernel. == Using loadable modules == The file '''/etc/modules''' configures which loadable modules are automatically loaded. Here is a sample: <pre><nowiki> nano -w /etc/modules </nowiki></pre> <pre><nowiki> # /etc/modules: kernel modules to load at boot time. # # This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored. loop lp fuse r8169 </nowiki></pre> Changing '''/etc/modules''': Let's say your eepro100 Ethernet device breaks and you buy a new Ethernet card that uses the '''tulip''' driver. In this case, the relevant line in '''/etc/modules''' file should be changed to: <pre><nowiki> tulip </nowiki></pre> In most cases, when you reboot with your new Ethernet card, Ubuntu's configuration manager should automatically notice a new Ethernet card is installed, and change the '''/etc/modules''' file for you. To see a list of loadable kernel modules on your system with their status: <pre><nowiki> lsmod </nowiki></pre> <pre><nowiki> Module Size Used by Not tainted i810_audio 26408 2 (autoclean) ac97_codec 13768 0 (autoclean) [i810_audio] soundcore 7108 2 (autoclean) [i810_audio] scanner 10716 0 (unused) mousedev 5688 0 (unused) keybdev 2944 0 (unused) input 6176 0 [mousedev keybdev] hid 11804 0 (unused) usb-uhci 27436 0 (unused) usbcore 81088 1 [scanner hid usb-uhci] </nowiki></pre> To see a list of the module files: <pre><nowiki> modprobe --list </nowiki></pre> <pre><nowiki> /lib/modules/2.4.20/kernel/drivers/block/floppy.o /lib/modules/2.4.20/kernel/drivers/block/loop.o /lib/modules/2.4.20/kernel/drivers/char/rtc.o /lib/modules/2.4.20/kernel/drivers/input/input.o /lib/modules/2.4.20/kernel/drivers/input/keybdev.o /lib/modules/2.4.20/kernel/drivers/input/mousedev.o /lib/modules/2.4.20/kernel/drivers/net/dummy.o /lib/modules/2.4.20/kernel/drivers/scsi/atp870u.o /lib/modules/2.4.20/kernel/drivers/scsi/scsi_mod.o /lib/modules/2.4.20/kernel/drivers/scsi/st.o /lib/modules/2.4.20/kernel/drivers/sound/ac97_codec.o /lib/modules/2.4.20/kernel/drivers/sound/i810_audio.o /lib/modules/2.4.20/kernel/drivers/sound/soundcore.o /lib/modules/2.4.20/kernel/drivers/usb/dc2xx.o /lib/modules/2.4.20/kernel/drivers/usb/hid.o /lib/modules/2.4.20/kernel/drivers/usb/scanner.o /lib/modules/2.4.20/kernel/drivers/usb/usb-uhci.o /lib/modules/2.4.20/kernel/drivers/usb/usbcore.o /lib/modules/2.4.20/kernel/fs/fat/fat.o /lib/modules/2.4.20/kernel/fs/msdos/msdos.o /lib/modules/2.4.20/kernel/fs/vfat/vfat.o </nowiki></pre> or to search <pre><nowiki> modprobe --list *8169* </nowiki></pre> <pre><nowiki> /lib/modules/2.6.24-16-server/kernel/drivers/net/r'''8169'''.ko </nowiki></pre> To load a module, and any modules that it needs, use '''modprobe''': <pre><nowiki> modprobe st </nowiki></pre> To remove a loaded module, use '''rmmod''': <pre><nowiki> rmmod st </nowiki></pre> To get information about a module, use '''modinfo''': <pre><nowiki> modinfo st </nowiki></pre> <pre><nowiki> filename: /lib/modules/2.4.20/kernel/drivers/scsi/st.o description: "SCSI Tape Driver" author: "Kai Makisara" license: "GPL" parm: buffer_kbs int, description "Default driver buffer size (KB; 32)" parm: write_threshold_kbs int, description "Asynchronous write threshold (KB; 30)" parm: max_buffers int, description "Maximum number of buffer allocated at initialisation (4)" parm: max_sg_segs int, description "Maximum number of scatter/gather segments to use (32)" parm: blocking_open int, description "Block in open if not ready an no O_NONBLOCK (0)" </nowiki></pre> == Blacklist Module == For various reasons you might want to stop a module form loading, In this case you can blacklist the module in '''/etc/modprobe.d/blacklist''' <pre><nowiki> nano -w /etc/modprobe.d/blacklist </nowiki></pre> for example add the line <pre><nowiki> blacklist e100 </nowiki></pre> ---- [[category:CategoryDocumentation]] [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Loadable Modules
。