1.编写hello.c内核模块
//hello.c
#include<linux/init.h>
#include<linux/module.h>
staticint hello_init(void){
printk(KERN_INFO"hello world enter\n");
return0;
}
这篇博客介绍了如何编写一个简单的Linux内核模块Hello World,包括编写源代码、创建Makefile,然后详细阐述了编译过程、模块加载使用insmod和卸载使用rmmod的步骤,并提到了通过dmesg命令观察内核模块的输出信息。
1.编写hello.c内核模块
//hello.c
#include<linux/init.h>
#include<linux/module.h>
staticint hello_init(void){
printk(KERN_INFO"hello world enter\n");
return0;
}

被折叠的 条评论
为什么被折叠?