arm驱动模块的编写

先写一个简单的驱动模块:
源码地址:
https://github.com/figozhang/runninglinuxkernel_4.0/tree/rlk_basic/rlk_lab/rlk_basic/chapter_4/lab1_simple_module
进入目录
做一些初始化:
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
然后编译:
make BASEINCLUDE=/home/haidragon/Desktop/work
查看 file mytest.ko
arm驱动模块的编写
拷贝到对应目录去
cp ./mytest.ko '/home/haidragon/Desktop/work/kmodules/'
运行arm模拟器
sh run.sh arm32
进入驱动目录 cd /mnt
加载驱动 insmod mytest.ko
arm驱动模块的编写

猜你喜欢

转载自blog.51cto.com/haidragon/2386179