CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 14376|回复: 4

安装使用QEMU仿真器

[复制链接]
发表于 2013-10-20 11:43:59 | 显示全部楼层 |阅读模式
本帖最后由 寒寒 于 2013-10-22 15:17 编辑

在ubuntu系统下安装QEMU仿真器进行ARM仿真,当然也可以是x86什么的。
1)联编时需要一些额外的开发库,可以通过一下命令来获取
  1. sudo apt-get install libsdl-gfx1.2-dev zlib1g-dev
复制代码
注意这里是1不是l。
2)然后从QEMU网上获取QEMU源码进行编译。
  1. cd ~
  2. git clone git://git.qemu-project.org/qemu.git
复制代码
系统可能会提示你没有git,那用命令     sudo apt-get install git。反正系统提示缺少什么,就试一下 apt-get install
3)下载好了QEMU之后进入qemu目录。
ls
cd qemu
./configure
运行configure之后会出现错误提示,照着提示做就可以了。

ERROR: pixman not present. Your options:
(1) Preferred: Install the pixman devel package (any recent
distro should have packages as Xorg needs pixman too).
(2) Fetch the pixman submodule, using:
git submodule update –init pixman

执行最后一句 git submodule update --init pixman 。完了之后继续执行 ./configure  这时候可能还会出现错误提示 -_- 那就再git一下,再./configure。看到很多yes,no之后就make一下。make可能也会报错。

(cd /home/hujiawei/ucore/qemu/qemu/pixman; autoreconf -v –install)
/bin/sh: 1: autoreconf: not found
make: *** [/home/hujiawei/ucore/qemu/qemu/pixman/configure] Error 127

看起来是没有autoconf,那就sudo apt-get install autoconf automake libtool 好了进入pixman
cd pixman
autoreconf -v --install
cd ../                         ;返回qemu文件下
make                        ;执行一下make

应该可以了,make之后可以看到一堆英语飘过,估计至少要半个钟吧,编译完成就执行一下 make install。



4)获取镜像文件。
cd ~
tar xzf arm-test-0.2.tar.gz
5)使用虚拟机(无图形终端)
cd arm-test
../qemu/arm-softmmu/qemu-system-arm -kernel zImage.integrator -initrd arm_root.img -nographic -append "console=ttyAMA0"

这里解释一下几个参数

参数
用途
-kernel <kernel image>
表示使用哪个内核,指定文件是一个内核镜像文件。没指定目录时,认为在当前目录
-initrd <initial ram disk image>
加载初始RAM磁盘,仿真机使用的唯一文件系统
-nographic
若未指定参数,配置一个VGA设备,启动没有图形界面设备支持
-append <parameters>
向内核命令行添加参数,console=ttyAMA0 表示使用内核的/dev/ttyAMA0设备作为控制台。



出现一堆英文之后有这么一句话
Log in as root with no password.
qemu login:
那就用root用户登陆吧

# cat /proc/cpuinfo
Processor        : ARM926EJ-Sid(wb) rev 5 (v5l)
BogoMIPS        : 415.33
Features        : swp half thumb fastmult edsp java
CPU implementer        : 0x41
CPU architecture: 5TEJ
CPU variant        : 0x0
CPU part        : 0x926
CPU revision        : 5
Cache type        : write-through
Cache clean        : not required
Cache lockdown        : not supported
Cache format        : Harvard
I size                : 4096
I assoc                : 4
I line length        : 32
I sets                : 32
D size                : 65536
D assoc                : 4
D line length        : 32
D sets                : 512

Hardware        : ARM-IntegratorCP
Revision        : 0000
Serial                : 0000000000000000

以上是执行这句 cat /proc/cpuinfo 后出现的内容。


回复

使用道具 举报

 楼主| 发表于 2013-10-20 16:29:55 | 显示全部楼层
没有人顶帖,难道没人对QEMU感兴趣?
回复 支持 反对

使用道具 举报

发表于 2013-10-23 20:42:24 | 显示全部楼层
试过了,性能太.................
回复 支持 反对

使用道具 举报

发表于 2014-10-31 22:23:56 | 显示全部楼层
呵呵,楼主,我来顶了。
用CPU虚拟化就快了,Cortex A15以后的U就支持了。
CubieTruck应该好了。

就不知道CubieTruck镜像的内核是不是支持KVM了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-3-28 19:19 , Processed in 0.025953 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部