環(huán)境搭建
課程鏈接
環(huán)境搭建
- 檢查編譯器工具鏈
gcc -m32 -print-libgcc-file-name
如果輸出結(jié)果類(lèi)似/usr/lib/gcc/i486-linux-gnu/version/libgcc.a或者/usr/lib/gcc/x86_64-linux-gnu/version/32/libgcc.a姆吭,則不用修改工具鏈
testcompiletools.png
- 安裝QEMU
git clone https://github.com/mit-pdos/6.828-qemu.git qemu
cd qemu
./configure --disable-kvm --disable-werror --python=/usr/bin/python2 --target-list="i386-softmmu x86_64-softmmu"
make
在make的過(guò)程中會(huì)遇到幾個(gè)錯(cuò)誤
第一個(gè)編譯錯(cuò)誤
解決方法:在qga/commands-posix.c文件中添加sys/sysmacros.h頭文件
第二個(gè)編譯錯(cuò)誤
解決方法:在hw/9pfs/virtio-9p.c文件中添加sys/sysmacros.h頭文件
make install
- 下載JOS源碼
git clone https://pdos.csail.mit.edu/6.828/2018/jos.git lab
cd lab
make
JOScompile.png
make qemu-nox
JOSrun.png
環(huán)境搭建完成
ps:關(guān)于上面的源碼下載最好搭建一個(gè)梯子,不然下載速度會(huì)懷疑人生。
2019年7月14日