[代码实例][Linux内核][模块]helloworld程序
2016-06-21 01:09
375 查看
源文件
/* * hello.c */ #include <linux/init.h> #include <linux/module.h> 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); MODULE_LICENSE("Dual BSD/GPL");
Makefile文件
ifneq ($(KERNELRELEASE),) obj-m := hello.o else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif
相关文章推荐
- centos rpm包及命令学习
- linux 下的常用操作
- arm-none-linux-gnueabi-gcc 下载地址
- linux相关博客目录
- Centos Python2 升级到Python3的简单实现
- 汇编学习——使用Linux系统调用
- 查看CentOS版本方法
- Centos版本 32或64位查看命令
- Linux-Java线上故障排查一(高cpu使用率)
- 【 Linux 】Keepalived实现双主模型高可用集群
- Linux 盘符修改 & 开机自动挂载分区
- Linux下基于格式化命令 格式化的方法
- Linux centos 服务器乱码问题
- 在Linux上使用的10种云备份方案
- 关于nohup命令
- CentOS的ssh sftp配置及权限设置整理
- linux unzip 乱码
- linux c的线程池
- Linux配置文件路径大全
- linux中fork函数的一个小思考