How ptitseb/box64 works
Box64 is a Linux userspace emulator that runs x86-64 Linux programs on supported non-x86-64 hosts. The documented user workflow is to invoke box64 ./program; the runtime loads ELF executables and dependencies, emulates x86 instructions, and can use architecture-specific dynamic recompilers. It also provides native-library wrappers and configuration controls. The graph combines README capabilities with relationships visible in the supplied source index and excerpts; unsampled implementation details are represented cautiously, without asserting unverified call order.
Main entry points: core.c Runtime core · library.c Library resolution · dynarec.c Dynamic recompiler · box64context.c Emulator context
Components 21
Runtime entry
- CLI entry
src/main.c - Runtime core
src/core.c
ELF and libraries
- ELF parsing
src/elfs/elfparser.c - ELF loading
src/elfs/elfloader_private.h - Library resolution
src/librarian/library.c - Library interfaces
src/include/library.h - Loader interfaces
src/include/elfloader.h
Emulation and translation
- x86 interpreter
src/emu/x64run.c - x86 emulator state
src/emu/x64emu_private.h - Dynamic recompiler
src/dynarec/dynarec.c - Arm64 backend
src/dynarec/arm64/dynarec_arm64_00.c - RISC-V backend
src/dynarec/rv64/dynarec_rv64_00.c - LoongArch backend
src/dynarec/la64/dynarec_la64_00.c
Compatibility
- Native library wrappers
src/wrapped/wrappedwaylandclient.c - Function bridges
src/include/bridge.h - GTK class bridging
src/tools/gtkclass.c
Runtime support
- Emulator context
src/box64context.c - Runtime configuration
configurator/box64rc.py - Translated-code cache
src/tools/dynacache.c
Other components
- Program user
- Host libraries
Connections 22
- Program user → CLI entry: runs program
README.md - CLI entry → Runtime core: enters runtime
src/main.c - ELF parsing → ELF loading: uses loader types
src/elfs/elfparser.c - Library resolution → ELF loading: loads ELF libraries
src/librarian/library.c - Library resolution → Library interfaces: uses interface
src/librarian/library.c - ELF parsing → Loader interfaces: uses interface
src/elfs/elfparser.c - Emulator context → Loader interfaces: uses interface
src/box64context.c - Emulator context → x86 emulator state: uses emulator state
src/box64context.c - Emulator context → Function bridges: uses bridges
src/box64context.c - Native library wrappers → Function bridges: bridges callbacks
src/wrapped/wrappedwaylandclient.c - GTK class bridging → Function bridges: bridges callbacks
src/tools/gtkclass.c - Runtime core → ELF loading: loads executable
- Runtime core → x86 interpreter: runs instructions
- Runtime core → Library resolution: resolves dependencies
- Runtime core → Runtime configuration: reads settings
- Runtime core → Translated-code cache: uses code cache
- Dynamic recompiler → Arm64 backend: dispatches backend
- Dynamic recompiler → RISC-V backend: dispatches backend
- Dynamic recompiler → LoongArch backend: dispatches backend
- Library resolution → Native library wrappers: resolves wrappers
- Native library wrappers → Host libraries: calls host APIs
- Runtime core → Dynamic recompiler: translates execution