源码地址:
https://github.com/figozhang/runninglinuxkernel_4.0/tree/rlk_basic/rlk_lab/rlk_basic/chapter_5/lab1_simple_driver
编译并拷贝
同时编译用户程序
arm-linux-gnueabi-gcc test.c -o test --static
加载驱动
添加设备节点
mknod /dev/demo_drv c 252 0
转载于:https://blog.51cto.com/haidragon/2386221