嵌入式linux插入内核模块Error: could not insert module xxx.ko: Device or resource busy处理
设备号冲突导致
处理方法:
1.输入$cat /proc/devices 查看驱动的设备号
2.选择一个不冲突的设备号进行编译
参考文献:
1.http://blog.csdn.net/zzc_19/article/details/8648332
为了防止网页无法访问,现将引用文献拷贝至此
最近看了几集国嵌的关于字符设备驱动视频教程,自己跟着视频上面敲代码。字符设备驱动,用内存模拟一个字符设备,然后对其进行访问,200多行代码,基本代码还是在windows下通过sourceinsight3输入,经过其检验,编译前确信没有任何问题,结果错误一页都显示不完(⊙﹏⊙b汗)。经过两个多小时的调试,最终调好了,也回顾了不少c语言的基础知识(当然,视频上面还是有几个错误的,因为视频上没当场编译)。毕业7年,还好,当初对C语言有种莫名的情切感,现在老师的很多话都记在心上。
言归正传,调试到没有任何error或者warring再将memdev.ko和app_mendev通过ftp拷贝到开发板运行,一敲insmod memdev.ko 就提示:
- <span style="font-family:Arial;font-size:14px;">[root@FriendlyARM plg]# insmod memdev.ko
- insmod: can't insert 'memdev.ko': Device or resource busy</span>
图1 模块Device or resource busy提示
什么chmod,chown都用过了,6410板子也reboot过,ftp也by后从新连接过,还是同样的结果。最后求助google(最近好上一点,不会点一两个链接就会出现链接不上),原来是设备号冲突,于是更改程序主设备号为99。再次编译模块。顺利insmod,嘿嘿!
图2 memdev.h 里面定义主设备号为254,冲突
图3 更改设备号为99后顺利insmod
图4 cat /proc/devices 里面看见99 memdev
2.http://www.aichengxu.com/view/996172
今天是自己写的第二个设备驱动程序,很不幸,中枪了
在insmod xxx.ko 时候总是出现Error: could not insert module testsecond.ko: Device or resource busy,
分析了各种情况,都快崩溃了后来在很而然的看的一篇很不起眼的小短文,顿时灵感来了。
解决方法:在文本界面输入$cat /proc/devices 查看你的驱动的进程号,例如我的驱动进程号如下所示
可以看到这是字符设备的进程号,如果你写的是快设备或者是FIFO之类的,那你要到块设备里面去查找
你可以看到这进程号是否与你所定义的MAJOR冲突,如果冲突,那就是你insmod xxx.ko失败的原因了 ,你只要把MAJOR改一下,就没有问题了
嵌入式linux插入内核模块Error: could not insert module xxx.ko: Device or resource busy处理的更多相关文章
- insmod: ERROR: could not insert module dm-snapshot.ko: Unknown symbol in module
下面方法成功的前提是你的mod和你的操作系统版本是匹配的,也就是说你的mod之前成功过.说个多余的提示,mod在/lib/modules目录里面 insmod: ERROR: could not in ...
- 在加载模块时出现cannot insert '*.ko': Device or resource busy错误
制作了一个模块,在加载是出现了cannot insert '*.ko': Device or resource busy错误. 原因: 是由于模块使用的是静态分配设备号,而这个设备号已经被系统中的其他 ...
- Linux下rm -rf删除文件夹报错_ Device or resource busy
1.错误信息 rm: cannot remove `speechd-centos_6.2-prtl-pred-mf34/modules/t2p/py/third/g2p/.nfs00000000039 ...
- WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
在 mkfs.ext4 /dev/sda2 格式化硬盘空间时,可能出现这种错误. had this situation at office where I was told to re-partiti ...
- RSYNC @ERROR: AUTH FAILED ON MODULE XXX 解决思路及附录RSYNC常见问题及解决办法
使用rsync往服务器上传文件时,client报如下异常: @ERROR: auth failed on module XXX rsync error: error starting client-s ...
- read()、write()返回 Input/output error, Device or resource busy解决
遇到的问题,通过I2C总线读.写(read.write)fs8816加密芯片,报错如下: read str failed,error= Input/output error! write str fa ...
- ubuntu12.04出现ERROR: Removing 'hello': Device or resource busy和insmod: error inserting 'hello.ko': -1 Device or resource busy解决方案
一:insmod时候错误: 1:错误信息insmod: error inserting 'hello.ko': -1 Device or resource busy 2:原因:你的代码里面的设备号和系 ...
- 【linux排错】"error while loading shared libraries: xxx.so.x" 错误的原因和解决办法
一般我们在Linux下执行某些外部程序的时候可能会提示找不到共享库的错误, 比如: lcw: error : cannot open shared object file: No such file ...
- 嵌入式Linux驱动开发日记
嵌入式Linux驱动开发日记 主机硬件环境 开发机:虚拟机Ubuntu12.04 内存: 1G 硬盘:80GB 目标板硬件环境 CPU: SP5V210 (开发板:QT210) SDRAM: 512M ...
随机推荐
- @Value 注解获取properties值
转自:使用Spring 3的@value简化配置文件的读取 Spring 3支持@value注解的方式获取properties文件中的配置值,大简化了读取配置文件的代码. 1.在application ...
- openwrt uci
UCI: Unified Configuration Interface 通用配置接口,主要用于集中控制openwrt的配置文件. 1.uci使用的配置文件一般放置在设备上的/etc/config目录 ...
- lldpcli 常用命令
1.查看周围的邻居列表 root@hbg:/# lldpcli show neighbors------------------------------------------------------ ...
- reincarnation server
- parent of all the drivers and servers - when a driver or server dies, RS collects it. - RS checks ...
- server服务器信息页面添加步骤
1. 在数据库更新链接 /portal/server/getServerList 2. 写实体类 Server.java 3. 写Server.hbm.xml <?xml version=&qu ...
- Inno Setup入门(十六)——Inno Setup类参考(2)
分类: Install Setup 2013-02-02 11:28 815人阅读 评论(0) 收藏 举报 这里将接着在前面的基础上介绍如何在自定义页面上添加按钮.按钮属于Tbutton类,该类继承自 ...
- Unable to chmod
不能改变权限 Unable to chmod /system/build.prop.: Read-only file system 解决方式: before chmod: Code: mount -o ...
- zf-分页后台代码
java : public ResultPage getDeptList(int page, int pageRows) throws Exception { String hql="fro ...
- c语言库函数
#include <stdio.h> #define LENGTH 100 main() { FILE *fd; char str[LENGTH]; fd = fopen("he ...
- 转: Windows如何打开和使用事件查看器管理计算机
方法/步骤 1 右键单击"我的电脑"(win8中名称为"这台电脑.This Computer"),选择"管理",点击. 步骤阅读 2 出 ...



