QEMU 架构

我们首先了解一下 QEMU 如何实现仿真。本节将介绍 QEMU 的两种操作模式,以及 QEMU 动态翻译程序的一些有趣特点。

QEMU 基本操作

QEMU 支持两种操作模式:用户模式仿真和系统模式仿真。用户模式仿真 允许一个 CPU 构建的进程在另一个 CPU 上执行(执行主机 CPU 指令的动态翻译并相应地转换 Linux 系统调用)。系统模式仿真 允许对整个系统进行仿真,包括处理器和配套的外围设备。

在 x86 主机系统上仿真 x86 代码时,使用 QEMU 加速器 可以实现近似本地的性能。这让我们能够直接在主机 CPU 上执行仿真代码(在 Linux 上通过 kernel 模块执行)。

但是从技术角度看,QEMU 的有趣之处在于其快速、可移植的动态翻译程序。动态翻译程序 允许在运行时将用于目标(来宾)CPU 的指令转换为用于主机 CPU,从而实现仿真。这可以通过一种强制方法实现(将指令从一个 CPU 映射到另一个 CPU),但是情况并非总是这样简单,在某些情况下,根据所翻译的架构,可能需要使用多个指令或行为更改。

http://www.ibm.com/developerworks/cn/linux/l-qemu/

qemu中文手册(貌似已经过时了 2007年的文档)

http://linux.chinaunix.net/techdoc/desktop/2007/11/28/973382.shtml

官方文档   http://qemu.weilnetz.de/qemu-doc.html#Introduction

QEMU is a FAST! processor emulator using dynamic translation to achieve good emulation speed.

QEMU has two operating modes:

  •  Full system emulation. In this mode, QEMU emulates a full system (for example a PC), including one or several processors and various peripherals. It can be used to launch different Operating Systems without rebooting the PC or to debug system code.

  •  User mode emulation. In this mode, QEMU can launch processes compiled for one CPU on another CPU. It can be used to launch the Wine Windows API emulator (http://www.winehq.org) or to ease cross-compilation and cross-debugging.

QEMU can run without a host kernel driver and yet gives acceptable performance.

 

Working with ISO and IMG files in QEMU – Linux
https://www.youtube.com/watch?v=JxSGT_3UU8w


其他REFERENCE :
qemu 使用   (挺全的中文解说)

http://wiki.qemu.org/Manual

http://wiki.qemu.org/Documentation/Networking