在gem5的full system下运行 x86编译的测试程序 running gem5 on ubuntu in full system mode in x86
来源:互联网 发布:淘宝上买steam游戏后果 编辑:程序博客网 时间:2024/05/22 06:26
背景
上篇博客写了如何在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
- 在gem5的full system下运行 alpha编译的测试程序 running gem5 on ubuntu in full system mode in alpha
- gem5的Full System下运行X86编译的测试程序
- splash-2在gem5 full system下的运行命令
- Run SPLAHS2 under SE mode on gem5在gem5的SE模式下,运行SPLASH2程序
- gem5 full system全模式下运行linux系统
- Gem5的编译及运行测试程序
- Gem5的编译及运行测试程序
- gem5的安装编译及测试运行
- gem5下用se模式运行自己的测试程序
- ubuntu下出现The system is running in low-graphics mode的问题
- 在VirtualBox下安装Ubuntu虚拟机出现The system is running in low-graphics mode解决
- 【Linux】Ubuntu出现“the system is running in low-graphics mode”问题的解决办法
- 如何修复ubuntu启动时显示的“The System Running In Low Graphics Mode’ Error”问题
- Ubuntu更新出现"The system is running in low-graphics mode"错误提示的解决办法
- ubuntu:the system is running in low-graphics mode的解决办法
- GEM5 X86全系统模拟
- gem5 运行测试程序时如何设置cache的大小
- Thinking in C++: static const (类中的编译时常量)
- c++ string 字符无法准确去除两边空格!
- hdu 1011 树形dp 背包
- 【deep learning学习笔记】注释yusugomori的RBM代码 --- 头文件
- 狼奔生成器之初体验
- 在gem5的full system下运行 x86编译的测试程序 running gem5 on ubuntu in full system mode in x86
- 两栈共享空间
- nyist-244
- 完全免费和开源的权限管理系统
- 反射相关的异常
- 正则表达式有用的相关网页
- Java基础之面向对象(四)--多态、Object类
- 你没用过的.net4.0
- [Android] 判断手机上是否安装了某个程序