hello world module
来源:互联网 发布:centos安装unzip 编辑:程序博客网 时间:2024/04/29 22:19
hello.c
//////////////////////////////////////////////////////////////////////////
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE ("Dual BSD/GPL");
static int hello_init (void)
{
printk (KERN_ALERT "hello to module");
return 0;
}
static void hello_exit (void)
{
printk (KERN_ALERT "goodbye hello to module");
}
module_init (hello_init);
module_exit (hello_exit);
Makefile
//////////////////////////////////////////////////////////////////////
obj-m:=hello.o
make command
///////////////////////////////////////////////////////////////////////
make -C /usr/src/linux-headers-2.6.28-18-generic/ M=`pwd` modules
install the module
////////////////////////////////////////////////////////////////////////
sudo insmod ./hello.ko
trace the hello module
////////////////////////////////////////////////////////////////////////
cat /proc/modules | grep hello
see : hello 9344 0 - Live 0xf7e01000
remove the module
////////////////////////////////////////////////////////////////////////
sudo rmmod hello
- hello world module
- linux kernel module - hello world
- 2440 module test, hello world - life sucks
- linux的module的“hello world”程序
- linux内核驱动之hello world module
- Orchard(四):创建Module --Hello World
- a simple hello world nginx module
- 2.1. Hello, World (part 1): The Simplest Module
- a hello world module for linux device driver
- Drupal——module开发实现hello world
- ubuntu下hello world kernel Module:MODPOST 0 modules
- Invaild Module Format linux中hello world 程序编写
- Hello World!【Hello World】
- hello module
- Hello, world!
- Hello World!
- Hello world!
- Hello World!
- java常用设计模式
- MySQL 命令行 中文乱码
- 统计一个项目的有效代码
- PHP 并发控制样例(转)
- Java数据导出到excel和word
- hello world module
- Physx简介
- 最佳客户Tammy
- oracle和Mysql连接数据库
- 文件合并
- 查看本机IP
- PhysX开发环境配置
- Windows Mobile 开发系列文章收藏
- Asp.Net2.0验证视图状态 MAC 失败 ( Validation of viewstate MAC failed )