加载驱动模块时Device or resource busy的解决方法
来源:互联网 发布:mac mini 音频输出 编辑:程序博客网 时间:2024/05/01 15:09
加载驱动模块时Device or resource busy的解决方法
加载驱动模块时Device or resource busy的解决方法
insmod或modprobe驱动模块时Device or resource busy的解决方法
在编译好memdev驱动模块后,通过insmod加载模块时发现以下错误提示:
#insmod memdev.ko
insmod: error inserting 'memdev.ko': -1 Device or resource busy
这种情况一般都是驱动的设备号已经被系统使用了。
我回头查看memdev模块的主设备号,我定义的是254,然后查看系统设备列表。
#cat /proc/devices
Character devices:
1 mem
2 pty
3 ttyp
4 /dev/vc/0
4 tty
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
6 lp
7 vcs
10 misc
13 input
21 sg
29 fb
128 ptm
136 pts
180 usb
189 usb_device
254 vmci
Block devices:
1 ramdisk
2 fd
7 loop
8 sd
9 md
22 ide1
65 sd
66 sd
67 sd
68 sd
69 sd
70 sd
71 sd
128 sd
129 sd
130 sd
131 sd
132 sd
133 sd
134 sd
135 sd
253 device-mapper
254 mdp
此时发现字符设别驱动的254已经被使用了。
解决方法:更换一个上表未使用的的主设备号,或者直接让系统自动分配。
系统自己分配的,可以用printk打印,然后dmesg看major number,然后再mknod
-----------------------------------------------------------------------------------------
另外值得注意的是,编译内核模块的时候,必须有一个已经配置好并编译过的内核源代码树。否则会出现以下错误:
Building modules, stage 2.
/xxx/linux-2.6.29/scripts/Makefile.modpost:43: include/config/auto.conf: No such file or directory
make[2]: *** No rule to make target 'include/config/auto.conf'.
make[1]: *** [modules] Error 2
make[1]: Leaving directory '/xxx/linux-2.6.29'
make: *** [all] Error 2
解决方法:先配置编译内核源代码树,然后再编译内核模块或者驱动模块。
- 加载驱动模块时Device or resource busy的解决方法
- 加载驱动模块时Device or resource busy的解决方法
- LINUX驱动学习:加载模块时出现Device or resource busy的解决方法
- LINUX驱动学习:加载模块时出现Device or resource busy的解决方法
- LINUX驱动学习:加载模块时出现Device or resource busy的解决方法
- 【解决问题】加载驱动模块时Device or resource busy的解决方法
- 在加载模块时出现cannot insert '*.ko': Device or resource busy错误
- Device or resource busy
- Device or resource busy
- ERROR: Removing 'hello': Device or resource busy //关于使用系统定义的模块加载和卸载函数
- 驱动加载错误:insmod: error inserting 'hello.ko': -1 Device or resource busy
- rmmod 时出现device or resource busy
- 编译linux 驱动出现device or resource busy问题
- mount device or resource busy
- 关于BUG的那些事儿-Device or resource busy
- 执行 logcat 命令引发的EBUSY device or resource busy
- module编程 Device or resource busy
- ERROR: Removing '': Device or resource busy
- 字符串分割(C++)
- linux下各种操作的权限要求。
- Valid Number
- vi/vim 删除:一行, 一个字符, 单词, 每行第一个字符 命令
- _itoa in the g++
- 加载驱动模块时Device or resource busy的解决方法
- PHP,Mysql-根据一个给定经纬度的点,进行附近地点查询–合理利用算法
- 线性表1.1
- tomcat发布javaEE项目的两种方式
- 黑马程序员-枚举与反射
- dlerror
- 黑马程序员-io 学习笔记
- JAVAEE 和 tomcat 版本关系
- Excel编程(1)----VBA调试