1.注意编译的时候会出现gcc-5 无法编译,这时候就需要
sudo rm /usr/bin/g++ /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
sudo ln -s /usr/bin/g+±4.9 /usr/bin/g++
先要
apt install gcc-4.9
2.注意在make的过程中会出现问题
这里,我们打开 kernel/timeconst.pl
@val = @{KaTeX parse error: Expected '}', got 'EOF' at end of input: canned_values{hz}};
if (!defined(@val)) {
@val = compute_values(KaTeX parse error: Expected 'EOF', got '}' at position 7: hz); }̲ output(hz, @val);
将if (!defined(@val)) 改为if (!@val),再次编译就可以通过了。
最后qemu-system-x86_64 -kernel ./linux-2.6.39/arch/x86/boot/bzImage -initrd ./busybox-1.30.0/rootfs.img.gz -append “root=/dev/ram init=/linuxrc” -serial file:output.txt
截图如下: