计算机应用 ›› 2015, Vol. 35 ›› Issue (3): 886-890.DOI: 10.11772/j.issn.1001-9081.2015.03.886

• 行业与领域应用 • 上一篇    下一篇

Android系统中Win32环境的高性能虚拟

胡嘉杰, 蒋乐天   

  1. 上海交通大学 电子工程系, 上海 200240
  • 收稿日期:2014-10-22 修回日期:2014-11-20 出版日期:2015-03-10 发布日期:2015-03-13
  • 通讯作者: 胡嘉杰
  • 作者简介:胡嘉杰(1990-),男,江苏苏州人,硕士研究生,主要研究方向:嵌入式系统;蒋乐天(1975-),男,浙江义乌人,副教授,博士,主要研究方向:嵌入式系统、移动计算、可靠性和可用性

High performance simulation of Win32 environment in Android system

HU Jiajie, JIANG Letian   

  1. Department of Electronic Engineering, Shanghai Jiao Tong University, Shanghai 200240, China
  • Received:2014-10-22 Revised:2014-11-20 Online:2015-03-10 Published:2015-03-13

摘要:

针对Win32应用程序无法直接在Android系统中运行的问题,提出了一套高性能的虚拟Win32环境实现方案。通过将x86程序以翻译块(TB)为单位动态地翻译为高级精简指令集机器(ARM)指令并执行,解决了指令集不兼容的问题。同时,借助Wine这一兼容层将Win32 API调用最终转换为Linux系统调用,从而避免对整个操作系统的虚拟。此外,图形系统采用以虚拟Framebuffer为后端的X显示服务,并通过虚拟网络计算(VNC)协议完成图像在物理屏幕上的显示,以实现X窗口系统与Android图形系统的适配。经测试,系统本身的初始化时间小于30 s,内存占用小于150 MB,而其图形界面渲染、文件读写和浮点运算性能普遍可达系统级虚拟方案的4倍以上。实验结果表明,该框架具有启动速度快、资源占用低的特点,能够在Android系统中提供Win32环境的高性能虚拟。

关键词: 虚拟化, Android, 动态二进制翻译, Wine, QEMU

Abstract:

To solve the problem that Win32 applications cannot run directly in Android system, a high performance solution was proposed to simulate the Win32 environment. By dynamically translating x86 program consisted of Translation Blocks (TB) into Advanced Reduced Instruction Set Computing Machine (ARM) instructions and then executing it, the instruction compatibility issue was solved. At the same time, with the help of Wine, a compatibility layer, Win32 API invocations were converted into Linux system calls ultimately. In this way, emulation of the whole operating system was avoided. Moreover, to achieve the adaption between the X window system and the graphics stack in Android, an X display server with a virtual Framebuffer backend was adopted in the graphics system, and images were shown on the physical screen through the Virtual Network Computing (VNC) protocol. The system can finish its initialization within 30 seconds, occupying less than 150MB of memory, while its performance in GUI rendering, file I/O and floating-point calculation can generally be over 3 times better than solutions based on full-system emulation in the experiments. The results show that the proposed framework features fast startup and low resource consumption, and it can provide a high performance simulation scheme of Win32 environment in Android.

Key words: virtualization, Android, dynamic binary translation, Wine, QEMU

中图分类号: