【linux系列】融会贯通 linux 内核编程集合 -- logsys练习项目
logsys
This is a comprehensive exercise project for linux kernel modification, including adding system calls, modifying the xfs file system, adding block device drivers, timer usage and page fault interrupt statistics.
We have combined these five parts into a log management system, of course the effect is very simple, but I believe it is enough for an exercise.
In addition to providing the source code of the final effect, a detailed tutorial on the operation of different modules is also specially prepared. Of course, in order to integrate it, we finally made some adjustments, but starting from the simplest, I believe you can understand the linux kernel better.
这是linux内核修改的一个综合练习项目,包含了添加系统调用、修改xfs文件系统、添加块设备驱动、定时器使用和缺页中断数统计。
我们将这五个部分融合成了一个日志管理系统,当然效果非常简陋,不过我相信用来作为练习已经够用了。
除了提供了最终效果的源码外,还专门准备了不同模块操作的详细教程,当然为了融合起来我们最终做了一些调整,但是从最简单的开始我相信你能更加理解linux内核。
Environment
- 虚拟机:
VMware workstation pro 16
- 虚拟机操作系统:
ubuntu-20.04.3-desktop-amd64
- 原系统内核版本:
5.11.0-46-generic
- 内核源码版本:
5.11.1
Structure
- driver -- Contains a custom block device driver module
- pagefault -- Contains a custom page fault interrupt statistics module
- syscall -- Contains system call test files
- xfs -- Most of the content in this folder comes from the linux kernel, we just modified part of the files
- main.cpp -- The main program, including the use of system calls and user logic processing
- start.sh -- Startup scripts, including preparation of various modules
- clean.sh -- Clean up scripts, remove related modules