Building a Minimal Viable Armv7 Emulator from Scratch
xnacly.me·4d·
Flag this post

Tip or TLDR - I built a tiny, zero dependency armv7 userspace emulator in Rust

I wrote a minimal viable armv7 emulator in 1.3k lines of Rust without any dependencies. It parses and validates a 32-bit arm binary, maps its segments, decodes a subset of arm instructions, translates guest and host memory interactions and forwards arm Linux syscalls into x86-64 System V syscalls.

It can run a armv7 hello world binary and does so in 1.9ms (0.015ms for raw emulation without setup), while qemu takes 12.3ms (stinkarm is thus ~100-1000x slower than native armv7 execution).

After reading about the process the Linux kernel performs to execute binaries, I thought: I want to write an armv7 emulator - stinkarm. Mostly to understand the ELF format, …

Similar Posts

Loading similar posts...