下载Linux内核源码并编译
wget https://raw.github.com/mengning/mykernel/master/mykernel-2.0_for_linux-5.4.34.patch 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 patch -p1 < ../mykernel-2.0_for_linux-5.4.34.patch sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev make -j$(nproc) # 编译的时间比较久哦 sudo apt install qemu # install QEMU qemu-system-x86_64 -kernel arch/x86/boot/bzImage
当quemu成功启动编译后的内核文件时,从qemu窗口中可以看到my_start_kernel在执行,同时my_timer_handler时钟中断处理程序周期性执行。
标签:kernel,Code,5.4,tar,34,start,install,linux From: https://www.cnblogs.com/hunter-chen/p/vsode-linuxkernel-analysis.html