/modules/04 # lsmod
test 787 0 - Live 0xbf010000 (PO)
func 633 1 test, Live 0xbf00c000 (PO) test -> func
^ 引用计数
/modules/04 # rmmod func 引用计数>0 不能卸载
rmmod: remove 'func': Resource temporarily unavailable
modprobe自动解决依赖:
/ # modprobe test
[ 307.800000] test: Unknown symbol print (err 0)
[ 307.850000] hello kernel <-- insmod func.ko ; insmod test.ko
/ # lsmod
test 787 0 - Live 0xbf01c000 (PO)
func 633 1 test, Live 0xbf018000 (PO)
/ # modprobe -r func <-- 引用计数>0 不能卸载
modprobe: remove 'func': Resource temporarily unavailable
/ # modprobe -r test <-- rmmod test.ko ; rmmod func.ko
[ 363.130000] cleanup module
linux设备驱动模块引用和依赖
最新推荐文章于 2023-10-15 15:16:33 发布