Quick Reference
insmod
modprobe
rmmod
User-space utilities
that load modules into the running kernels and remove them.
#include
<linux/init.h>
module_init(init_function);
module_exit(cleanup_function);
Macros that designate a module’s initialization and cleanup
functions.
__init
__initdata
__exit
__exitdata
Markers for
functions (__init and __exit) and data (__initdata and __exitdata) that are only
used at module initialization or cleanup time. Items marked for initialization
may be discarded once initialization completes; the exit items may be discarded
if module unloading has not been configured into the kernel. These markers work
by causing the relevant objects to be placed in a special ELF section in the
executable file.
#include <linux/sched.h>
One of the most
important header files. This file contains definitions of much of the kernel API
used by the driver, including functions for sleeping and numerous variable
declarations.
struct task_struct *current;
The current
process.
current->pid
current->comm
The process ID and
command name for the current process.
sys/module
/proc/modules
/sys/module is a sysfs directory hierarchy containing information on
currently-loaded modules. /proc/modules is the older, single-file version of
that information. Entries contain the module name, the amount of memory each
module occupies, and the usage count. Extra strings are appended to each line to
specify flags that are currently active for the module.
vermagic.o
An object file from the kernel source directory that describes the environment a
module was built for.
#include <linux/module.h>
Required
header. It must be included by a module source.
#include
<linux/version.h>
A header file containing information on the
version of the kernel being built.
LINUX_VERSION_CODE
Integer
macro, useful to #ifdef version dependencies.
EXPORT_SYMBOL
(symbol);
EXPORT_SYMBOL_GPL (symbol);
Macro used to export a symbol
to the kernel. The second form exports without using versioning information, and
the third limits the export to GPL-licensed
modules.
MODULE_AUTHOR(author);
MODULE_DESCRIPTION(description);
MODULE_VERSION(version_string);
MODULE_DEVICE_TABLE(table_info);
MODULE_ALIAS(alternate_name);
Place documentation on the module in the object
file.
module_init(init_function);
module_exit(exit_function);
Macros that declare a module’s initialization and cleanup functions.
#include
<linux/moduleparam.h>
module_param(variable, type, perm);
Macro that creates a module parameter that can be adjusted by the user when the
module is loaded (or at boot time for built-in code). The type can be one of
bool, charp, int, invbool, long, short, ushort, uint, ulong, or
intarray.
#include <linux/kernel.h>
int printk(const char * fmt,
...);
The analogue of printf for kernel code.
FROM:LDD Chapter 2
时间: 2024-11-08 06:14:22
FROM:LDD Chapter 2的相关文章
GPU keylogger &;&; GPU Based rootkit(Jellyfish rootkit)
catalog 1. OpenCL 2. Linux DMA(Direct Memory Access) 3. GPU rootkit PoC by Team Jellyfish 4. GPU keylogger 5. DMA Hack 1. OpenCL OpenCL(Open Computing Language)是第一个面向异构系统通用目的并行编程的开放式.免费标准,也是一个统一的编程环境,便于软件开发人员为高性能计算服务器.桌面计算系统.手持设备编写高效轻便的代码,而且广泛适用于多核心处
Chapter 2. OpenSSL的安装和配置学习笔记
Chapter 2. OpenSSL的安装和配置学习笔记 2.1 在linux上面安装OpenSSL我还是做点No paper事情比较在行,正好和老师的课程接轨一下.以前尝试过在Windows上面安装过openSSL,这次正好在Linux上面实现一下. 希望各位园友门纠错,征求意见中. 2.1.1 安装OpenSSL的系统环境和编译环境 测试环境:Linux MINT 16 Petra ? 1 2 3 4 5 6 $ lsb_release -a #查看linux发行版本系统信息 No LSB
ANSI Common Lisp Chapter 2
Chapter 2 总结 (Summary) Lisp 是一种交互式语言.如果你在顶层输入一个表达式, Lisp 会显示它的值. Lisp 程序由表达式组成.表达式可以是原子,或一个由操作符跟着零个或多个实参的列表.前序表示法代表操作符可以有任意数量的实参. Common Lisp 函数调用的求值规则: 依序对实参从左至右求值,接着把它们的值传入由操作符表示的函数. quote 操作符有自己的求值规则,它完封不动地返回实参. 除了一般的数据类型, Lisp 还有符号跟列表.由于 Lisp 程序是
Chapter 5 MySQL Server Administration_1
Chapter 5 MySQL Server Administration Table of Contents 5.1 The MySQL Server 5.1.1 Configuring the Server 5.1.2 Server Configuration Defaults 5.1.3 Server Option and Variable Reference 5.1.4 Server Command Options 5.1.5 Server System Variables 5.1.6
Notes : <;Hands-on ML with Sklearn &; TF>; Chapter 7
.caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1px solid #000; } .table { border-collapse: collapse !important; } .table td, .table th { background-color: #fff !important; } .table-bordered th, .table-bordere
软工Chapter Six
软工Chapter six 团队和流程 典型的软件团队模式和开发流程是:主治医师模式.明星模式.社区模式.业余剧团模式.秘密团队.特工团队.交响乐团模式.爵士乐模式.功能团队模式:写了再改模式.瀑布模型.瀑布模型的各种变形.统一流程.老板驱动的流程.渐进交付的流程. 现在的编程离不开团队的合作,那么怎样的组合才能算是一个团队呢?首先,团队有一致的集体目标,团队要一起完成这目标.一个团队的成员不一定要同时工作,但一定要有共同的目标.另外团队成员有各自的分工,互相依赖合作,共同完成任务. 软件团队有
[AWDwR4] chapter 11 Play time 2th: use blind_up effect
chapter 11 Play time Play time 2: 使用Script.aculo.us JavaScript库中的blind_up效果代替隐藏cart这个div的过程. 上网搜了一下,jquery中有blind这个效果,所以就用jquery中的hide("blind"),而不使用Script.aculo.us JavaScript库 app/views/carts/destroy.js.erb这个文件可以有好几种写法,对照着可以加深理解:
Professional C# 6 and .NET Core 1.0 - Chapter 41 ASP.NET MVC
What's In This Chapter? Features of ASP.NET MVC 6 Routing Creating Controllers Creating Views Validating User Inputs Using Filters Working with HTML and Tag Helpers Creating Data-Driven Web Applications Implementing Authentication and Authorization W
Chapter.1 C#语言基础
一.C#项目组成结构 1.项目后缀:.config---配置文件 .csproj---项目文件(管理文件) .sln---解决方案文件(管理项目) .cs---源文件(程序代码) p.s.: 后缀不同代表文件类型也不同,这些文件后缀类型会在”解决方案资源管理器“中看到. 2.主函数.输出语句.输入语句: namespace Chapter.2 //命名空间 { class Program //类 { static void Main(string[] args) //方法(主函数) { Cons