特殊:Badtitle/NS100: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 Wi... |
小无编辑摘要 |
||
第113行: | 第113行: | ||
</nowiki></pre> | </nowiki></pre> | ||
---- | ---- | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年5月12日 (二) 17:45的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Loadable_Modules }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/af | • {{#if: UbuntuHelp:Loadable_Modules|Afrikaans| [[::Loadable Modules/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ar | • {{#if: UbuntuHelp:Loadable_Modules|العربية| [[::Loadable Modules/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/az | • {{#if: UbuntuHelp:Loadable_Modules|azərbaycanca| [[::Loadable Modules/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/bcc | • {{#if: UbuntuHelp:Loadable_Modules|جهلسری بلوچی| [[::Loadable Modules/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/bg | • {{#if: UbuntuHelp:Loadable_Modules|български| [[::Loadable Modules/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/br | • {{#if: UbuntuHelp:Loadable_Modules|brezhoneg| [[::Loadable Modules/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ca | • {{#if: UbuntuHelp:Loadable_Modules|català| [[::Loadable Modules/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/cs | • {{#if: UbuntuHelp:Loadable_Modules|čeština| [[::Loadable Modules/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/de | • {{#if: UbuntuHelp:Loadable_Modules|Deutsch| [[::Loadable Modules/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/el | • {{#if: UbuntuHelp:Loadable_Modules|Ελληνικά| [[::Loadable Modules/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/es | • {{#if: UbuntuHelp:Loadable_Modules|español| [[::Loadable Modules/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/fa | • {{#if: UbuntuHelp:Loadable_Modules|فارسی| [[::Loadable Modules/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/fi | • {{#if: UbuntuHelp:Loadable_Modules|suomi| [[::Loadable Modules/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/fr | • {{#if: UbuntuHelp:Loadable_Modules|français| [[::Loadable Modules/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/gu | • {{#if: UbuntuHelp:Loadable_Modules|ગુજરાતી| [[::Loadable Modules/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/he | • {{#if: UbuntuHelp:Loadable_Modules|עברית| [[::Loadable Modules/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/hu | • {{#if: UbuntuHelp:Loadable_Modules|magyar| [[::Loadable Modules/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/id | • {{#if: UbuntuHelp:Loadable_Modules|Bahasa Indonesia| [[::Loadable Modules/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/it | • {{#if: UbuntuHelp:Loadable_Modules|italiano| [[::Loadable Modules/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ja | • {{#if: UbuntuHelp:Loadable_Modules|日本語| [[::Loadable Modules/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ko | • {{#if: UbuntuHelp:Loadable_Modules|한국어| [[::Loadable Modules/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ksh | • {{#if: UbuntuHelp:Loadable_Modules|Ripoarisch| [[::Loadable Modules/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/mr | • {{#if: UbuntuHelp:Loadable_Modules|मराठी| [[::Loadable Modules/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ms | • {{#if: UbuntuHelp:Loadable_Modules|Bahasa Melayu| [[::Loadable Modules/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/nl | • {{#if: UbuntuHelp:Loadable_Modules|Nederlands| [[::Loadable Modules/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/no | • {{#if: UbuntuHelp:Loadable_Modules|norsk| [[::Loadable Modules/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/oc | • {{#if: UbuntuHelp:Loadable_Modules|occitan| [[::Loadable Modules/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/pl | • {{#if: UbuntuHelp:Loadable_Modules|polski| [[::Loadable Modules/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/pt | • {{#if: UbuntuHelp:Loadable_Modules|português| [[::Loadable Modules/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ro | • {{#if: UbuntuHelp:Loadable_Modules|română| [[::Loadable Modules/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/ru | • {{#if: UbuntuHelp:Loadable_Modules|русский| [[::Loadable Modules/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/si | • {{#if: UbuntuHelp:Loadable_Modules|සිංහල| [[::Loadable Modules/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/sq | • {{#if: UbuntuHelp:Loadable_Modules|shqip| [[::Loadable Modules/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/sr | • {{#if: UbuntuHelp:Loadable_Modules|српски / srpski| [[::Loadable Modules/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/sv | • {{#if: UbuntuHelp:Loadable_Modules|svenska| [[::Loadable Modules/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/th | • {{#if: UbuntuHelp:Loadable_Modules|ไทย| [[::Loadable Modules/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/tr | • {{#if: UbuntuHelp:Loadable_Modules|Türkçe| [[::Loadable Modules/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/vi | • {{#if: UbuntuHelp:Loadable_Modules|Tiếng Việt| [[::Loadable Modules/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/yue | • {{#if: UbuntuHelp:Loadable_Modules|粵語| [[::Loadable Modules/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/zh | • {{#if: UbuntuHelp:Loadable_Modules|中文| [[::Loadable Modules/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/zh-hans | • {{#if: UbuntuHelp:Loadable_Modules|中文(简体)| [[::Loadable Modules/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Loadable_Modules | UbuntuHelp:Loadable_Modules | {{#if: | :}}Loadable Modules}}/zh-hant | • {{#if: UbuntuHelp:Loadable_Modules|中文(繁體)| [[::Loadable Modules/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Loadable_Modules|:Loadable Modules|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Loadable Modules/zh | | {{#ifexist: Loadable Modules/zh | | {{#ifeq: {{#titleparts:Loadable Modules|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Loadable Modules|1|-1|}} | zh | | }}
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:
nano -w /etc/modules
# /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
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:
tulip
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:
lsmod
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]
To see a list of the module files:
modprobe --list
/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
or to search
modprobe --list *8169*
/lib/modules/2.6.24-16-server/kernel/drivers/net/r'''8169'''.ko
To load a module, and any modules that it needs, use modprobe:
modprobe st
To remove a loaded module, use rmmod:
rmmod st
To get information about a module, use modinfo:
modinfo st
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)"
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
nano -w /etc/modprobe.d/blacklist
for example add the line
blacklist e100