linux kernel module

#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

static int hello_init(void)
{
printk(KERN_ALERT "hello world!\n");
return 0;
}

static void hello_exit(void)
{
printk(KERN_ALERT "exit ok!\n");
}

module_init(hello_init);
moduel_exit(hello_exit);

时间: 2024-07-31 04:54:06

linux kernel module的相关文章

Linux Kernel Module(LKM) Init、Delete Code Principle Learning

目录 1. Linux模块(LKM)简介 2. 使用Linux模块 3. LKM模块加载原理 4. LKM模块卸载原理 1. Linux模块(LKM)简介 模块是一种向linux内核添加"设备驱动程序"."文件系统"."其他组件"的有效方法,而无须重新编译内核或重启系统,这消除了许多限制,同时带来了很多的优点 1. 通过使用模块,内核程序员能够预先编译大量驱动程序,而不会致使内核映像的尺寸发生膨胀.在自动检测硬件或用户提示后,安装例程会选择适当的

CentOS启动流程、Grub legacy配置、linux kernel模块管理、伪文件系统介绍

写在前面: 博客书写牢记5W1H法则:What,Why,When,Where,Who,How. 本篇主要内容: ● 启动相关基础概念汇总 ● 启动流程 ● init程序类型     /etc/rc.d/rc     chkconfig     /etc/rc.d/rc.sysinit ● GRUB legacy     命令行接口     配置文件 ● Linux Kernel     内核模块查看与管理         lsmod         modinfo         modprob

ARM32 Linux kernel virtual address space

http://thinkiii.blogspot.jp/2014/02/arm32-linux-kernel-virtual-address-space.html The 32-bit ARM CPU can address up to 2^32 = 4GB address*. It's not big enough in present days, since the size of available DRAM on computing devices is growing fast and

How to Blacklist a Kernel Module in CentOS

How to Blacklist a Kernel Module in CentOS How to Blacklist a Kernel Module in CentOS is an important piece of knowledge for the sysadmin. In Centos Linux, preventing a kernel module from loading during boot is also called blacklisting. We add the mo

Linux Kernel - Debug Guide (Linux内核调试指南 )

http://blog.csdn.net/blizmax6/article/details/6747601 linux内核调试指南 一些前言 作者前言 知识从哪里来 为什么撰写本文档 为什么需要汇编级调试 ***第一部分:基础知识*** 总纲:内核世界的陷阱 源码阅读的陷阱 代码调试的陷阱 原理理解的陷阱 建立调试环境 发行版的选择和安装 安装交叉编译工具 bin工具集的使用 qemu的使用 initrd.img的原理与制作 x86虚拟调试环境的建立 arm虚拟调试环境的建立 arm开发板调试环

linux kernel 字符设备详解

有关Linux kernel 字符设备分析: 参考:http://blog.jobbole.com/86531/ 一.linux kernel 将设备分为3大类,字符设备,块设备,网络设备. 字符设备是指只能一个字节一个字节读写的设备, 常见的外设基本上都是字符设备. 块设备:常见的存储设备,硬盘,SD卡都归为块设备,块设备是按一块一块读取的. 网络设备:linux 将对外通信的一个机制抽象成一个设备, 通过套接字对其进行相关的操作. 每一个字符设备或块设备都在/dev目录下对应一个设备文件.l

使用 GIT 获得Linux Kernel的代码并查看,追踪历史记录

Linux kernel  的官方 GIT地址是: http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git 可以从这个地址拿到 kernel 的 代码仓库. 1. 拿代码仓库 [plain] view plaincopyprint? git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 2. 查看状态: [pla

OpenWrt Kernel Module Creation Howto

OpenWrt Kernel Module Creation Howto About OpenWrt Kernel Module Compilation You are planning to compile a kernel module? This howto will explain what you have to do, to have your kernel module installable as an ipkg. Enable the kernel options Enable

Linux: the schedule algorithm in Linux kernel

Linux kernel里面用到的一个叫 CFS (Completely-Fair-Scheduler)的调度算法.在网上找的描述都很不直观,很难读.但是找到了一篇很通俗易懂的(大道至简啊...): http://people.redhat.com/mingo/cfs-scheduler/sched-design-CFS.txt 为了防止链接失效,粘贴全文如下: This is the CFS scheduler. 80% of CFS's design can be summed up in