参考资料
- https://www.kernel.org/doc/html/latest/dev-tools/coccinelle.html#coccinelle
WSL 安装
参考 win10 官方文档
记得设置大小写敏感
Win10设置WSL大小写敏感源码下载
https://zhouchengzhu.coding.net/p/workshop-linux/d/linux-kernel-labs/git
编译
Send your first patch to Linux kernel.pdf
需要下载的库
sudo apt install make gcc flex \
bison libelf-dev libssl-dev sparse clang-8 \
build-essential qemu-system-x86 \
qemu-system-arm
sudo apt install -y flex bison build-essential gcc-multilib libncurses5-dev qemu-system-x86 qemu-system-arm qemu-kvm python3 minicom
kvm
sudo apt install qemu-kvm libvirt-bin bridge-utils virtinst virt-manager
编译
$ make defconfig
$ make
$ make modules
启动虚拟 Virtual Machine Setup
Virtual Machine Setup
https://ocw.cs.pub.ro/courses/so2/resurse/masini-virtuale
sudo apt install -y flex bison build-essential gcc-multilib libncurses5-dev qemu-system-x86 qemu-system-arm qemu-kvm python3 minicom
工具
coccinelle
一个模式匹配,正则表达式的工具。
https://www.kernel.org/doc/html/latest/dev-tools/coccinelle.html#coccinelle
编译labs
cd tools/labs ; LABS=kernel_modules make skels
LABS="kernel_modules/6-cmd-mod kernel_modules/8-kprobes" make skels