type
status
slug
summary
tags
category
icon
password
new update day
Property
Oct 22, 2023 01:31 PM
created days
Last edited time
Oct 22, 2023 01:31 PM
Hello World kernel module
今天开始学习内核模块的 hello world 的编写。在整个过程中,我们需要完成 helloworld 模块的编写,并且对它进行插入和删除操作。
编码
helloworld.c
在编写Linux内核模块的时候,我们首先要编写自己的.c文件,然后需要编写自己的Makefile文件,之后使用make命令来对自己的.c文件进行编译,生成.ko文件,最后的.ko文件就是我们最后所需要的模块了,我们就是对它进行插入和删除。
首先我们来编写自己的.c文件
Makefile
加载测试
加载
查看加载结果
查看内核日志
删除
- Author:tangcuyu
- URL:https://expoli.tech/articles/2023/07/05/Hands-on-practice---insertion-and-deletion-of-kernel-modules
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts