-
虚拟机与二进制翻译技术拾遗
虽然项目的成功与否不是技术能决定的,但技术依然长存,最多换个名字。
-
NativeBridge - Manage Java Native Interface Functionality of Alternative Architecture on Android
Android, the most popular mobile operating system, hosts applications composed by Java code and native code. Java Virtual Machine of Android provides Java Native Interface functionality as the bridge of Java world and native world. As native world is platform dependent, it requires significant effort for application vendors to enable ARM applications, which are of the majority in Android ecosystem, on Non-ARM devices. Thus, Android is bind to ARM platform though it's a modern operating system. To address this issue, Android introduced NativeBridge to manage the Java Native Interface functionality of alternative architecture, such that a platform can support non-native applications on it. In this way, Android applications can run on any Android platforms regardless of the architecture.
-
基于命名空间的动态链接—— 隔离 Android 中应用程序和系统的本地库
Android 提供针对 Java 的 SDK 和针对本地应用的 NDK 作为 API 。对于私有接口,Java 库通过 Java 类加载器 (ClassLoader) 对应用程序隐藏,而本地共享库库可以很容易地被访问。另一方面,Oreo 的 Project Treble 旨在通过将 Android 实现分为Framework 和 Vendor 两个部分来解决碎片化的生态系统。这种代码划分需要在一个进程中分别管理两个本机库的集合。面对这些挑战,Android 动态链接器引入了 命名空间 (namespace)来隔离动态链接空间。 Android 系统部署 命名空间 以防止应用程序与私有本地库动态链接,并在不同的沙箱中管理 Framework 和 Vendor 库。本文分析了Android Oreo 的 命名空间 ,包括动态链接器的机制以及它与高层策略的相互配合,并讨论了其影响和收益。
-
Namespace based Dynamic Linking - Isolating Native Library of Application and System in Android
Android provides Software Development Kit (SDK, for Java) and Native Development Kit (NDK, for native language such as C and C++) as public Application Programming Interface (API, includes libraries). For private interface, Java libraries are hidden from applications by Java ClassLoader, while native libraries could easily be accessed previously. On the other hand, Project Treble of Android Oreo, aiming to address fragmented ecosystem by dividing Android implementation into Framework and Vendor part, needs to manage native libraries of two sets in one process separately. With these challenges, Android dynamic linker introduces namespace which isolates dynamic linking space. Android system deploys namespace to prevent applications from dynamically linking against private native libraries, and host Framework and Vendor libraries in different sandboxes. This article analyzes the namespace of Android Oreo, including the mechanism of dynamic linker as well as its inter-cooperation with system level namespace policy, and discusses the impacts and benefits.
-
Java Native Interface - the Essentials
The Java™ Native Interface (JNI) is a powerful feature of the Java platform. Applications that use the JNI can incorporate native code written in programming languages such as C and C++, as well as code written in the Java programming language.
-
Android Dynamic Linker in Marshmallow
Dynamic linker, links shared libraries together to be able to run, has been a fundamental mechanism in modern operating system and rich software ecosystem over the past decades. Dynamic linker is always highly platform-customized since it's coupled with binary format of a system. This article introduces the basic conception of dynamic linker and takes Android (Marshmallow) dynamic linker as example to discuss the implementation. We will see that dynamic link is a engineering-purpose mechanism rather than a theory-born one.
-
A Dual-TLB Method for MIPS Heterogeneous Virtualization
DBT directly translates and executes binary programs, enabling a compatible system by virtualizing one machine (guest) on another (host). However, the memory virtualization of guest brings in a great overhead, due to effort it takes to translate GVA into HPA (Host Physical Address). For QEMU, a DBT with efficient memory virtualization mechanism, more than 60% of the translated code is used to virtualize memory, thus leading to a low performance of guest. In this paper, we employ the Co-Design methodology to optimize memory access performance of guest. This optimization is primarily focused on two aspects. First, hardware extensions are designed and implemented to conduct GVA to HPA translation directly. Second, we modify QEMU to cooperate with hardware to reduce translated code. By this means, the cost of memory virtualization is completely eliminated, resulting in a significant enhancement of the performance of the Loongson binary translation system. The experimental data implies that the performance of guest has been dramatically improved by 100 times for peak performance and 19.12% for average performance over the previous system.
-
QEMU:一个高速、可移植的动态翻译器
QEMU可以在多种主机(x86, PowerPC, ARM, Sparc Alpha and MIPS)上仿真多种客户机(x86, PowerPC, ARM and Sparc)。通过完备的系统仿真,QEMU支持在虚拟机中运行未经修改的操作系统;通过Linux用户模式仿真,还支持在不同CPU上运行Linux软件。