引导 gem5 X86 Ubuntu 完整系统模拟

2024-02-29

我需要在 gem5 上运行相对较新版本的 x86 磁盘映像。从...开始本指南 http://www.lowepower.com/jason/creating-disk-images-for-gem5.html我使用了带有 Kernel v3.2.1 的 Ubuntu 12.04 磁盘映像,因为该组合已为其他人使用。

过了一段时间,模拟器就会挂起,请分享有关原因和可能的解决方案的任何想法。谢谢你!

您可能会在下面的 m5term/telnet 上找到输出。之后就是准备磁盘镜像和内核以供参考的过程。

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.

以下是准备磁盘映像的完整过程:

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

内核编译步骤:

我下载了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.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

最后,命令是这样的:

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 模式的最佳解决方案如下,但恕我直言,Ubuntu 不是一个好的选择,因为 systemd 会大大减慢启动阶段:

使用编译linux内核this http://www.lowepower.com/jason/files/config配置文件。内核 4.8.13 应该可以工作(来源:杰森·洛·鲍尔 http://www.lowepower.com/jason/setting-up-gem5-full-system.html,gem5的审稿人之一)。

现在你想要的是系统的镜像。最好的选择是这个图片 http://www.cs.utexas.edu/~parsec_m5/x86root-parsec.img.bz2基于gentoo。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

引导 gem5 X86 Ubuntu 完整系统模拟 的相关文章

随机推荐