Linux下编译驱动发现没有内核源码的解决办法
CentOS系统
yum install -y kernel-devel
Ubuntu系统
apt-get install linux-source
以上~!
参考:《或许你不需要整个内核的源代码》 - http://wiki.centos.org/zh/HowTos/I_need_the_Kernel_Source
yum install -y kernel-devel
apt-get install linux-source
以上~!
参考:《或许你不需要整个内核的源代码》 - http://wiki.centos.org/zh/HowTos/I_need_the_Kernel_Source
项目中有个驱动代码之前在老版本linux系统中编写的 在移植到 linux-kernel-3.2.0 后,编译时出现一处错误 fatal error: linux/smp_lock.h: No such file or directory
将:
#include <linux/smp_lock.h>
替换成:
#include <linux/hardirq.h>