参考资料

Linux Kernel Teaching

编译

Send your first patch to Linux kernel.pdf

需要下载的库

  1. sudo apt install make gcc flex \
  2. bison libelf-dev libssl-dev sparse clang-8 \
  3. build-essential qemu-system-x86 \
  4. qemu-system-arm
  1. sudo apt install -y flex bison build-essential gcc-multilib libncurses5-dev qemu-system-x86 qemu-system-arm qemu-kvm python3 minicom

kvm

二、在 Ubuntu 上安装 KVM

  1. sudo apt install qemu-kvm libvirt-bin bridge-utils virtinst virt-manager

编译

  1. $ make defconfig
  2. $ make
  3. $ make modules

启动虚拟 Virtual Machine Setup

Virtual Machine Setup
https://ocw.cs.pub.ro/courses/so2/resurse/masini-virtuale

  1. 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

  1. cd tools/labs ; LABS=kernel_modules make skels
  2. LABS="kernel_modules/6-cmd-mod kernel_modules/8-kprobes" make skels