MIT:不幸的是,QEMU的调试工具虽然功能强大,但有点不成熟,所以我们强烈建议你使用我们的补丁版QEMU而不是你的发行版附带的库存版本。
https://pdos.csail.mit.edu/6.828/2018/tools.html
注意:最好使用32位Ubuntu,我在64位上安装后,不知道怎么启动。。。
Test Your Compiler Toolchain
objdump -i
The second line should say elf32-i386.
gcc -m32 -print-libgcc-file-name
The command should print something like /usr/lib/gcc/i486-linux-gnu/version/libgcc.a or /usr/lib/gcc/x86_64-linux-gnu/version/32/libgcc.a
If both these commands succeed, you're all set, and don't need to compile your own toolchain.
QEMU Emulator
下载源码
git clone https://github.com/mit-pdos/6.828-qemu.git qemu
安装库
sudo apt-get install libsdl1.2-dev
sudo apt-get install libtool-bin
sudo apt-get install libglib2.0-dev
sudo apt-get install libz-dev
sudo apt-get install libpixman-1-dev
添加路径,找到并打开~/.bashrc,加入以下两行代码
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH
回到qemu目录下
./configure --disable-kvm --disable-werror --prefix=$HMOE --target-list="i386-softmmu x86_64-softmmu"
安装
make && make install
启动
qemu-system-i386
弹出qemu,则安装成功。