本文共 449 字,大约阅读时间需要 1 分钟。
以前看过很多次linux相关的资料,一直没亲自动手写,今天通过半天努力,终于完成了一个自己的linux小驱动
hello.c
#includeMakefile#include MODULE_LICENSE("Dual BSD/GPL");static int hello_init(void){ printk(KERN_ALERT "Hello, world\n");return 0;}static void hello_exit(void){ printk(KERN_ALERT "Goodbye, cruel world\n");}module_init(hello_init);module_exit(hello_exit);
obj-m:=hello.o
readme
执行make采用的命令如下
make -C /opt/SN/SDK/sysroots/eagle8074/usr/src/kernel/ M=`pwd` modules转载地址:http://fwhof.baihongyu.com/