背景

上篇博客写了如何在gem5的full system模式运行alpha的指令编译的程序,这篇博客讲述如何在gem5的full system模式运行x86指令集编译的程序,这两种方式非常类似。

首先需要安装gem5-stable,可以参考我前面的一篇博客:

http://blog.csdn.net/wyj7260/article/details/8267345

这篇文章介绍full system  in  x86。

安装过程:

下载full system需要的两个包:

首先在安装好gem5-stable之后,再到官网下载full system需要的包:

Full System Files : http://www.m5sim.org/dist/current/x86/x86-system.tar.bz2

Config files : http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2

安装:记我的gem5-stable安装目录为$GEM

a)      ~/gem5-stable$  mkdir x86Dist

b)      将包x86-system.tar.bz2和config-x86.tar.bz2复制到x86Dist目录下

b) ~/gem5-stable$ cd x86Dist/

c) ~/gem5-stable/x86Dist$  tar -xvf x86-system.tar.bz2

把exceptKeyError:

path = [ '/dist/m5/system', '/n/poolfs/z/dist/m5/system

修改成

except KeyError:

path = [ '/dist/m5/system', ' /home/wyj2/gem5-stable/x86Dist' ]

运行(运行过程中遇到的error以及解决方法)

1、  首先编译gem5.opt

~/gem5-stable $ scons ./build/x86/gem5.opt

2、运行模拟的linux系统

~/gem5-stable$ ./build/X86/gem5.opt ./configs/example/fs.py

报错如下:

gem5 Simulator System. http://gem5.org

gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Jul 12 2013 21:30:39

gem5 started Jul 12 2013 21:33:06

gem5 executing on arch-node3

command line: ./build/X86/gem5.opt ./configs/example/fs.py

warning: add_child('terminal'): child 'terminal' already has parent

Global frequency set at 1000000000000 ticks per second

info: No kernel set for full system simulation. Assuming you know whatyou're doing if not SPARC ISA

0: rtc: Real-time clock setto Sun Jan  1 00:00:00 2012

panic: Error opening /home/wyj/gem5-stable/x86Dist/disks/x86root.img

@ cycle 0

[open:build/X86/dev/disk_image.cc, line 79]

Memory Usage: 225092 KBytes

Program aborted at cycle 0

Aborted (core dumped)

解决方法:

提示不能打开x86root.img,于是我查找x86root.img

命令:~/gem5-stable$ grep -r"x86root.img" ./

得到如下:

./configs/common/Benchmarks.py:            return env.get('LINUX_IMAGE',disk('x86root.img'))

如实修改Benchmarks.py, 把return env.get('LINUX_IMAGE',disk('x86root.img'))改成

return env.get('LINUX_IMAGE', disk('linux-x86.img'))

然后执行:

~/gem5-stable$ ./build/X86/gem5.opt ./configs/example/fs.py

gem5 Simulator System. http://gem5.org

gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Jul  2 201310:06:26

gem5 started Jul 13 2013 18:13:18

gem5 executing on jsi-desktop

command line: ./build/X86/gem5.opt ./configs/example/fs.py

warn: add_child('terminal'): child 'terminal' already has parent

Global frequency set at 1000000000000 ticks per second

info: No kernel set for full system simulation. Assuming you know whatyou're doing

0: rtc: Real-time clock setto Sun Jan  1 00:00:00 2012

panic: Error opening/home/wyj2/gem5-stable/x86Dist/disks/linux-bigswap2.img

@ cycle 0

[open:build/X86/dev/disk_image.cc, line 79]

Memory Usage: 177860 KBytes

Program aborted at cycle 0

Aborted

缺少linux-bigswap2.img文件,秩序要将alpha的full system下载的包Full System Files解压后的linux-bigswap2.img拷贝到目录/home/wyj2/gem5-stable/x86Dist/disks/就行。

(full system Files下载地址http://www.m5sim.org/dist/current/m5_system_2.0b3.tar.bz2解压也可得)

运行

~/gem5-stable$ ./build/X86/gem5.opt ./configs/example/fs.py

仍然报错

gem5 Simulator System.  http://gem5.org

gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Jul  2 201310:06:26

gem5 started Jul 13 2013 18:18:48

gem5 executing on jsi-desktop

command line: ./build/X86/gem5.opt ./configs/example/fs.py

warn: add_child('terminal'): child 'terminal' already has parent

Global frequency set at 1000000000000 ticks per second

info: No kernel set for full system simulation. Assuming you know whatyou're doing

0: rtc: Real-time clock setto Sun Jan  1 00:00:00 2012

Listening for com_1 connection on port 3456

warn: Reading current count from inactive timer.

0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000

fatal: No kernel to load.@ cycle 0

[initState:build/X86/arch/x86/system.cc, line 118]

Memory Usage: 177868 KBytes

这是因为运行时需要制定kernel:

运行命令为:

./build/X86/gem5.opt ./configs/example/fs.py --kernel=x86_64-vmlinux-2.6.22.9.smp

注意:此处不用制定.smp文件的路径,只用文件名就行

剩下的mount文件到模拟的系统同上一篇关于alpha的full system

参考链接:

http://www.m5sim.org/Running_M5_in_Full-System_Mode

http://novel.ict.ac.cn/qguo/pdf/gem5.pdf

http://gem5.org/dist/tutorials/hipeac2012/gem5_hipeac.pdf

以及参考师兄的ppt

在gem5的full system下运行 x86编译的测试程序 running gem5 on ubuntu in full system mode in x86的更多相关文章

  1. 在gem5的full system下运行 alpha编译的测试程序 running gem5 on ubuntu in full system mode in alpha

    背景 先需要在full system下运行gem5,通过网上查找资料以及向别人请教,终于成功运行,网上大多是关于alpha指令集的,且都是英文的,为了方便大家学习,现在总结一下,希望对大家有所帮助. ...

  2. Gem5全系统模式下运行SPLASH-2 Benchmarks使用alpha ISA

    Steps to run the SPLASH-2 Benchmarks on M5 in full system mode using the alpha ISA. This Guide is ai ...

  3. ASP.NET CORE下运行CMD命令

    ASP.NET CORE下运行CMD命令,用以前的ASP.NET 的命令System.Diagnostics.Process.Start("notepad");这样是可以运行出记事 ...

  4. JAVA手记 JAVA入门(安装+Dos下运行)

    JAVA入门特供= =,今天设置环境变量后用dos运行的时候发现出现“找不到或无法加载主类”,索性查了些资料重新看了看JAVA入门的部分. 声明:我的笔记本暂时用的是Win10系统,Windows其他 ...

  5. Windows 下使用 GNUstep 编译并运行 Objective-C 程序

    今晚上开始看<Objective-C 程序设计(第4版)>这本书(OSChina 正在做此书的书评活动,详情请看这里),到现在为止看到第 7 章,于是想动手试试写两简单的程序编译跑跑看. ...

  6. JAVA设置环境变量和在DOS下运行java程序

    在学校实训的这几天,老师带着我们开始深入的复习java.这是第一天的内容哦 对于“JAVA设置环境变量和在DOS下运行java程序”,许多初学者是陌生的,但了解这个却对后期的学习很重要. http:/ ...

  7. Unity怎样在Editor下运行协程(coroutine)

    在处理Unity5新的AssetBundle的时候,我有一个需求,须要在Editor下(比方一个menuitem的处理函数中,游戏没有执行.也没有MonoBehaviour)载入AssetBundle ...

  8. Demo+在Linux下运行(CentOS7+dotnetcore sdk)

    来份ASP.NET Core尝尝 0x01.前言 学习ASP.NET Core也有一段时间了,虽说很多内容知识点还是处于一知半解的状态,但是基本的,还是 略懂一二.如果有错误,还望见谅. 本文还是和之 ...

  9. OpenCV探索之路(二十一)如何生成能在无opencv环境下运行的exe

    我们经常遇到这样的需求:我们在VS写好的程序,需要在一个没有装opencv甚至没有装vs的电脑下运行,跑出效果.比如,你在你的电脑用opencv+vs2015写出一个程序,然后老师叫你把程序发给他,他 ...

随机推荐

  1. Entity Framework 处理并发

    Entity Framework 处理并发 在以前的两个教程你对关联数据进行了操作.本教程展示如何处理并发性.您将创建工作与各Department实体的 web 页和页,编辑和删除Department ...

  2. 序列化悍将Protobuf-Net

    序列化悍将Protobuf-Net,入门动手实录 最近在研究web api 2,看了一篇文章,讲解如何提升性能的, 在序列化速度的跑分中,Protobuf一骑绝尘,序列化速度快,性能强,体积小,所以打 ...

  3. ios背景更新和下载

    ios背景更新和下载 by 吴雪莹 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NS ...

  4. HTTP2协议之HPACK--之头部压缩规范介绍

    接下来打算把HTTP2协议的头部压缩算法给翻译下,敬请等候. HPACK - Header Compression for HTTP/2 HPACK:HTTP/2头部压缩 概要说明 这个规范定义了HP ...

  5. leetcode第六题--ZigZag Conversion

    Problem: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of r ...

  6. JSON数据转换方法 parse()和stringify()

    将对象转换成JSON格式的文本数据 var str = JSON.stringify(data); 将对象转换成JSON对象的方法 var data = JSON.parse(str);

  7. Unity3D开发必备神器(Visual Studio Tools for Unity)

    Unity3D开发必备神器(Visual Studio Tools for Unity) 开发Unity3D程序你用的什么IDE呢? 1.MonoDevelop 2.VS 可能你的回答是这样的,我用的 ...

  8. jquery背景动画插件使用

    在网页制作动画特效的时候,有时候想通过背景插入图片,然后通过控制背景显示的位置来实现一些动画效果,这样就不用使用绝对定位控制left和top来实现动画效果!但是jquery本身的动画函数是不支持背景动 ...

  9. vs 中一些快捷键

    本文用于记录一些vs中快捷键,以便提高编程效率. 首先小坦克的博客介绍的十几个快捷键挺不错的,还有动画演示.可以跳过去看看. 自己也记录一些自己想用的吧: 1. ctr + W + E 出现error ...

  10. leetcode[94] Unique Binary Search Trees

    给定n,那么从1,2,3...n总共可以构成多少种二叉查找数呢.例如给定3 Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1 \ ...