2021-01-08 14:17:37 +00:00
2019-03-03 20:04:07 +00:00
Usage
----
2021-01-07 23:30:34 +00:00
There are many environment variables to control Box86 behaviour.
2019-03-03 20:04:07 +00:00
2020-10-05 09:53:46 +00:00
#### BOX86_LOG
2021-01-07 23:30:34 +00:00
Controls the Verbosity level of the logs
2021-01-14 20:12:02 +00:00
* 0: NONE : No message (except some fatal error). (Default.)
* 1: INFO : Show some minimum log (Example: librairies not found)
* 2: DEBUG : Details a lot of stuff (Example: relocations or functions called).
2021-05-28 09:25:10 +00:00
* 3: DUMP : All DEBUG plus DUMP of all ELF Info (so same as `BOX86_LOG=2 BOX86_DUMP=1` )
#### BOX86_DUMP
Controls the Dump of elf content
* 0: No dump of elf information (Default)
* 1: Dump elf sections and relocations and other information (also active if using `BOX86_LOG=3` )
2019-03-03 20:04:07 +00:00
2020-10-05 09:53:46 +00:00
#### BOX86_NOBANNER
2021-01-14 20:12:02 +00:00
Disables Box86 printing its version and build
* 0 : Enable printing its banner. (Default.)
* 1 : Disable printing its banner.
2020-10-05 09:53:46 +00:00
2019-03-03 20:04:07 +00:00
#### BOX86_LD_LIBRARY_PATH
2021-01-12 21:34:08 +00:00
Path to look for x86 libraries. Default is current folder and `lib` in current folder.
Also, `/usr/lib/i386-linux-gnu` and `/lib/i386-linux-gnu` are added if they exist.
2019-03-03 20:04:07 +00:00
#### BOX86_PATH
2021-01-07 23:30:34 +00:00
Path to look for x86 executable. Default is current folder and `bin` in current folder.
2019-03-03 20:04:07 +00:00
#### BOX86_DLSYM_ERROR
2021-01-12 21:34:08 +00:00
Enables/Disables the logging of `dlsym` errors.
2021-01-14 20:12:02 +00:00
* 0 : Don't log `dlsym` errors. (Default.)
* 1 : Log dlsym errors.
2019-03-03 20:04:07 +00:00
#### BOX86_TRACE_FILE
Send all log and trace to a file instead of `stdout`
2021-01-07 23:30:34 +00:00
Also, if name contains `%pid` then this is replaced by the actual PID of box86 instance
2021-06-04 14:46:43 +00:00
Use `stderr` to use this instead of default `stdout`
2019-03-03 20:04:07 +00:00
#### BOX86_TRACE
2021-01-07 23:30:34 +00:00
Only on build with trace enabled. Trace allow the logging of all instruction executed, along with register dump
2021-01-14 20:12:02 +00:00
* 0 : No trace. (Default.)
2021-01-12 21:34:08 +00:00
* 1 : Trace enabled. Trace start after the initialisation of all depending libraries is done.
2021-01-14 20:12:02 +00:00
* symbolname : Trace only `symbolname` (trace is disable if the symbol is not found).
* 0xXXXXXXX-0xYYYYYYY : Trace only between the 2 addresses.
2019-03-03 20:04:07 +00:00
2019-07-10 05:41:21 +00:00
#### BOX86_TRACE_INIT
2021-01-07 23:30:34 +00:00
Use BOX86_TRACE_INIT instead of BOX_TRACE to start trace before the initialisation of libraries and the running program
2021-01-14 20:12:02 +00:00
* 0 : No trace. (Default.)
* 1 : Trace enabled. The trace start with the initialisation of all depending libraries is done.
2019-07-10 05:41:21 +00:00
2019-03-03 20:04:07 +00:00
#### BOX86_TRACE_START
2021-01-12 21:34:08 +00:00
Only on builds with trace enabled.
2021-01-14 20:12:02 +00:00
* NNNNNNN : Start trace only after NNNNNNNN opcode execute (number is an `uint64_t` ).
2019-03-03 20:04:07 +00:00
#### BOX86_TRACE_XMM
2021-01-12 21:34:08 +00:00
Only on builds with trace enabled.
2021-01-14 20:12:02 +00:00
* 0 : The XMM (i.e. SSE/SSE2) register will not be logged with the general and x86 registers. (Default.)
* 1 : Dump the XMM registers.
2019-03-03 20:04:07 +00:00
2019-03-18 16:28:21 +00:00
#### BOX86_LOAD_ADDR
2021-01-07 23:30:34 +00:00
Try to load at 0xXXXXXX main binary (if binary is a PIE)
2021-01-14 20:12:02 +00:00
* 0xXXXXXXXX : The load address . (Only active on PIE programs.)
2019-07-10 05:41:21 +00:00
#### BOX86_NOSIGSEGV
2021-01-12 21:34:08 +00:00
Disable handling of SigSEGV. (Very useful for debugging.)
2021-01-14 20:12:02 +00:00
* 0 : Let the x86 program set sighandler for SEGV (Default.)
* 1 : Disable the handling of SigSEGV.
2019-08-15 13:08:14 +00:00
2020-04-24 09:11:22 +00:00
#### BOX86_NOSIGILL
2021-01-12 21:34:08 +00:00
Disable handling of SigILL (to ease debugging mainly).
2021-01-14 20:12:02 +00:00
* 0 : Let x86 program set sighandler for Illegal Instruction
* 1 : Disables the handling of SigILL
2020-04-24 09:11:22 +00:00
2019-08-15 13:08:14 +00:00
#### BOX86_X11COLOR16
2021-01-12 21:34:08 +00:00
PANDORA only: Try converting X11 color from 32 bits to 16 bits (to avoid light green on light cyan windows).
2021-01-14 20:12:02 +00:00
* 0 : Don't touch X11 colors. (Default.)
* 1 : Change colors arguments in XSetForeground, XSetBackground and XCreateGC.
2019-10-15 12:39:33 +00:00
2019-12-21 14:13:15 +00:00
#### BOX86_X11THREADS
2021-01-12 21:34:08 +00:00
Call XInitThreads when loading X11. (This is mostly for old Loki games with the Loki_Compat library.)
2021-01-14 20:12:02 +00:00
* 0 : Don't force call XInitThreads. (Default.)
* 1 : Call XInitThreads as soon as libX11 is loaded.
2019-12-21 14:13:15 +00:00
2020-07-16 07:22:37 +00:00
#### BOX86_X11GLX
2021-01-12 21:34:08 +00:00
Force libX11's GLX extension to be present.
2021-01-14 20:12:02 +00:00
* 0 : Do not force libX11's GLX extension to be present.
* 1 : GLX will always be present when using XQueryExtension. (Default.)
2020-07-16 07:22:37 +00:00
2020-03-05 10:39:56 +00:00
#### BOX86_DYNAREC_DUMP
2021-01-12 21:34:08 +00:00
Enables/disables Box86's Dynarec's dump.
2021-01-14 20:12:02 +00:00
* 0 : Disable Dynarec's blocks dump. (Default.)
* 1 : Enable Dynarec's blocks dump.
* 2 : Enable Dynarec's blocks dump with some colors.
2020-03-05 10:39:56 +00:00
2019-10-15 12:39:33 +00:00
#### BOX86_DYNAREC_LOG
2021-01-12 21:34:08 +00:00
Set the level of DynaRec's logs.
2021-01-14 20:12:02 +00:00
* 0 : NONE : No Logs for DynaRec. (Default.)
* 1 :INFO : Minimum Dynarec Logs (only unimplemented OpCode).
* 2 : DEBUG : Debug Logs for Dynarec (with details on block created / executed).
* 3 : VERBOSE : All of the above plus more.
2019-10-15 12:39:33 +00:00
#### BOX86_DYNAREC
2021-01-12 21:34:08 +00:00
Enables/Disables Box86's Dynarec.
2021-01-14 20:12:02 +00:00
* 0 : Disables Dynarec.
* 1 : Enable Dynarec. (Default.)
2019-10-15 12:39:33 +00:00
#### BOX86_DYNAREC_TRACE
2021-01-12 21:34:08 +00:00
Enables/Disables trace for generated code.
2021-01-14 20:12:02 +00:00
* 0 : Disable trace for generated code. (Default.)
* 1 : Enable trace for generated code (like regular Trace, this will slow down the program a lot and generate huge logs).
2019-12-03 22:25:08 +00:00
2021-02-26 09:14:01 +00:00
#### BOX86_NODYNAREC
Forbid dynablock creation in the interval specified (helpfull for debugging behaviour difference between Dynarec and Interpretor)
* 0xXXXXXXXX-0xYYYYYYYY : define the interval where dynablock cannot start (inclusive-exclusive)
2019-12-03 22:25:08 +00:00
#### BOX86_LIBGL
2021-01-12 21:34:08 +00:00
* libXXXX set the name for libGL (defaults to libGL.so.1).
2021-01-14 20:12:02 +00:00
* /PATH/TO/libGLXXX : Sets the name and path for libGL
2019-12-05 22:36:40 +00:00
You can also use SDL_VIDEO_GL_DRIVER
#### BOX86_LD_PRELOAD
* XXXX[:YYYYY] force loading XXXX (and YYYY...) libraries with the binary
PreLoaded libs can be emulated or native, and are treated the same way as if they were comming from the binary
2020-01-05 14:47:10 +00:00
#### BOX86_EMULATED_LIBS
* XXXX[:YYYYY] force lib XXXX (and YYYY...) to be emulated (and not wrapped)
2021-01-07 23:30:34 +00:00
Some games uses an old version of some libraries, with an ABI incompatible with native version.
2020-03-06 09:17:35 +00:00
Note that LittleInferno for example is auto detected, and libvorbis.so.0 is automatical added to emulated libs, and same for Don't Starve (and Together / Server variant) that use an old SDL2 too
2020-01-27 16:22:02 +00:00
#### BOX86_ALLOWMISSINGLIBS
2021-01-12 21:34:08 +00:00
Allow Box86 to continue even if a library is missing.
2021-01-14 20:12:02 +00:00
* 0 : Box86 will stop if a library cannot be loaded. (Default.)
* 1 : Continue even if a needed library cannot be loaded. Unadvised, this will, in most cases, crash later on.
2020-01-27 16:22:02 +00:00
2020-10-14 07:29:59 +00:00
#### BOX86_NOPULSE
2021-01-14 20:12:02 +00:00
Disables the load of pulseaudio libraries.
* 0 : Load pulseaudio libraries if found. (Default.)
* 1 : Disables the load of pulse audio libraries (libpulse and libpulse-simple), both the native library and the x86 library
2020-10-14 07:29:59 +00:00
2020-12-04 18:52:10 +00:00
#### BOX86_NOGTK
2021-01-14 20:12:02 +00:00
Disables the loading of wrapped GTK libraries.
* 0 : Load wrapped GTK libraries if found. (Default.)
* 1 : Disables loading wrapped GTK libraries (can be used with Steam, along with STEAM_RUNTIME=1 to use the i386 version of GTK).
2020-12-04 18:52:10 +00:00
2021-01-10 10:24:55 +00:00
#### BOX86_NOVULKAN
2021-01-14 20:12:02 +00:00
Disables the load of vulkan libraries.
* 0 : Load vulkan libraries if found.
* 1 : Disables the load of vulkan libraries, both the native and the i386 version (can be useful on Pi4, where the vulkan driver is not quite there yet.)
2021-01-10 10:24:55 +00:00
2020-06-14 11:16:57 +00:00
#### BOX86_FIX_64BIT_INODES
2021-01-12 21:34:08 +00:00
Fix/Don't fix 64bit inodes
2021-01-14 20:12:02 +00:00
* 0 : Don't fix 64bit inodes. (Default.)
* 1 : Fix 64bit inodes. Helps when running on Filesystems with 64bit inodes. Is useful when a program uses API functions which doesn't support it and the program doesn't use inodes information.
2020-06-14 11:16:57 +00:00
2020-09-21 07:41:20 +00:00
#### BOX86_JITGDB
2021-01-12 21:34:08 +00:00
2021-01-14 20:12:02 +00:00
* 0 : Just print the Segfault message on segfault (default)
* 1 : Launch `gdb` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process and go in an endless loop, waiting.
When in gdb, you need to find the correct thread yourself (the one with `my_box86signalhandler` in is stack)
then probably need to `finish` 1 or 2 functions (inside `usleep(..)` ) and then you'll be in `my_box86signalhandler` ,
just before the printf of the Segfault message. Then simply
`set waiting=0` to exit the infinite loop.
* 2 : Launch `gdbserver` when a segfault, bus error or illegal instruction signal is trapped, attached to the offending process, and go in an endless loop, waiting.
Use `gdb /PATH/TO/box86` and then `target remote 127.0.0.1:1234` to connect to the gdbserver (or use actual IP if not on the machine). After that, the procedure is the same as with ` BOX86_JITGDB=1` .
This mode can be usefullwhen programs redirect all console output to a file (like Unity3D Games)