linux下如何搭建QEMU虚拟MINI2440 的配置与搭建

本文介绍了如何在Linux环境下搭建QEMU虚拟MINI2440,包括通过直接下载或使用Git克隆源码的方式获取qemu和u-boot,以及解决编译过程中遇到的SDL.h缺失、图形输出错误和链接错误的问题。

Step1,获取qemu for mini2440以及mini2440 u-boot的源码

主要有两种方法:

 

(1)有直接下载,解压安装

下载网址有

https://code.google.com/p/ (Google国内被封,不可用)

http://repo.or.cz/w/qemu/mini2440.git(经测试可用)

 

(2)通过Git clone 直接联网下载

gitclone git://repo.or.cz/qemu/mini2440.git  qemu                       下载虚拟机工具

gitclone git://repo.or.cz/u-boot-openmoko/mini2440.git uboot      下载uboot

这里是参考网上大多数人的写法,此外,这两句的最后如果不加qemu 和uboot也可以下载的,实在不知道这两个后缀有什么用,但是为了安全起见,还是加上为好。

 

./configure--target-list=arm-softmmu
make

Configure的时候出现错误:

can'topen include file : SDL.h和

ERROR:QEMU requires SDL or Cocoa for graphical output
To build QEMU without graphical output configure with --disable-gfx-check
Note that this will disable all output from the virtual graphics card
except through VNC or curses

这里网上百度了一下,

解决办法:

yuminstall SDL-devel SDL-static

yuminstall install zlib1g-dev

或者直接去SDL官网下载SDL1

zlib下载zlib

然后make

又出现错误:

vl.o:In function `dynticks_start_timer':

/root/qemu/vl.c:1549:undefined reference to `timer_create'

vl.o:In function `dynticks_rearm_timer':

/root/qemu/vl.c:1584:undefined reference to `timer_gettime'

/root/qemu/vl.c:1597:undefined reference to `timer_settime'

vl.o:In function `dynticks_stop_timer':

/root/qemu/vl.c:1567:undefined reference to `timer_delete'

collect2:error: ld returned 1 exit status

Makefile:722:recipe for target 'qemu-system-arm' failed

make[1]:*** [qemu-system-arm] Error 1

Makefile:58:recipe for target 'subdir-arm-softmmu' failed

make:*** [subdir-arm-softmmu] Error 2

网上解释说,此处是由于缺少相应的第三方库函数librt.a,但是解决方法真的是各种各样,又说link时加一个-lrt,也有说把makefile 里

# Dowe need librt 这部分修改掉的,试来试去还是在一篇英文网站找到的答案,具体解决方法:

在makefile和Makefile.target里LIBS+=-lz 的后面 直接添加-lrt –lm
即LIBS+=-lz -lrt –lm
 
参考网址http://stackoverflow.com/questions/18286738/undefined-reference-to-symbol-timer-settimeglibc-2-3-3
 
然后再执行make或make –j4 (据说这个执行比较快)

顺利编译通过

安装:makeinstall

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值