如何使用gem5 fs.py在仿真中附加多个磁盘映像? [英] How to attach multiple disk images in a simulation with gem5 fs.py?

查看:110
本文介绍了如何使用gem5 fs.py在仿真中附加多个磁盘映像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://www.mail-archive中. com/gem5-users@gem5.org/msg15233.html Jason提到了附加两个磁盘映像以进行还原的技术 检查点并运行其他基准测试.

At https://www.mail-archive.com/gem5-users@gem5.org/msg15233.html Jason mentioned the technique of attaching two disk images to restore a checkpoint and run a different benchmark.

使用fs.py时是否可以指定多个磁盘映像?从 我认为目前尚不支持该源代码,而只是 在决定是否修补之前,请仔细检查.

Is it possible to specify multiple disk images when using fs.py? From the source code I don't think it is currently supported, but just double checking before I decided to patch it or not.

似乎多个--disk-image=选项会相互覆盖.

It seems that multiple --disk-image= options just overwrite one another.

fs_bigLITTLE.py似乎支持它.

gem5 60600f09c25255b3c8f72da7fb49100e2682093a

gem5 60600f09c25255b3c8f72da7fb49100e2682093a

https://www.mail-archive.com/gem5-users@gem5.org/msg15675.html

推荐答案

我在这里回答: https://www.mail-archive.com/gem5- users@gem5.org/msg15714.html

基本上, http://www.gem5.org/AsimBench 显示了如何用fs.py来做.您可以使用此修补程序尝试此操作:

Basically, http://www.gem5.org/AsimBench shows an example of how to do it with fs.py. You can try this with this patch:

diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index e2b6616..e01cc13 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@ -266,15 +266,17 @@ def makeArmSystem(mem_mode, machine_type, num_cpus=1, mdesc=None,

    self.cf0 = CowIdeDisk(driveID='master')
    self.cf0.childImage(mdesc.disk())
+   self.disk2 = CowIdeDisk(driveID='master')
+   self.disk2.childImage(disk('workloads.img'))
    # Old platforms have a built-in IDE or CF controller. Default to
    # the IDE controller if both exist. New platforms expect the
    # storage controller to be added from the config script.
    if hasattr(self.realview, "ide"):
-       self.realview.ide.disks = [self.cf0]
+       self.realview.ide.disks = [self.cf0, self.disk2]
    elif hasattr(self.realview, "cf_ctrl"):
-       self.realview.cf_ctrl.disks = [self.cf0]
+       self.realview.cf_ctrl.disks = [self.cf0, self.disk2]
    else:
-       self.pci_ide = IdeController(disks=[self.cf0])
+       self.pci_ide = IdeController(disks=[self.cf0, self.disk2])
        pci_devices.append(self.pci_ide)

    self.mem_ranges = []

请注意,在此示例中,您必须在M5_PATH(gem5的环境变量,指向包含系统文件的目录)中提供一个名为工作负载.img的映像.当然,您可以将其更改为您想要的任何值,也可以通过选项将其传递.

Note that in this example, you have to supply an image called workloads.img in your M5_PATH (an environment variable for gem5 pointing the a directorycontaining system files). Of course you can change this to any value youwant or pass it via an option.

还请注意,启动时,必须先使用常规工具安装第二张磁盘来安装第二张磁盘. 这可以通过例如

Also note that when booted, you have to mount the second disk first by using the normal tools to mount a disk. This can be done by e.g.

sudo mount /dev/sdb1 /mnt

第二个磁盘映像中的所有文件将出现在/mnt下

All files in the second disk image will then be present under /mnt

这篇关于如何使用gem5 fs.py在仿真中附加多个磁盘映像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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