qemujava service wrapperr-cross 是啥

1.5.2 QEMU实验平台
QEMU模拟了vexpress Cortex-A9 SMP四核处理器开发板,板上集成了Flash、SD、I2C、LCD等。ARM公司的Versatile Express系列开发平台提供了超快的环境,用于为下一代片上设计方案建立原型,比如 Cortex-A9 Quad Core。
在http://www.arm.com/zh/products/tools/development-boards/versatile-express/index.php上可以发现更多关于Versatile Express系列开发平台的细节。
本书配套映像中已经安装好了工具链,包含arm-linux-gnueabihf-gcc和arm-linux-gnueabi-gcc两个版本。
内核在/home/baohua/develop/linux目录中,在该目录下面,包含内核编译脚本:
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabi-
make LDDD3_vexpress_defconf?ig
make zImage -j8
make modules -j8
cp arch/arm/boot/zImage extra/
cp arch/arm/boot/dts/*ca9.dtb
cp .conf?ig extra/
由此可见,我们用的默认内核配置文件是LDDD3_vexpress_defconfig。上述脚本也会自动将编译好的zImage和dtbs复制到extra目录中。
extra目录下的vexpress.img是一张虚拟的SD卡,将作为根文件的存放介质。它能以loop的形式被挂载(mount),譬如在/home/baohua/develop/linux目录下运行。
sudo mount -o loop,offset=$(()) extra/vexpress.img extra/img
可以把vexpress.img的根文件系统分区挂载到extra/img,这样我们可以在目标板的根文件系统中放置我们喜欢的内容。
/home/baohua/develop/linux目录下面有个编译模块的脚本module.sh,它会自动编译内核模块并安装到vexpress.img中,其内容如下:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules
sudo mount -o loop,offset=$(()) extra/vexpress.img extra/img
sudo make ARCH=arm modules_install INSTALL_MOD_PATH=extra/img
sudo umount extra/img
运行extra下面的run-nolcd.sh可以启动一个不含LCD的ARM 。run-nolcd.sh的内容为qemu-system-arm -nographic -sd vexpress.img -M vexpress-a9 -m 512M -kernel zImage -dtb vexpress-v2p-ca9.dtb &-smp 4 -append &init=/linuxrc root=/dev/mmcblk0p1 rw rootwait earlyprintk console=ttyAMA0& 2&/dev/null,运行结果为:
baohua@baohua-VirtualBox:~/develop/linux/extra$ ./run-nolcd.sh
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpuset
Linux version 3.16.0+ (baohua@baohua-VirtualBox) (gcc version 4.7.3 (Ubuntu/
Linaro 4.7.3-12ubuntu1) ) #3 SMP Mon Dec 1 16:53:04 CST 2014
CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: V2P-CA9
bootconsole [earlycon0] enabled
Memory policy: Data cache writealloc
PERCPU: Embedded 7 pages/cpu @9fbcd000 s d1
Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 130048
Kernel command line: init=/linuxrc root=/dev/mmcblk0p1 rw rootwait earlyprintk
console=ttyAMA0
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 4288K available (4583K kernel code, 188K rwdata, 1292K rodata,
247K init, 149K bss, 11200K reserved)
Virtual kernel memory layout:
: 0xffff0000 - 0xffff1000
: 0xffc00000 - 0xffe00000
vmalloc : 0xa0800000 - 0xff000000
: 0x - 0xa0000000
modules : 0x7f000000 - 0x
.text : 0x - 0x805c502c
.init : 0x805c6000 - 0x80603c40
.data : 0x - 0x
.bss : 0x - 0x
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
NR_IRQS:16 nr_irqs:16 16
L2C: platform modif?ies aux control register: 0x -& 0x
L2C: device tree omits to specify unif?ied cache
L2C: DT/platform modif?ies aux control register: 0x -& 0x
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 dynamic clock gating disabled, standby mode disabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x, AUX_CTRL 0x
smp_twd: clock not found -2
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every ns
Console: colour dummy device 80x30
运行extra下面的run-lcd.sh可以启动一个含LCD的ARM Linux,运行结果如图1.11所示。
除了QEMU模拟的ARM电路板以外,本书配套的Ubuntu中还包含一些直接可以在Ubuntu上运行的案例,譬如/home/baohua/develop/training/kernel中就包含了globalfifo、globalmem等,这些目录的源代码都包含了Makefile,在其中直接make,生成的.ko可以直接在Ubuntu上运行。
您对本文章有什么意见或着疑问吗?请到您的关注和建议是我们前行的参考和动力&&
您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。后使用快捷导航没有帐号?
请完成以下验证码
查看: 4558|回复: 3
QEMU模拟FriendlyArm的Mini2440开发板(转)
在线时间3680 小时
威望4056分
芯币26530枚
TA的帖子TA的资源
原创作品,允许转载,转载时请务必以超链接形式标明文章
出处 、作者信息和本声明。否则将追究法律责任。
本篇博文是基于参加网上法国OpenWide公司
举办的嵌入式Linux竞赛 (自由,免费报名,可以个人也可以组队)的经历(今年题目是在Mini2440上实现一个可触摸数字/模拟示波器)。第一阶段是在QEMU下模拟Mini2440开发板并运行编写的示波器图形软件(我是用Qt实现的)。第一阶段已经通过,获得了Mini2440开发板,目前正在参加第二阶段(截止11月底),奖品更丰厚哦。第一阶段晋级第二阶段的名单在这个链接可以看到
,也有简易作品截图, 当然第一阶段的作品都还没太多完善,比较粗糙。本人水品有限,难免有遗漏或错误之处,本文用到的命令等我都检查过了,不过可能还是会有错误,欢迎指正与提出宝贵意见!
这篇博文中主要从以下几点进行叙述:
1、Mini2440开发板和QEMU模拟器简介
2、编译适配Mini2440的QEMU
3、Buildroot (2012.05)的使用
4、在QEMU中运行编译好的系统
& && &4.1、生成NAND镜像并初始化
& && &4.2、基于NFS启动
& && &4.3、基于NAND镜像启动
& && &4.4、强大的工具 -- Flashimg
5、附件 -- 竞赛第一阶段提交作品压缩包,内含 build.sh 完成全部编译启动工作
一、 Mini2440开发板和QEMU模拟器简介
德国FriendlyARM(国内译为”友善之臂“)公司推出的Mini2440开发板,一直以来为广大嵌入式爱好者所熟知,国内天嵌公司的TQ2440开发板就与其很类似(不过Mini2440可以移植Android系统,这点TQ2440似乎还没太多实做成功的文章,TQ6410倒是可以移植Android系统)。下面是Mini2440的简介:
目前虚拟机软件领域可谓“高手林立”,以下链接基本列出了所有流行虚拟机软件:
在如此众多的产品中VMWare自然不用说(不过最近推出的Windows Server 2012貌似有点撼动VMWare在虚拟机领域的霸主地位)。微软的老牌产品VirtualPC也相当不错,还有Bochs之类的。不过说到开源的虚拟机软件,必定要提一下QEMU,不错的速度,可以模拟至接近真实电脑,开放源代码,可以模拟众多的操作系统和平台。就连最近几年很火的Android生态系统也用到了QEMU虚拟机。下面是QEMU的简介:
本文所述的Mini2440是由QEMU模拟,基于Linux操作系统内核。
二、 编译适配Mini2440的QEMU
本文基于的开发环境是Ubuntu 10.04, 需要安装 git, 如果还没有git,请安装:
& & & & & & & & & & & & & & & & & & & & $ sudo apt-get install git git-core
首先下载适配Mini2440的QEMU虚拟机,然后编译,安装QEMU:
& & & & & & & & & & & & & & & & & & & & $ cd ~
& & & & & & & & & & & & & & & & & & & & $ mkdir local
& & & & & & & & & & & & & & & & & & & & $ git clone git://repo.or.cz/qemu/mini2440.git qemu
& & & & & & & & & & & & & & & & & & & & $ cd qemu
& & & & & & & & & & & & & & & & & & & & $ ./configure --target-list=arm-softmmu --prefix=$HOME/local
& & & & & & & & & & & & & & & & & & & & $ make
& & & & & & & & & & & & & & & & & & & & $ make install
此时QEMU可执行程序已经安装在 ~/local/bin 目录下了,为了方便使用,将其添加到环境变量里:
& & & & & & & & & & & & & & & & & & & & $ export PATH=$HOME/local/bin:$PATH
验证一下正确安装与否:
$ qemu-system-arm --version
如果输出了QEMU的版本等信息,则安装成功。
三、 Buildroot (2012.05)的使用
一般说来,我们需要三样东西来正常启动一个嵌入式操作系统: 引导程序(bootloader),内核镜像和根文件系统镜像。那我们是不是接下来需要下载一个bootloader(比如u-boot,supervivi之类),编译之;下载任意版本的linux内核,编译之(当然要适配mini2440);一点一点生成自己的根文件系统,再制作成jffs2, yaffs2之类的格式呢?哦,对了,还有编译这三样东西的交叉编译工具链 Cross-compiler toolchain 要制作。
以前我也这样做过,很费时间(交叉编译工具链和根文件系统都是一点一点制作。。。)。虽然我们在制作根文件系统时是可以偷懒使用Busybox这样的“瑞士军刀”,但是还不够方便,有没有能一次过帮我们把交叉编译工具链和三样东西都生成出来,将懒惰进行到底的“青龙偃月刀”呢?答案是肯定的,就是 Buildroot,一款超好用的开源软件。
Ok,首先我们下载Buildroot,竞赛期间我用的版本是2012年5月的 (2012.05),当然大家可以下载更新的版本,Buildroot项目每三个月就有一个新版本。首先我们安装wget这个小工具,便于下载Buildroot:
$ sudo apt-get install wget
接着下载Buildroot:
& & & & & & & & & & & & & & & & & & & & $ cd ~
& & & & & & & & & & & & & & & & & & & & $ wget http://buildroot.org/downloads/buildroot-2012.05.tar.gz
& & & & & & & & & & & & & & & & & & & & $ tar zxvf buildroot-2012.05.tar.gz
在让Buildroot为我们生成三个镜像前,需要对其进行一些配置。Mini2440开发板的基本所需配置已经集成在Buildroot里了(众多defconfig文件中的一个),省了不少功夫。在此基础上,我们只需再进行少许配置,就可以让Buildroot开工了。
我们选取mini2440_defconfig来生成我们的 .config 文件,再用 make menuconfig 进一步配置:
& & & & & & & & & & & & $ cd buildroot-2012.05
$ make mini2440_defconfig
$ make menuconfig
& & & & & & & & & & & &
一个方便的配置窗口会跟着出现,是基于Kconfig的配置机制:
以下列出比较重要的几个编译选项,需要改动的几项用红色表示:
- Toolchains : 在Toolchains目录里,须要选取Linux内核版本的适配的编译链版本。默认是设置为 3.3.x。后面的Kernel(内核版本)我使用的是3.3.7,所以没问题,这里不用改也可以。当然也可以使用诸如 3.0.x这样的版本,只要跟之后的Kernel版本适配就好了。
- Bootloaders : 默认是U-boot, 也可以选用其他版本的Bootloader。本文就用默认的U-boot。
- Kernel : 默认是 3.0.4,因为之前Toolchains目录选择的是 3.3.x版本,所以这里须要改选,比如 3.3.7版本。
- Package Selection for the target : Busybox已经包含在里面了,我们也可以选择更多的项目,比如 Qt, EFL, directfb之类的图形库。在 Graphic libraries and application子目录里选择。
- Filesystem images : 本文中使用的是 jffs2格式的根文件系统(也是Buildroot默认的),因为之后要制作NAND镜像,所以需要配置成一个每页512字节和16字节的ECC的NAND类型。在 Flash Type这项,改为 NAND flash with 512B Page and 16 KB erasesize 。
这些都配置好之后,就可以请出我们最喜欢的命令了 -- make :
此时你可以倒杯茶,或者可以烤一只鸡。。。总之干点别的,让Buildroot忙活去吧。如果中间出现错误,一般是没装必要的东西,照错误提示安装就好,然后接着 make。 视电脑速度和网速而定,我的情况是大概30分钟后 make 完成。
如果一切顺利, make 结束后,在 buildroot-2012.05目录的 output/images/ 子目录下可以找到生成的三个文件:
- u-boot.bin : bootloader的镜像
- uImage : u-boot格式的(用mkimage命令生成的)Linux内核镜像
- rootfs.jffs2 : jffs2格式的根文件系统镜像
至此,Buildroot完成了他艰巨的任务,可以让他一边休息去了。我们进入下面的系统制作和启动部分。
四、在QEMU中运行编译好的系统
& && &&&4.1、生成NAND镜像并初始化
在开始前,先说一下: 如果你想要比较快捷的话,可以直接去看 4.4、强大的工具 -- Flashimg, 不需自己一点一点制作NAND文件来启动或通过NFS来启动。Flashimg是一个不错的软件,可以使用 内核镜像,bootloader镜像和根文件系统镜像 快速生成NAND或NOR文件。 由同样参加竞赛的法国人 Fabrice Jouhaud (别名 Yargil, 已经工作多年的嵌入式高手 ,去年的冠军,极为牛,人也非常好,有问必答,我觉得他来参加竞赛就是来帮助我们这些新手的)开发,共享在git 上面,
NAND和NOR的区别,请参看:
如果在QEMU里生成NAND的话,会花不少时间。所以我们可以利用闲置的内存(RAM) --&&tmpfs
$ mkdir nand
$ sudo mount -t tmpfs none nand/
我们接下来将从零开始生成一个NAND镜像文件。一般NAND的大小我们可以设定成64MB (NOR镜像文件一般设为2MB)。我们来做一下简单的计算: 要生成一个64MB的NAND,每个块是512字节,还要加上16字节的ECC,所以每个块是528字节。 总共需要的块数是 : (64 * 1024 * 1024) / 528 = 127100
用 dd 命令来生成一个NAND镜像:
$ dd if=/dev/zero of=nand/nand.bin bs=528 count=127100
我们现在有了一个NAND镜像文件了,接下来要使用u-boot来初始化它。我们需要首先将 Buildroot替我们生成的 u-boot.bin 文件拷贝到nand.bin 相同的文件夹下:
$ cp ~/buildroot-2012.05/output/images/u-boot.bin ~/nand/
启动U-boot以便进行NAND的初始化:
$ qemu-system-arm -M mini2440 -serial stdio -mtdblock nand/nand.bin
U-boot启动了,并且会显示一些Warning信息:
NAND: Bad block table not found for chip 0
Bad block table not found for chip 0
*** Warning - bad CRC or NAND, using default environment
别担心,显示这些信息很正常,因为我们的NAND文件还没初始化呢。接下来初始化:
MINI2440 # nand scrub
MINI2440 # nand createbbt
MINI2440 # reset
至此,我们的NAND文件已经准备好了。现在可以将其从tmpfs拷贝到电脑硬盘,然后卸载掉 tmpfs。
$ cp nand/nand.bin .
$ sudo umount nand/
$ rmdir nand
& && &&&4.2、基于NFS启动
这里插进一段用NFS启动的实做。在Ubuntu里安装NFS,请参看:
& & & & & & & & & & & & & & & & & & & & http://www.linuxidc.com/Linux/47.htm
& & & & & & & & & & & & & & & & & & & & http://os.51cto.com/art/511.ht
在嵌入式开发阶段,通常我们会操作一个挂载在NFS上的系统,这样更加方便,快捷, 无需每次都烧写NAND或NOR文件。接下来我们用NFS启动系统:
之前在 ~/buildroot-2012.05/output/images/&&这个目录里,除了生成 rootfs.jffs2文件外,还生成了 rootfs.tar 文件,是根文件系统的压缩文件包。我们在 /srv 文件夹下新建一个 nfsroot文件夹以储存解压的根文件系统:
& & & & & & & & & & & & & & & & & & & & $ sudo mkdir /srv/nfsroot/
& & & & & & & & & & & & & & & & & & & & $ cd /srv/nfsroot/
& & & & & & & & & & & & & & & & & & & & $ sudo tar xvf ~/buildroot-2012.05/output/images/rootfs.tar
接着需要在 /etc/exportfs 文件里增加以下一行,使NFS能认识 /srv/nfsroot/ 这个目录:
& & & & & & & & & & & & & & & & & & & & /srv/nfsroot/ 192.168.42.0/24(rw,sync,no_root_squash,no_subtree_check)
使其生效:
& & & & & & & & & & & & & & & & & & & & $ sudo exportfs -r
然后,我们生成并配置一个 tap0 接口:
& & & & & & & & & & & & & & & & & & & & $ sudo tunctl -u $USER -t tap0
& & & & & & & & & & & & & & & & & & & & $ sudo ifconfig tap0 192.168.42.1
现在我们已经可以来启动QEMU了,不过在此之前,还要将 uImage 也拷贝到HOME目录( nand.bin 已经在HOME目录了):
$ cp ~/buildroot-2012.05/output/images/uImage .
Ok,我们启动QEMU+NFS:
$ qemu-system-arm -M mini2440 -serial stdio -mtdblock nand.bin -kernel uImage -net nic -net tap,ifname=tap0,script=no,downscript=no
MINI2440 # setenv bootargs root=/dev/nfs rw nfsroot=192.168.42.1:/srv/nfsroot/ ip=192.168.42.2
MINI2440 # bootm
输入Buildroot的密码,默认是root, 此时系统启动了,可以看到QEMU的窗口和可爱的Linux小企鹅。
& && &&&4.3、基于NAND镜像启动
因为以之前的4.1生成的nand.bin来继续生成最终版的nand.bin (还要往里面添加 u-boot.bin, uImage和rootfs.jffs2)过程太过繁琐且容易出错,在此我就不赘述了,可以参看网上的相关文章。我们直接进入4.4,用一个更强大的工具来生成最终版的 nand.bin 。更方便,且不容易出错。
& && &&&4.4、强大的工具 -- Flashimg
如前面4.1时提到的,flashimg是一个由网友 Fabrice Jouhaud 开发的软件,可以很快捷地生成NAND或NOR镜像文件。我们首先下载 flashimg:
$ git clone git://gitorious.org/flashimg/flashimg.git
$ cd flashimg
$ ./autogen.sh
$ ./configure
$ sudo make install
要生成NAND或NOR镜像文件,可以先把之前Buildroot替我们生成的三个文件 : u-boot.bin, uImage和rootfs.jffs2 拷贝到 flashimg文件夹下:
$ cp ~/buildroot-2012.05/output/images/rootfs.jffs2 ~/flashimg/rootfs.jffs2
$ cp ~/buildroot-2012.05/output/images/uImage ~/flashimg/uImage
$ cp ~/buildroot-2012.05/output/images/u-boot.bin ~/flashimg/u-boot.bin
生成NAND或NOR镜像文件:
$ ./flashimg -s 64M -t nand -f nand.bin -p uboot.part -w boot,u-boot.bin -w kernel,uImage -w root,rootfs.jffs2 -z 512
$ ./flashimg -s 2M -t nor -f nor.bin -p uboot.part -w boot,u-boot.bin -w kernel,uImage -w root,rootfs.jffs2
最后,启动系统,我们以NAND文件为例:
$ qemu-system-arm -M mini2440 -serial stdio -mtdblock nand.bin -usbdevice mouse
启动之后,还需要配置一下(其中 mini2440=3tb 是为了使屏幕分辨率成为320*240,横向显示。默认是 240*320,是竖着的)
MINI2440 # nboot kernel
MINI2440 # setenv bootargs root=/dev/mtdblock3 rootfstype=jffs2 console=ttySAC0,115200 mini2440=3tb
MINI2440 # saveenv
MINI2440 # bootm
输入Buildroot的密码,默认是& & root
我们再一次看到了亲切的小企鹅。
五、附件 -- 竞赛第一阶段提交作品压缩包,内含 build.sh 完成全部编译启动工作
我在附件里上传了压缩包,里面的 build.sh 文件,只要进入解压后的文件夹,运行
$ ./build.sh
就可以完成所有下载,编译,启动工作,不过在QEMU启动之后还要手动添加以下配置命令:
MINI2440 # nboot kernel&&
MINI2440 # setenv bootargs root=/dev/mtdblock3 rootfstype=jffs2 console=ttySAC0,115200 mini2440=3tb&&
MINI2440 # saveenv&&
MINI2440 # bootm
而且build.sh把我的第一阶段的作品(简易示波器,菜单栏下有各种操作。可以用鼠标操作,可以模拟4×4=16种波形混叠或独立显示,波形可以改变幅度和采样频率,简单的触发机制,可以保存成文件形式)也编译并集成到Linux系统里面了。启动Linux后,只要输入:
# cle2012 -qws
就可以运行示波器的简易程序了。当然这个程序是8月底完成的,还远远不够好。第二阶段要进行优化,增加更多功能,并在Mini2440开发板上能够触摸操作,接收实际的开发板产生的电信号或声音信号作为输入。 欢迎同样爱好嵌入式的朋友跟我联系,彼此学习,共同进步。
在线时间278 小时
威望1034分
TA的帖子TA的资源
纯净的硅(中级), 积分 1034, 距离下一级还需 166 积分
纯净的硅(中级), 积分 1034, 距离下一级还需 166 积分
厉害!Linux开发好复杂啊
在线时间1 小时
TA的帖子TA的资源
一粒金砂(初级), 积分 2, 距离下一级还需 3 积分
一粒金砂(初级), 积分 2, 距离下一级还需 3 积分
楼主,您好!请问运行“$ qemu-system-arm -M mini2440 -serial stdio -mtdblock nand/nand.bin ”后未出现“
“NAND: Bad block table not found for chip 0
Bad block table not found for chip 0
*** Warning - bad CRC or NAND, using default environment ”
而是“Supported machines are:
beagle& && && && && &Beagle board (OMAP3530)
beaglexm& && && && & Beagle board XM (OMAP3630)
collie& && && && && &Collie PDA (SA-1110)
nuri& && && && && &&&Samsung NURI board (Exynos4210)
smdkc210& && && && & Samsung SMDKC210 board (Exynos4210)
connex& && && && && &Gumstix Connex (PXA255)
verdex& && && && && &Gumstix Verdex (PXA270)
highbank& && && && & Calxeda Highbank (ECX-1000)
integratorcp& && && &ARM Integrator/CP (ARM926EJ-S) (default)
mainstone& && && && &Mainstone II (PXA27x)
musicpal& && && && & Marvell 88w8618 / MusicPal (ARM926EJ-S)
n800& && && && && &&&Nokia N800 tablet aka. RX-34 (OMAP2420)
n810& && && && && &&&Nokia N810 tablet aka. RX-44 (OMAP2420)
n900& && && && && &&&Nokia N900 (OMAP3)
sx1& && && && && && &Siemens SX1 (OMAP310) V2
sx1-v1& && && && && &Siemens SX1 (OMAP310) V1
overo& && && && && & Gumstix Overo board (OMAP3530)
cheetah& && && && &&&Palm Tungsten|E aka. Cheetah PDA (OMAP310)
realview-eb& && && & ARM RealView Emulation Baseboard (ARM926EJ-S)
realview-eb-mpcore& &ARM RealView Emulation Baseboard (ARM11MPCore)
realview-pb-a8& && & ARM RealView Platform Baseboard for Cortex-A8
realview-pbx-a9& && &ARM RealView Platform Baseboard Explore for Cortex-A9
akita& && && && && & Akita PDA (PXA270)
spitz& && && && && & Spitz PDA (PXA270)
borzoi& && && && && &Borzoi PDA (PXA270)
terrier& && && && &&&Terrier PDA (PXA270)
lm3s811evb& && && &&&Stellaris LM3S811EVB
lm3s6965evb& && && & Stellaris LM3S6965EVB
tosa& && && && && &&&Tosa PDA (PXA255)
versatilepb& && && & ARM Versatile/PB (ARM926EJ-S)
versatileab& && && & ARM Versatile/AB (ARM926EJ-S)
vexpress-a9& && && & ARM Versatile Express for Cortex-A9
vexpress-a15& && && &ARM Versatile Express for Cortex-A15
z2& && && && && && & Zipit Z2 (PXA27x)”
请问是什么原因导致的呢?
没有选定要支持的cpu吧,告诉你支持哪些处理器,你需要选择一个你想仿真的处理器&
在线时间3680 小时
威望4056分
芯币26530枚
TA的帖子TA的资源
楼主,您好!请问运行“$ qemu-system-arm -M mini2440 -serial stdio -mtdblock nand/nand.bin ”后未出现 ...
没有选定要支持的cpu吧,告诉你支持哪些处理器,你需要选择一个你想仿真的处理器
EEWORLD 官方微信
Powered byFrom Wikipedia, the free encyclopedia
This article has multiple issues. Please help
or discuss these issues on the . ()
This article relies too much on
to . Please improve this by adding . (September 2011) ()
This article may be too technical for most readers to understand. Please
to , without removing the technical details. (December 2012) ()
This article's
does not adequately
key points of its contents. Please consider expanding the lead to
of all important aspects of the article. Please discuss this issue on the article's . (September 2015)
QEMU (short for Quick Emulator[]) is a
that performs
(not to be confused with ).
QEMU is a : it emulates
through dynamic
and provides a set of device models, enabling it to run a variety of unmodified . It also can be used with
to run virtual machines at near-native speed (requiring hardware virtualization extensions on x86 machines). QEMU can also do CPU emulation for user-level processes, allowing applications compiled for one architecture to run on another.
QEMU was written by
and is mainly licensed under
(GPL). Various parts are released under ,
(LGPL) or other GPL-compatible licenses. There is an option to use the proprietary
library when running on , which, if used, disqualifies the use of a single
software license. However, the default is to use .
QEMU has multiple operating modes:
User-mode emulation
In this mode QEMU runs single
or / programs that were compiled for a different . System calls are
and for 32/64 bit mismatches. Fast cross-compilation and cross-debugging are the main targets for user-mode emulation.
System emulation
In this mode QEMU emulates a full computer system, including . It can be used to provide virtual hosting of several virtual computers on a single computer. QEMU can boot many guest , including , , , , it supports emulating several instruction sets, including , , 32-bit , , , ,
KVM Hosting
Here QEMU deals with the setting up and migration of KVM images. It is still involved in the emulation of hardware, but the execution of the guest is done by KVM as requested by QEMU.
Xen Hosting
QEMU is involved only in the e the execution of the guest is done within Xen and is totally hidden from QEMU.
QEMU can save and restore the state of the virtual machine with all programs running. Guest operating-systems do not need patching in order to run inside QEMU.
QEMU supports the emulation of various architectures, including:
Release 6 and earlier variants
development boards (Integrator/CP and Versatile/PB)
SHIX board
The virtual machine can interface with many types of physical host hardware. These include: hard disks, CD-ROM drives, network cards, audio interfaces, and USB devices. USB devices can be completely emulated (mass storage from image files, input devices), or the host's USB devices can be used (however, this requires administrator privileges and does not work with all devices).
Virtual disk images can be stored in a special format () that only take up disk space that the guest OS actually uses. This way, an emulated 120 GB disk may occupy only a few hundred megabytes on the host. The QCOW2 format also allows the creation of overlay images that record the difference from another (unmodified) base image file. This provides the possibility for reverting the emulated disk's contents to an earlier state. For example, a base image could hold a fresh install of an operating system that is known to work, and the overlay images are used. Should the guest system become unusable (through virus attack, accidental system destruction, etc.), the user can delete the overlay and reconstruct an earlier emulated disk-image version.
QEMU can emulate network cards (of different models) which share the host system's connectivity by doing network address translation, effectively allowing the guest to use the same network as the host. The virtual network cards can also connect to network cards of other instances of QEMU or to local
interfaces. Network connectivity can also be achieved by bridging a TUN/TAP interface used by QEMU with a non-virtual Ethernet interface on the host OS using the host OS's bridging features.
QEMU integrates several services to allow the host and guest sy for example, an integrated
server and network-port redirection (to allow incoming connections to the virtual machine). It can also boot Linux kernels without a bootloader.
QEMU does not depend on the presence of graphical output methods on the host system. Instead, it can allow one to access the screen of the guest OS via an integrated
server. It can also use an emulated serial line, without any screen, with applicable operating systems.
Simulating multiple CPUs running
is possible.
QEMU does not require administrative rights to run, unless additional kernel modules for improving speed are used (like ), or when some modes of its network connectivity model are utilized.
The Tiny Code Generator (TCG) aims to remove the shortcoming of relying on a particular version of
or any compiler, instead incorporating the compiler (code generator) into other tasks performed by QEMU at run time. The whole translation task thus consists of two parts: blocks of target code (TBs) being rewritten in TCG ops - a kind of machine-independent intermediate notation, and subsequently this notation being compiled for the host's architecture by TCG. Optional optimisation passes are performed between them.
TCG requires dedicated code written to support every architecture it runs on. It also requires that the target instruction translation be rewritten to take advantage of TCG ops, instead of the previously used dyngen ops.
Starting with QEMU Version 0.10.0, TCG ships with the QEMU stable release.
KQEMU was a
, also written by , which notably sped up emulation of x86 or x86-64 guests on platforms with the same CPU architecture. This worked by running
code (and optionally some kernel code) directly on the host computer's CPU, and by using processor and peripheral emulation only for
code. KQEMU could execute code from many guest OSes even if the host CPU did not support . KQEMU was initially a
product available free of charge, but starting from version 1.3.0pre10, it was
under the . QEMU versions starting with 0.12.0 (as of August 2009) support large memory which makes them incompatible with KQEMU. Newer releases of QEMU have completely removed support for KQEMU.
QVM86 was a
licensed drop-in replacement for the then closed-source KQEMU. The developers of QVM86 ceased development in January, 2007.
(KVM) has mostly taken over as the Linux-based hardware-assisted virtualization solution for use with QEMU in the wake of the lack of support for KQEMU and QVM86.[]
Intel's Hardware Accelerated Execution Manager (HAXM) is an open-source alternative to KVM for x86-based hardware-assisted virtualization on Windows and macOS. As of 2013 Intel mostly solicits its use with QEMU for Android development. Starting with version 2.9.0, the official QEMU includes support for HAXM.
QEMU supports the following
(.dmg) – Read-only
– Read-only
– Read-only
disk image (.hdd, .hds) – Read-only
(.qcow2, .qed, .qcow, .cow)
(.img) that contain sector-by-sector contents of a disk
(.iso) that contain sector-by-sector contents of an optical disk (e.g. booting live OSes)
The -compatible -3 processor adds 200 new instructions to help QEMU translate x86 those new instructions lower the overhead of executing x86/-style instructions in the MIPS pipeline. With additional improvements in QEMU by the , Loongson-3 achieves an average of 70% the performance of executing native binaries while running x86 binaries from nine benchmarks.
Virtualization solutions that use QEMU are able to execute multiple virtual CPUs in parallel. For user-mode emulation QEMU maps emulated threads to host threads. For full system emulation QEMU is capable of running a host thread for each emulated virtual CPU (vCPU). This is dependent on the guest having been updated to support parallel system emulation, currently ARM and Alpha. Otherwise a single thread is used to emulate all virtual CPUS (vCPUS) which executes each vCPU in a round-robin manner.
, released in January 2007, uses some of QEMU's virtual hardware devices, and has a built-in
based on QEMU. As with KQEMU, VirtualBox runs nearly all guest code natively on the host via the VMM (Virtual Machine Manager) and uses the recompiler only as a fallback mechanism - for example, when guest code executes in . In addition, VirtualBox does a lot of code analysis and patching using a built-in disassembler in order to minimize recompilation. VirtualBox is free and open-source (available under ), except for certain features.
, a virtual machine monitor, can run in HVM (hardware virtual machine) mode, using
extensions and
virtualization extension. This means that instead of paravirtualized devices, a real set of virtual hardware is exposed to the domU to use real device drivers to talk to.
QEMU includes several components: CPU emulators, emulated devices, generic devices, machine descriptions, user interface, and a debugger. The emulated devices and generic devices in QEMU make up its device models for I/O virtualization. They comprise a PIIX3 IDE (with some rudimentary PIIX4 capabilities), Cirrus Logic or plain VGA emulated video, RTL8139 or E1000 network emulation, and ACPI support. APIC support is provided by Xen.
Xen-HVM has device emulation based on the QEMU project to provide I/O virtualization to the VMs. Hardware is emulated via a QEMU "device model" daemon running as a backend in dom0. Unlike other QEMU running modes (dynamic translation or KVM), virtual CPUs are completely managed to the hypervisor, which takes care of stopping them while QEMU is emulating memory-mapped I/O accesses.
(Kernel-based Virtual Machine) is a FreeBSD and Linux kernel module that allows a
program access to the
features of various processors, with which QEMU is able to offer virtualization for x86, PowerPC, and S/390 guests. When the target architecture is the same as the host architecture, QEMU can make use of KVM particular features, such as acceleration.
In early 2005,
introduced Win4Lin Pro Desktop, based on a 'tuned' version of QEMU and KQEMU and it hosts NT-versions of Windows. In June 2006, Win4Lin released Win4Lin Virtual Desktop Server based on the same code base. Win4Lin Virtual Desktop Server serves Microsoft Windows sessions to thin clients from a Linux server.
In September 2006, Win4Lin announced a change of the company name to
with the release of Win4BSD Pro Desktop, a port of the product to FreeBSD and PC-BSD. Solaris support followed in May 2007 with the release of Win4Solaris Pro Desktop and Win4Solaris Virtual Desktop Server.
SerialICE is a QEMU-based firmware debugging tool running system firmware inside of QEMU while accessing real hardware through a serial connection to a host system. This can be used as a cheap replacement for hardware .
Amiga emulator introduced in version 3.0.0 the support for
using QEMU PPC core.
Besides the
(which is also configurable and can emulate a number of Intel CPU models including (as of 3 March 2018) , , ,
and ), the following devices are emulated:
/-drive using an
controller or
controller
(Cirrus CLGD 5446 PCI VGA-card,Standard-VGA graphics card with Bochs- - Hardware level, including all non-standard modes, and an experimental patch that can accelerate simple 3D graphics via OpenGL, Red Hat QXL VGA or VirtIO GPU)
( PCI network adapter)
Depending on target: i82551, i82557b, i82559er,
PCI, NE2000 ISA, , , e1000 (PCI Intel Gigabit Ethernet), SMC91c111, Lance and mcf_fec.
disk interface
i440FX/PIIX3 ( and ) or Q35/ICH9 ( and ) chipsets
(LSI MegaRAID SAS 1078, LSI53C895A, NCR53C9x as found in the AMD PCscsi and Tekram DC-390 controllers)
(, ES1370 PCI, , , and )
(Intel 6300 ESB PCI, or iB700 ISA)
1.x/2.x/3.x controllers (, , )
USB devices: audio, Bluetooth dongle,
(keyboard/mouse/tablet), , serial interface,
smartcard reader, storage ( and ), Wacom tablet
Paravirtualized
devices: block device, network card, SCSI controller, serial interface, ,
filesystem driver
Paravirtualized Xen devices: block device, network card, console, framebuffer and input device
implementation used by QEMU starting from version 0.12 is . The VGA BIOS implementation comes from Plex86/.The
firmware for QEMU is OVMF.
QEMU emulates the following
peripherals:
UniNorth PCI bridge
PCI-VGA-compatible graphics card which maps the VESA Bochs Extensions
Two PMAC-IDE-Interfaces with hard disk and CD-ROM support.
PCI adapter
Non-volatile RAM
VIA-CUDA with
keyboard and mouse.
is used as the firmware.
QEMU emulates the following
peripherals:
PCI bridge
PCI VGA-compatible graphics card with VESA Bochs Extensions
Two IDE interfaces with hard disk and CD-ROM support
Floppy disk drive
network adapter
Serial interface
PREP non-volatile RAM
PC-compatible keyboard and mouse
On the PREP target, Open Hack'Ware, an –compatible BIOS, is used.
QEMU can emulate the paravirtual sPAPR interface with the following peripherals:
PCI bridge, for access to virtio devices, VGA-compatible graphics, USB, etc.
Virtual I/O network adapter, SCSI controller, and serial interface
sPAPR non-volatile RAM
On the sPAPR target, another Open-Firmware–compatible BIOS is used, called SLOF.
QEMU booted into the ARM port of
QEMU emulates the
(and down to ARMv5TEJ) with NEON extension. It emulates full systems like Integrator/CP board, Versatile baseboard, RealView Emulation baseboard, XScale-based PDAs, Palm Tungsten|E PDA,
Internet tablets etc. QEMU also powers the Android emulator which is part of the
(most current Android implementations are ARM based). Starting from version 2.0.0 of their Bada SDK, Samsung has chosen QEMU to help development on emulated 'Wave' devices.
In 1.5.0 and 1.6.0 Samsung
4210 (dual-core Cortex a9) and Versatile Express
are emulated. In 1.6.0, the 32-bit instructions of the ARMv8 (AARCH64) architecture are emulated, but 64-bit instructions are unsupported.
The Xilinx Cortex A9-based Zynq SoC is modelled, with the following elements:
Zynq-7000 ARM Cortex-A9 CPU
Zynq-7000 ARM Cortex-A9 MPCore
Triple Timer Counter
DDR Memory Controller
DMA Controller (PL330)
Static Memory Controller (NAND/NOR Flash)
SD/SDIO Peripheral Controller (SDHCI)
Zynq Gigabit Ethernet Controller
USB Controller (EHCI - Host support only)
Zynq UART Controller
SPI and QSPI Controllers
I2C Controller
QEMU has support for both 32 and 64-bit
architectures.
When the firmware in the
(sun4m-Architecture) became version 0.8.1 Proll, a
replacement used in version 0.8.2, was replaced with .
QEMU emulates the following
peripherals:
IOMMU or IO-UNITs
TCX Frame buffer (graphics card)
Non-volatile RAM
Slave I/O: timers, interrupt controllers,
serial ports, keyboard and power/reset logic
ESP SCSI controller with hard disk and CD-ROM support
Floppy drive (not on SS-600MP)
CS4231 sound device (only on SS-5, not working yet)
(UltraSPARC PC-like machine),
(T1 PC-like machine), or generic
(T1) machine with the following peripherals:
APB PCI Bridge
PCI VGA compatible card with VESA Bochs Extensions
PS/2 mouse and keyboard
Non-volatile RAM M48T59
PC-compatible serial ports
2 PCI IDE interfaces with hard disk and CD-ROM support
Floppy disk
Supported peripherals:
with/without MMU, including
AXI Timer and Interrupt controller peripherals
AXI External Memory Controller
AXI DMA Controller
Xilinx AXI Ethernet
AXI Ethernet Lite
AXI UART 16650 and UARTLite
AXI SPI Controller
Supported peripherals:
Memory card
This section is empty. You can help by . (January 2011)
This section is empty. You can help by . (August 2012)
External trees exist supporting the following targets:
emulating a
. wiki.qemu.org.
. qemu.weilnetz.de.
. www.claunia.com.
. wiki.prplfoundation.org.
. lists.gnu.org.
. Lwn.net. February 6, 2007.
Liguori, Anthony (10 August 2009). .
. QEMU developers. . HAXM is now open source
. Intel. . The Intel Hardware Accelerated Execution Manager (Intel(R) HAXM) is a hardware-assisted virtualization engine (hypervisor) that uses Intel Virtualization Technology (Intel(R) VT) to speed up Android app emulation on a host machine.
. qemu.weilnetz.de.
. Linux Tips.
(PDF). www.sun.com.
December 22, 2007, at the .
February 10, 2008, at the .
December 23, 2007, at the .
. serialice.com.
. English Amiga Board. .
. lists.gnu.org.
. wiki.qemu.org.
. wiki.qemu.org.
. wiki.qemu.org.
. wiki.qemu.org.
"i82551, i82557b, i82559er, ne2k_pci, ne2k_isa, pcnet, rtl8139, e1000, smc91c111, lance and mcf_fec"
Networking on QEMU: Setting Up The E1000 & Novell NE2000 ISA Evaluation
. gitorious.org.
. 090427 people.redhat.com
. 090506 homepage.ntlworld.com
. 090506 nongnu.org
Wikimedia Commons has media related to .
Wikibooks has more on the topic of:
an IBM developerWorks article by M. Tim Jones
(in German, or computer translated to English)
: Hidden categories:

我要回帖

更多关于 beanwrapper 的文章

 

随机推荐