Building QEMU for Pintos on Ubuntu
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
From:
/SSE3044F12/QEMU
Install QEMU full system emulation binaries
Install the qemu-system package and make a symbolic link from /usr/bin/qemu to/usr/bin/qemu-system-i386.
$ sudo apt-get install qemu-
system
$ cd /usr/bin
$ sudo ln -s qemu-system-i386
qemu
Modify the Pintos script
In Pintos, QEMU (or bochs) is invoked via the script ~/pintos/src/utils/pintos. The script attaches the'-no-kqemu' argument when QEMU is used as a system simulator, but the current version of qemu does not undertand that argument. So, we simply drop the argument by commenting out the corresponding line (line 622) in the ~/pintos/src/utils/pintos script.
...
# Runs QEMU.
sub run_qemu {
print "warning: qemu doesn't support --terminal\n"
if $vga eq 'terminal';
print "warning: qemu doesn't support jitter\n"
if defined $jitter;
my (@cmd) = ('qemu');
#push (@cmd, '-no-kqemu');
push (@cmd, '-hda', $disks[0]) if defined $disks[0];
push (@cmd, '-hdb', $disks[1]) if defined $disks[1];
push (@cmd, '-hdc', $disks[2]) if defined $disks[2];
push (@cmd, '-hdd', $disks[3]) if defined $disks[3];
push (@cmd, '-m', $mem);
push (@cmd, '-net', 'none');
push (@cmd, '-nographic') if $vga eq 'none';
push (@cmd, '-serial', 'stdio') if $serial && $vga ne 'none';
push (@cmd, '-S') if $debug eq 'monitor';
push (@cmd, '-s', '-S') if $debug eq 'gdb';
push (@cmd, '-monitor', 'null') if $vga eq 'none' && $debug eq 'none';
run_command (@cmd);
}
...
Now use it!
QEMU (instead of bochs) can be used to run Pintos by specifying --qemu argument when you run the ~/pintos/src/utils/pintos script as follows:
$ cd ~/pintos/src/threads
$ make
$ ../utils/pintos --qemu -- run
alarm-multiple
Note that if you want to use QEMU during make check, you have to change the definition of SIMULATORfrom --bochs to --qemu in the Make.vars file in
~/pintos/src/[threads|userprog|vm|filesys]/ directories.
# -*- makefile -*-
kernel.bin: DEFINES =
KERNEL_SUBDIRS = threads devices lib lib/kernel $(TEST_SUBDIRS)
TEST_SUBDIRS = tests/threads
GRADING_FILE = $(SRCDIR)/tests/threads/Grading
SIMULATOR = --qemu