[工具配置]安装qemu

参考文章:MIT-6.828-JOS-环境搭建 - gatsby123 - 博客园 (cnblogs.com)

6.828 | 编译QEMU_‘%s’ directive output may be truncated writing up -CSDN博客

1.安装工具包

执行以下指令

sudo apt-get install -y build-essential libtool* libglib2.0-dev libpixman-1-dev zlib1g-dev git libfdt-dev gcc-multilib gdb python2.7

2.安装qemu

qemu是一个与bochs和pearpc类似的模拟器,或者说是仿真器,完全的软件模拟,他能模拟很多类型的cpu。

2.1下载

git clone https://github.com/mit-pdos/6.828-qemu.git qemu

2.2编译&安装

首先进入qemu文件夹下:

ce qemu

执行命令:

./configure --disable-werror --target-list="i386-softmmu x86_64-softmmu" --python=python2.7

编译安装指令:

make -j8 && sudo make install

3说明

按照以上步骤没有问题,对出现的问题已经做了调整

1.

没有安装python2.7 且没有指定--build=python2.7,会报错

出现报错 ERROR: Python not found. Use --python=/path/to/python

2.

libtool工具没有安装完全,会报错------------->sudo apt-get install libtool*

disanbling libtool due to broken toolchain support

4.可能出现的问题

1.

在 qga/commands-posix.c文件中的 #include <sys/types.h> 下面增加#include <sys/sysmacros.h>即可。

2.

./configure --disable-werror ,就不会报这个错了

 3.

这个不是错误,只需要把qemu文件夹下的config-host.mak文件中的-Werror去掉就好了(直接ctrl+F搜索Werror)

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",

5.裸机运行

!!!!!没有操作系统

首先从官网clone实验的框架代码到本地:git clone https://pdos.csail.mit.edu/6.828/2018/jos.git lab

在lab源码根目录下执行make,如果看到 

 就说明编译成功了,就执行make qume,看到以下信息就说明裸机环境搭建好了。

博主计划跟着mit课程搭建一个操作系统,但不是从零搭建起,毕竟没人能从零开始。

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值