【发布时间】:2019-06-08 15:35:25
【问题描述】:
我正在关注 MIT 操作系统工程讲座。我已经安装了 Qemu 并成功运行它,我可以在 "make clean" "make" 和 "make qemu" 文件夹中使用这些命令。 实验室还有一个单独的文件夹...根据说明,我们必须在实验室文件夹中使用“make”命令,但是当我在实验室文件夹中使用 make 命令时 我收到以下错误
*** Error: Couldn't find a working QEMU executable.
*** Is the directory containing the qemu binary in your PATH
*** or have you tried setting the QEMU variable in conf/env.mk?
***
***
*** Error: Couldn't find a working QEMU executable.
*** Is the directory containing the qemu binary in your PATH
*** or have you tried setting the QEMU variable in conf/env.mk?
***
+ as kern/entry.S
+ cc kern/entrypgdir.c
+ cc kern/init.c
+ cc kern/console.c
+ cc kern/monitor.c
+ cc kern/printf.c
+ cc kern/kdebug.c
+ cc lib/printfmt.c
+ cc lib/readline.c
+ cc lib/string.c
+ ld obj/kern/kernel
+ as boot/boot.S
+ cc -Os boot/main.c
+ ld boot/boot
boot block is 390 bytes (max 510)
+ mk obj/kern/kernel.img
我在某处读到我应该在 conf/env.mk 文件中设置路径我找到了 conf/env.mk 文件,但我不确定如何设置 PATH。 conf/env.mk 文件内容如下:
# env.mk - configuration variables for the JOS lab
# '$(V)' controls whether the lab makefiles print verbose commands (the
# actual shell commands run by Make), as well as the "overview" commands
# (such as '+ cc lib/readline.c').
#
# For overview commands only, the line should read 'V = @'.
# For overview and verbose commands, the line should read 'V ='.
V = @
# If your system-standard GNU toolchain is ELF-compatible, then comment
# out the following line to use those tools (as opposed to the i386-jos-elf
# tools that the 6.828 make system looks for by default).
#
# GCCPREFIX=''
# If the makefile cannot find your QEMU binary, uncomment the
# following line and set it to the full path to QEMU.
#
# QEMU=
我使用的是 ubuntu 16.04 提前致谢!!
【问题讨论】:
-
env.mk 文件中的注释回答了您的问题:“如果 makefile 找不到您的 QEMU 二进制文件,请取消注释以下行并将其设置为 QEMU 的完整路径”。在 Ubuntu 上,i386 仿真二进制文件是 'qemu-system-i386'。