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

643

被折叠的 条评论
为什么被折叠?



