1、错误提示
1. ERROR: Kernel configuration is invalid.
2. include/linux/autoconf.h or include/config/auto.conf are missing.
3. Run 'make oldconfig && make prepare' on kernel src to fix it.
解决方法
在自己的linux内核目录下运行make oldconfig && make prepare
2、 错误提示
挂载时会报错“permission denied“
解决方法
这一步“服务器端在文件/etc/exports中设定允许被访问的文件、目录以及访问的权限”
修改/etc/exports 文件,添加如下内容
/opt/nfs *(rw,sync,no_root_squash,no_all_squash)(不同的人可能挂在的目录不同)
运行以下命令启动nfs 服务:
Host #/usr/sbin/exportfs –a
Host #/sbin/service nfs restart
3、 错误提示
mach/regs-gpio.h 找不到这个文件
解决方法
利用make menuconfig将内核CPU版本配成S3C2410,然后make config 最后make zImage,在编译就不会有问题了。(得出结论:要编译2410的模块驱动文件,内核源码目录必须跟其一致,也配成2410的编译源码,要是配成10则不行。当然编译10的模块文件,则必须将源码目录配成10。)
4、 错误提示
led_driver: version magic '2.6.30.4 mod_unload modversions ARMv4 ' should be '2.6.30.4-GTStudio mod_unload ARMv4 '
insmod: cannot insert 'led_driver.ko': invalid module format
解决方法
是由于编译器的版本不同和make menuconfig 配置时,
在配置单中添加如下信息
General setup --->
• Prompt for development and/or incomplete code/drivers
(-EmbedSky(填上自己的模块名称)) Local version - append to kernel release
内核版本的差异导致的。
5、 错误提示
WARNING: Symbol version dump
/home/xinghun/linux-2.6.30.4/Module.symvers
is missing; modules will have no dependencies and modversions.
解决方法
cd到内核目录下:sudo make zImage,这样就ok了。接下来重新编译驱动程序。
6、 错误提示
too few arguments to function
解决方法
函数参数不对,少了,查看并修改函数参数。
7、 错误提示
rmmod: chdir(/lib/modules): No such file or directory
解决方法
1.创建/lib/modules/2.6.30空目录就.
2.使用如下源码生成rmmod命令,就可以没有任何提示的卸载ko模块了[luther.gliethttp]
#include #include #include #include #include #include int main(int argc, char *argv[])
{
const char *modname = argv[1];
int ret = -1;
int maxtry = 10;
while (maxtry-- > 0) {
ret = delete_module(modname, O_NONBLOCK | O_EXCL);//系统调用sys_delete_module
if (ret < 0 && errno == EAGAIN)
usleep(500000);
else
break;
}
if (ret != 0)
printf(\"Unable to unload driver module \\\"%s\\\": %s\\n\
modname, strerror(errno));
}
3.把生成的命令复制到文件系统
# arm-linux-gcc -static -o rmmod rmmod.c
# arm-linux-strip -s rmmod
# cp rmmod /nfs/
cp /nfs/rmmod /sbin
8、 错误提示
FD_SET(buttons_fd, &rds);程序死在这个函数上
解决方法
buttons_fd = open(\"/dev/zzwbutton\O_RDWR|O_NONBLOCK); 注意加重点的地方,必须要设置成这样的属性。
9、 错误提示
nfs:server is not responding,still trying
解决方法
造成NFS没有回应的原因有3个,分别为网络拥塞、服务器过载和网卡丢包。
NFS 的默认传输协议是UDP,而PC机与嵌入式系统通过UPD交互时就会出现严重的网卡丢包现象。可用的解决方案是:在客户端改用TCP协议,使用下面的命令,
mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.0.121:/主机nfs目录 /挂载路径
10、访问文件时出现异常,分析步骤:
1、出异常的类型是什么.(在内核当中访问虚拟地址必须是0xc0000000开头以上的,用户空间要0xc0000000一下的)
2、查看LR后的函数,看异常是在那个函数里那个位置出错。(例:位置:0x2c/0x58则是函数一共是0x58行在0x2c行出错)
10、 警告提示
initialization from incompatible pointer type
解决方法
函数的定义和实现利的参数或返回值不一致。将其改为一致就可以了。
11、 警告提示
backslash and newline separated by space
解决方法
原来是因为\\ 后面多了一个空格