hello.c#include <linux/module.h> //needed by all modules#include <linux/kernel.h> //needed for KERN_ALERT#include <linux/init.h>MODULE_LICENSE("Dual BSD/GPL");static int hello_init(void){ printk(KERN_INFO "hello, world!/n"); return 0;}static void hello_exit(void
1.在drivers/char/目录下建立一个first_driver_hello.c文件 文件的内容如下 /************************************* NAME:first_driver_hello.c COPYRIGHT:328977974@qq.com **************************************/ #include <linux/module.h> #include <linux/kernel.h> MODULE_LICENSE("GPL"); static int hello_
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号