嵌入式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 ...
随机推荐
- JavaScript高级程序设计:第十一章
一.选择符API SelectorsAPILevel 1的核心是两个方法:querySelector()和querySelectorAll(). 1. querySelector()方法 queryS ...
- Html5中的本地存储
Web Storage web storage页面存储是html5为数据存储在客户端提供的一项重要功能,由于web storage API能够区分会话数据与长期数据.因此,相应API也分为两种: se ...
- 16.按要求编写Java应用程序。 编写一个名为Test的主类,类中只有一个主方法; 在主方法中定义一个大小为50的一维整型数组,数组名为x,数组中存放着{1, 3,5,…,99}输出这个数组中的所有元素,每输出十个换一行;在主方法中定义一 个大小为10*10的二维字符型数组,数组名为y,正反对角线上存的是‘*’,其余 位置存的是‘#’;输出这个数组中的所有元素。
//分类 package com.bao; public class Shuchu { int[]yi=new int[50]; String[][]er=new String[10][10]; vo ...
- [转]phpcms 判断用户登录代码
<!-- 用户登录开始 --> <?php //读取用户信息 $ypzy_userid = param::get_cookie('_userid'); if(!empty($ypzy ...
- libevent在windows下使用步骤详解
一 环境 官方下载地址:http://libevent.org/版本:libevent-2.0.22-stable 二 编译静态库 1 解压把上面下载到libevent-2.0.22-stable.t ...
- drupal错误: Maximum execution time of 240 seconds exceeded
drupal7.5安装完成,导入汉化包时,出现错误: Fatal error: Maximum execution time of 240 seconds exceeded in D:\phpweb\ ...
- SpringMVC redirect乱码问题
转:http://blog.csdn.net/xubo_zhang/article/details/8239725 spring redirect 用spring redirect中文会乱码:如下示例 ...
- FileSystemXmlApplicationContext方法的绝对路径问题
public AgentServer(Socket c,String confDir) { this.client = c; ApplicationContext ac = new FileSyste ...
- Dynamic Performance Tables not accessible Automatic Statistics disabled for this session
使用oracle时候统计会出现这个提示 Dynamic Performance Tables not accessible Automatic Statistics disabled for this ...
- java 数据结构 栈的实现
java数据结构之栈的实现,可是入栈,出栈操作: /** * java数据结构之栈的实现 * 2016/4/26 **/ package cn.Link; public class Stack{ No ...



