Blink: High-Performance X86-64 Emulator Launches

published The first significant issue of the project Blink , developing an emulator of the X86-64 processors, which allows you to run statically and dynamically assembled Linux applications in a virtual machine with an emulated processor. Using the BLINK, which are in the architecture of the X86-64 Linux programs can be launched in other Posix-compatible operating systems (MacOS, FreeBSD, NETBSD, OpenBSD, CYGWIN) and equipment with another hardware architecture (X86, ARM, RISC-V, MIPS, MIPS, MIPS PowerPC, S390X). The project code is written in SI (ANSI C11) and spreads under the ISC license. Of the dependencies, only LIBC (posix.1-2017) is required.

In terms of functionality, Blink resembles the QMU-X86_64 command, but differs from QEMU with a more compact performance and significant increase in performance. For example, the BLINK executed file takes only 221 KB (with a cut assembly – 115 KB) instead of 4 MB in Qemu -X86_64, and in terms of performance in some tests, such as launching GCC and performing mathematical operations, QMU is about two times.

To ensure high performance, a JIT comparator is used, on the fly, converting source instructions into the machine code for the target platform. The direct launch of executable files in ELF, PE (Portable Executables) and Bin (Flat Executable) collected with standard Cosmopolitan, Glibc and MUSL systems is supported. The built -in support of 180 Linux system calls and the emulation of about 600 processor instructions X86 were implemented, covering the instructions I8086, i386, SSE2, X86_64, SSE3, SSE3, CLMUL, PopCnt, ADX, BMI2 (Mulx, PDEP, PEXT), X87, RDRN D, rdseed and rdtscp.

An additional project is developed by the utility blinkenlights , which provides an interface for debugging programs on different platforms, visualizing the program and analyzing the content of memory. A feature of the debugger is the support of the reversal debugging mode
(Reverse-debuging), which allows you to move back in the history of execution and return to an already previously executed point. The project is developed by the author of such developments as Cosmopolitan Cosmopolitan SI Biblioteka, PLEDGE insulation mechanism for Linux and a universal executive system of Redbean.


/Reports, release notes, official announcements.