1.安装相关依赖包
sudo snap install --classic code
sudo apt install build-essential
sudo apt install qemu
2.安装VSCode
sudo snap install --classic code
3.安装内核
sudo apt install axel
axel -n 20 https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.4.34.tar.xz
xz -d linux-5.4.34.tar.xz
tar -xvf linux-5.4.34.tar
cd linux-5.4.34
4.进行内核调试
$ make defconfig # Default configuration is based on 'x86_64_defconfig'
$ make menuconfig
# 打开debug相关选项
Kernel hacking --->
Compile-time checks and compiler options --->
[*] Compile the kernel with debug info
[*] Provide GDB scripts for kernel debugging
[*] Kernel debugging
# 关闭KASLR,否则会导致打断点失败
Pro