zoukankan      html  css  js  c++  java
  • linux 内核模块管理

    已加载模块
    lsmod
     
    安装模块
    insmod /lib/modules/.....
     
     
    卸载模块
    rmmod usbnet
     
    模块信息

    modinfo usbserial.ko
    filename: usbserial.ko
    license: GPL
    description: USB Serial Driver core
    author: Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/
    srcversion: 2FFD0C7B16BC3040AC5800D
    depends:
    vermagic: 2.6.32-38-generic SMP mod_unload modversions 586
    parm: vendor:User specified USB idVendor (ushort)
    parm: product:User specified USB idProduct (ushort)
    parm: debug:Debug enabled or not (bool)

     usb设备

    lsusb
    Bus 002 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
    Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
    Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
    Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    lspci 

    lspci
    00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 01)
    00:01.0 PCI bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 01)
    00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 08)
    00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
    00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 08)
    00:07.7 System peripheral: VMware Virtual Machine Communication Interface (rev 10)
    00:0f.0 VGA compatible controller: VMware SVGA II Adapter
    00:10.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
    00:11.0 PCI bridge: VMware PCI bridge (rev 02)
    00:15.0 PCI bridge: VMware PCI Express Root Port (rev 01)
    00:15.1 PCI bridge: VMware PCI Express Root Port (rev 01)
    00:15.2 PCI bridge: VMware PCI Express Root Port (rev 01)

     lscpu
    Architecture: i686
    CPU op-mode(s): 64-bit
    CPU(s): 1
    Thread(s) per core: 1
    Core(s) per socket: 1
    CPU socket(s): 1
    Vendor ID: GenuineIntel
    CPU family: 6
    Model: 60
    Stepping: 3
    CPU MHz: 3292.410
    Virtualization: VT-x
    L1d cache: 32K
    L1i cache: 32K
    L2 cache: 256K
    L3 cache: 6144K

    Module                  Size  Used by
    nls_utf8                1069  1 
    isofs                  29915  1 
    usb_storage            40208  0 
    binfmt_misc             6412  1 
    nfsd                  241120  11 
    lockd                  64615  1 nfsd
    nfs_acl                 2257  1 nfsd
    auth_rpcgss            33416  1 nfsd
    sunrpc                192277  12 nfsd,lockd,nfs_acl,auth_rpcgss
    exportfs                3417  1 nfsd
    acpiphp                17000  0 
    snd_ens1371            18375  2 
    gameport                8701  1 snd_ens1371
    snd_ac97_codec         98980  1 snd_ens1371
    ac97_bus                1014  1 snd_ac97_codec
    snd_pcm                71474  2 snd_ens1371,snd_ac97_codec
    snd_seq_midi            4652  0 
    snd_rawmidi            17836  2 snd_ens1371,snd_seq_midi
    snd_seq_midi_event      6047  1 snd_seq_midi
    snd_seq                46801  2 snd_seq_midi,snd_seq_midi_event
    snd_timer              18657  2 snd_pcm,snd_seq
    snd_seq_device          5776  3 snd_seq_midi,snd_rawmidi,snd_seq
    snd                    48853  11 snd_ens1371,snd_ac97_codec,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
    ppdev                   5238  0 
    joydev                  8743  0 
    usbhid                 35355  0 
    lp                      7181  0 
    hid                    67796  1 usbhid
    soundcore                880  1 snd
    intel_agp               9842  1 
    intel_gtt              12830  1 intel_agp
    agpgart                30657  2 intel_agp,intel_gtt
    i2c_piix4               7707  0 
    snd_page_alloc          7248  1 snd_pcm
    parport_pc             26052  1 
    shpchp                 25010  0 
    parport                31531  3 ppdev,lp,parport_pc
    vmw_balloon             3534  0 
    psmouse                55905  0 
    serio_raw               3990  0 
    pcnet32                29107  0 
    vmw_pvscsi             12727  0 
    mii                     4425  1 pcnet32
    mptspi                 14771  2 
    mptscsih               30987  1 mptspi
    mptbase                86394  2 mptspi,mptscsih
    vmxnet3                26975  0 
    scsi_transport_spi     20621  1 mptspi
     

    让驱动自动加载

    /etc/moudles 加入模块名,不要加.ko

    # /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.
    
    lp
    
    # Generated by ath9k_htc-installer on 一  4月 27 16:18:43 2015
    ath9k_htc
    

      

    depmod
    depmod - program to generate modules.dep and map files
    当把模块文件放到/lib/module/`uname -r`/目录下,运行depmod,则会在/lib/modules/<kernel-version>/目录下生成modules.dep(.bb)文件,表明了模块的依赖关系

  • 相关阅读:
    爬虫的基本原理、requests模块、模拟登陆网站、爬取视频网站、cookie池和代理池、正向代理和反向代理
    git初识、
    签发token、校验token、多方式登录签发token的实现、自定义认证反爬规则的认证类、admin使用自定义User表:新增用户密码密文、群查接口各种筛选组件数据准备、drf搜索过滤组件、drf排序过滤组件、drf基础分页组件
    频率认证源码分析、自定义频率认证组件、JWT认证、drf-jwt插件
    auth组件的权限六表 自定义User的权限六表 六表之间的数据访问 三大认证整体源码分析 自定义认证类 系统权限类 自定义权限类
    视图类与序列化类传参、二次封装response类、视图家族、GenericAPIView视图基类、mixins视图6大工具类、generic中的工具视图、视图集、GenericAPIView 与 APIView 作为两大继承视图的区别、工具视图集、路由组件(了解)
    修改文件后缀
    python统计自己微信好友并抓取信息
    关于今日头条小程序(字节跳动小程序)相关问题
    关于飞鱼文档不详细无法拉取数据问题
  • 原文地址:https://www.cnblogs.com/ahuo/p/2532676.html
Copyright © 2011-2022 走看看