MIT6.828 实验环境安装教程
程序员文章站
2022-03-15 19:16:20
...
前期准备
安装工具包
sudo apt-get install -y build-essential libtool libglib2.0-dev libpixman-1-dev zlib1g-dev git libfdt-dev gcc-multilib gdb
克隆代码和QEMU
// 代码
git clone https://pdos.csail.mit.edu/6.828/2018/jos.git lab
// QEMU
git clone https://github.com/mit-pdos/6.828-qemu.git qemu
正式安装
1. 切换到 QEMU 目录下
执行 ./configure --disable-kvm --target-list="i386-softmmu x86_64-softmmu"
出现:ERROR: Python not found. Use --python=/path/to/python
解决:添加--python=python3
,还是不行提示Note that Python 3 or later is not yet supported
。安装python2.7
,然后使用--python=python2.7
选项。
2. 继续执行 make && make install
报错
CC qga/commands-posix.o
qga/commands-posix.c: In function ‘dev_major_minor’:
qga/commands-posix.c:633:13: error: In the GNU C Library, "major" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "major", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"major", you should undefine it after including <sys/types.h>. [-Werror]
*devmajor = major(st.st_rdev);
^~~~~~~~~~~~~~~~~~~~~~~~~~
qga/commands-posix.c:634:13: error: In the GNU C Library, "minor" is defined
by <sys/sysmacros.h>. For historical compatibility, it is
currently defined by <sys/types.h> as well, but we plan to
remove this soon. To use "minor", include <sys/sysmacros.h>
directly. If you did not intend to use a system-defined macro
"minor", you should undefine it after including <sys/types.h>. [-Werror]
*devminor = minor(st.st_rdev);
^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
解决方法:
在 qga/commands-posix.c
文件中加 #include <sys/sysmacros.h>
3. 继续执行 make && make install
再报错:
block/blkdebug.c: In function ‘blkdebug_refresh_filename’:
block/blkdebug.c:749:31: error: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4086 [-Werror=format-truncation=]
"blkdebug:%s:%s",
^~
In file included from /usr/include/stdio.h:862:0,
from /home/wzd/qemu/include/qemu-common.h:27,
from block/blkdebug.c:25:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output 11 or more bytes (assuming 4106) into a destination of size 4096
return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
/home/wzd/qemu/rules.mak:57: recipe for target 'block/blkdebug.o' failed
解决方法:config-host.mak
文件中的-Werror
去掉
再重新执行 make && make install
在 lab
源码根目录下执行 make
,如果看到
就说明编译成功了。
然后执行make qemu
,看到如下信息就说明环境搭建好了。
参考
上一篇: Python学习笔记01_基础语句
下一篇: LINUX环境下用命令行控制MIT电机
推荐阅读
-
Linux服务器开发环境搭建 Nginx+PHP+MongoDB linux 连接mongodb mongodb安装教程 mongod
-
MYSQL安装及环境配置教程 Mac
-
在CentOS6.4中安装配置LAMP环境的详细步骤_PHP教程
-
在Mac OS上编译安装Nginx+PHP+MariaDB开发环境的教程,nginxmariadb_PHP教程
-
[php扩展和嵌入式] -安装构建环境_PHP教程
-
windows环境下面安装Apache2.4+MySql5.7+PHP5.6,apache2.4mysql5.7_PHP教程
-
Windows7下PHP开发环境安装配置图文方法_PHP教程
-
lnmp一键安装环境中nginx开启pathinfo,lnmpnginx_PHP教程
-
在Windows系统上安装PHP运行环境文字教程_php基础_脚本之家
-
php环境配置 php5 mysql5 apache2 phpmyadmin安装与配置_PHP教程