linux kernel module 编译和加载
来源:互联网 发布:linux有哪些知识点 编辑:程序博客网 时间:2024/05/22 12:52
1、kernel module 准备
kernel 代码
#include <linux/kernel.h>#include <linux/module.h>#include <linux/init.h>static int __init hello_init(void){ printk("<1> hello modules wordl!\n"); return 0;}static void __exit hello_exit(void){ return;}module_init(hello_init);module_exit(hello_exit);MODULE_LICENSE("GPL");makefile 文件
obj-m :=testmodule.oKDIR :=/lib/modules/$(shell uname -r)/buildPWD := $(shell pwd)default:$(MAKE) -C $(KDIR) M=$(PWD) modules
编译make
编译后会生成 testmodule.ko 等文件
2、加载编译的内核模块
执行insmod hellomod.ko
查看内核中已加载的模块
lsmod
3、卸载编译的内核模块
rmmod hellomod
4、查看系统日志输出
tail /var/log/messages
- linux kernel module 编译和加载
- Linux kernel module加载
- linux kernel、module编译
- Linux Kernel 学习笔记1:module的基本结构和编译
- Linux kernel & module program
- Build linux kernel Module
- linux kernel module programming
- compiling-linux-kernel-module
- linux kernel module 实例
- One linux kernel module example
- Linux Debugging 8 - Kernel Module
- Kgdb调试linux kernel module
- linux kernel module - hello world
- 一個簡單的 Linux Kernel Module
- Linux kernel module symbols relocation
- 编译和安装Android Linux Kernel
- Kernel中Module调用编译问题
- Couldn't find the kernel version the module was compiled for Linux 驱动 编译 错误
- myeclipse报错“java.lang.NoSuchFieldError: INSTANCE” 以及 myeclipse项目名上有感叹号
- Linux磁盘
- xubuntu播放mp3 avi flash等多媒体文件
- poj 1231 java
- Android图像处理之Bitmap类
- linux kernel module 编译和加载
- ORACLE触发器和new、old特殊变量
- VIM
- sql吧 又回来了
- MFC工程中的数据在cmd输出
- 去掉 freebsd 中的响铃
- Linux目录介绍
- What is meant by Primary Index and Secondary Index
- apache和php之间协同工作的配置