rqdmap
首页
博客
算法
漫评
关于
日志
创建时间
修改时间
字数
GDB
基于QEMU搭建内核调试环境
2023.03.06 14:58
2023.05.29 23:05
Linux
Kernel
QEMU
GDB
3557字
搞一份内核源码, 并尝试调试一个拓展内核功能的补丁 Kernel-Mode-Linux; 对于该模块的调试与分析见后续博文< 启用Kernel Model Linux> Linux内核编译 这里使用的是Linux4.4.12(4.0.*, 3.1*, 2.6.*系列也有尝试过), 并且还需要打上PREEMPT_RT实时内核补丁, 借鉴于Github KML仓库: bash 1# 0. Clone this repository 2git clone git@github.com:sonicyang/KML.git 3 4# 1. Clone Linux 4.4.12 5git clone -b v4.4.12 --depth 1 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git 6 7# You will get a copy of Linux 4.4.12 source in directory linux 8 9# 2. Download PREEMPT_RT patch 10wget https://cdn.kernel.org/pub/linux/kernel/projects/rt/4.4/older/patch-4.4.12-rt18.patch.xz 11 12# You will get a file patch-4.4.12-rt18.patch.xz 13 14# 3. Apply the PREEMPT_RT patch 15cd linux 16xzcat ../patch-4.4.12-rt18.patch.xz | patch -p1 17 18# You will have a modified Linux 4.4.12 source with PREEMPT_RT, now. 19 20# 4. Commit the the changes at once (Otherwise, git am will fail) 21git add . 22git commit -m "Apply PREEMPT_RT" 23 24# Now you should have a clean git repository without unstaged changes 25 26# 5. Apply these 2 patches 27cp ../KML/*.patch . 28git am *.patch 29 30# You are good to go 31# Compile the kernel then you should be able to use KML PREEMPT_RT补丁 关于该内核补丁, 是为了将Linux内核拓展为一个实时的操作系统. ...