启动 gem5 X86 Ubuntu 全系统模拟 [英] Booting gem5 X86 Ubuntu Full System Simulation

查看:105
本文介绍了启动 gem5 X86 Ubuntu 全系统模拟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在gem5上运行相对较新版本的x86磁盘映像.从本指南开始,我将Ubuntu 12.04磁盘映像与Kernel v3.2.1作为该组合适用于其他人.

在某些时候,模拟器刚刚挂起,请分享有关原因和可能解决方案的任何想法.谢谢!

您可以在下面的m5term/telnet上找到输出.之后,是准备磁盘映像和内核以供参考的过程.

gem5终端的最后一部分(m5term/telnet):

 #完整的终端输出在这里:#https://gist.github.com/agyaglikci/018533c8d2ff2a9e86c9144d5f4a9224#file-ubuntu12-04-kernel3-2-1-gem5-terminal释放未使用的内核内存:已释放348k在/sys/fs/selinux上安装selinuxfs失败:没有这样的文件或目录init:尿素头主工艺(997)终止,状态为5mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息.mknod:额外的操作数'64'尝试"mknod --help"以获取更多信息. 

以下是准备磁盘映像的完整故事:

  cd $ {M5_PATH}#下载并挂载磁盘映像wget http://cdimage.ubuntu.com/ubuntu-base/releases/12.04/release/ubuntu-base-12.04.4-core-amd64.tar.gzsudo util/gem5img.py初始化磁盘/ubuntu-12.04.img 4096mkdir mntsudo util/gem5img.py挂载磁盘/ubuntu-12.04.img mnt须藤tar xzvf ubuntu-base-12.04.4-core-amd64.tar.gz -C mnt须藤cp/etc/resolv.conf mnt/etc/#Nano用于将内容粘贴在http://www.lowepower.com/jason/creating-disk-images-for-gem5.html中须藤nano mnt/etc/init/tty-gem5.conf须藤nano mnt/etc/hosts须藤nano mnt/etc/fstab#复制m5二进制文件cd util/m5弄干净make all -f Makefile.x86须藤cp m5 $ {M5_PATH}/mnt/sbin/cd $ {M5_PATH}须藤umount mnt须藤Lostup -d/dev/loop0 

内核编译步骤:

我下载了v3.2.1,然后将v2.6.28.4的配置文件复制为v3.2.1的.config文件.点击 make vmlinux 后,对每个问题按Enter以获取默认值.

  cd〜git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.gitcd linux稳定的git checkout v3.2.1wget http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2tar jxvf config-x86.tar.bz2cp configs/linux-2.6.28.4 .config弄干净使vmlinux -j 4#在这里编译器会询问很多配置,我每次都按下回车键来传递默认值.cp vmlinux $ {M5_PATH}/binaries/vmlinux-amd64-v3.2.1 

最后,命令是这样的:

  build/X86/gem5.opt -d AMD64 configs/example/fs.py --disk-image $ {M5_PATH}/disks/ubuntu-12.04.img --kernel $ {M5_PATH}/binaries/vmlinux-amd64-3.2.1 

任何有关错误消息或冻结原因/解决方案等的评论将非常有帮助.提前致谢!

解决方案

以下是引导FS模式的最佳解决方案,但是IMHO Ubuntu不是一个好的选择,因为systemd大大降低了引导阶段的速度:

使用配置文件编译linux内核.内核4.8.13应该可以正常工作(来源: Jason Lowe Power,gem5的评论者之一).

现在,您想要的是系统映像.最好的选择是基于gentoo的此图像./p>

I need to run a relatively newer version of x86 disk image on gem5. Starting from this guide I used Ubuntu 12.04 disk image with Kernel v3.2.1 as that combination was worked for someone else.

After some point, simulator just hangs, please share any ideas about the reason and possible solutions. Thank you!

You may find the output on the m5term/telnet below. After that, is the process to prepare the disk image and the kernel for reference.

The last part of the terminal of gem5 (m5term/telnet):

# The full terminal output is here:
# https://gist.github.com/agyaglikci/018533c8d2ff2a9e86c9144d5f4a9224#file-ubuntu12-04-kernel3-2-1-gem5-terminal

Freeing unused kernel memory: 348k freed
Mount failed for selinuxfs on /sys/fs/selinux:  No such file or directory
init: ureadahead main process (997) terminated with status 5
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.

Here is the full story of preparing the disk image:

cd ${M5_PATH}
# Download and mount the disk image 
wget http://cdimage.ubuntu.com/ubuntu-base/releases/12.04/release/ubuntu-base-12.04.4-core-amd64.tar.gz
sudo util/gem5img.py init disks/ubuntu-12.04.img 4096
mkdir mnt
sudo util/gem5img.py mount disks/ubuntu-12.04.img mnt
sudo tar xzvf ubuntu-base-12.04.4-core-amd64.tar.gz -C mnt
sudo cp /etc/resolv.conf mnt/etc/

# Nano is used to paste the contents in http://www.lowepower.com/jason/creating-disk-images-for-gem5.html
sudo nano mnt/etc/init/tty-gem5.conf 
sudo nano mnt/etc/hosts
sudo nano mnt/etc/fstab

# Copy m5 Binary
cd util/m5
make clean
make all -f Makefile.x86
sudo cp m5 ${M5_PATH}/mnt/sbin/

cd ${M5_PATH}
sudo umount mnt
sudo losetup -d /dev/loop0

The steps for kernel compilation:

I downloaded v3.2.1 then copied the config file of v2.6.28.4 as .config file of v3.2.1. After hitting make vmlinux, pressed enter for each question to get the default value.

cd ~
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
git checkout v3.2.1
wget http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2
tar jxvf config-x86.tar.bz2
cp configs/linux-2.6.28.4 .config
make clean
make vmlinux -j 4 
# Here compiler asks a lot of configurations, I just hit enter each time to pass the default values.
cp vmlinux ${M5_PATH}/binaries/vmlinux-amd64-v3.2.1

Finally, the command comes like this:

build/X86/gem5.opt -d AMD64 configs/example/fs.py --disk-image ${M5_PATH}/disks/ubuntu-12.04.img --kernel ${M5_PATH}/binaries/vmlinux-amd64-3.2.1

Any comment about the error messages or the reason/solution of freezing etc. would be very helpful. Thanks in advance!

解决方案

The best solution to boot FS mode is the following, but IMHO Ubuntu is not a good option, because systemd slows down the boot phase a lot:

Compile the linux kernel using this config file. The kernel 4.8.13 should work (Credits go to Jason Lowe Power, one of the reviewers of gem5).

Now what you want is the image of the system. The best option is this image based on gentoo.

这篇关于启动 gem5 X86 Ubuntu 全系统模拟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆