about summary refs log tree commit diff stats
path: root/docs
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-11-27 18:50:47 +0100
committerptitSeb <sebastien.chev@gmail.com>2022-11-27 18:50:47 +0100
commit06851f8b984574cd1532191feca9765ea07904c0 (patch)
treef389096a5bab95f8d4b7cd2be3595d7fac0cd45f /docs
parent893fc7c9402dac4bd8c1dd2cbdd42752c59012bd (diff)
downloadbox64-06851f8b984574cd1532191feca9765ea07904c0.tar.gz
box64-06851f8b984574cd1532191feca9765ea07904c0.zip
Added box64rc configuration file handling
Diffstat (limited to 'docs')
-rw-r--r--docs/README.md9
-rwxr-xr-xdocs/USAGE.md88
2 files changed, 55 insertions, 42 deletions
diff --git a/docs/README.md b/docs/README.md
index d3a77980..ea1c5b4e 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -58,6 +58,15 @@ Note that many installer (mojo setup based) will fall back to "x86" when detecti
 

 ----

 

+Notes about Box64 configuration

+----

+

+Box64 now have configurations files. There are 2 files loaded. `/etc/box4.box64rc` and `~/.box64rc`. Both files have the same syntax, and is basicaly an ini files. Section in square brakets define the process name, and the rest is the env. var. to set. Looke at [Usage](USAGE.md) for detail on what parameters can be put. Box64 comes with a default file that should be installed for better stability. The file in in `system/box64.box64rc` and should be installed to `/etc/box64.box64rc` If, for some reasons, you don't want to install that file here, at least copy it to `~/.box64rc` or some game may not function correctly.

+Note that the priority is: `~/.bashrc` > `/etc/box64.box64rc` > command line

+So, your settings in `~/.bashrc` may override the setting from your command line...

+

+----

+

 Notes about Unity game emulation

 ----

 

diff --git a/docs/USAGE.md b/docs/USAGE.md
index 606c6707..cb11e7aa 100755
--- a/docs/USAGE.md
+++ b/docs/USAGE.md
@@ -3,15 +3,16 @@ Usage
 ----

 

 There are many environment variables to control Box64 behaviour. 

+Env. var with * can also be put inside box64rc files

 

-#### BOX64_LOG

+#### BOX64_LOG *

 Controls the Verbosity level of the logs

  * 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).

  * 3: DUMP : All DEBUG plus DUMP of all ELF Info.

 

-#### BOX64_ROLLING_LOG

+#### BOX64_ROLLING_LOG *

 Show last few wrapped function call when a Signal is caught

  * 0: No last function call printed (Default.)

  * 1: Last 16 wrapped functions calls printed when a signal is printed. Incompatible with BOX64_LOG>1 (may need BOX64_SHOWSEGV=1 also)

@@ -22,146 +23,146 @@ Disables Box64 printing its version and build
  * 0 : Enable printing its banner. (Default.)

  * 1 : Disable printing its banner. 

 

-#### BOX64_LD_LIBRARY_PATH

+#### BOX64_LD_LIBRARY_PATH *

 Path to look for x86_64 libraries. Default is current folder and `lib` in current folder.

 Also, `/usr/lib/x86_64-linux-gnu` and `/lib/x86_64-linux-gnu` are added if they exist.

 

-#### BOX64_PATH

+#### BOX64_PATH *

 Path to look for x86_64 executable. Default is current folder and `bin` in current folder.

 

-#### BOX64_DLSYM_ERROR

+#### BOX64_DLSYM_ERROR *

 Enables/Disables the logging of `dlsym` errors.

  * 0 : Don't log `dlsym` errors. (Default.)

  * 1 : Log dlsym errors.

 

-#### BOX64_TRACE_FILE

+#### BOX64_TRACE_FILE *

 Send all log and trace to a file instead of `stdout`

 Also, if name contains `%pid` then this is replaced by the actual PID of box64 instance

 End the filename with `+` to have thetrace appended instead of overwriten

 Use `stderr` to use this instead of default `stdout` 

 

-#### BOX64_TRACE

+#### BOX64_TRACE *

 Only on build with trace enabled. Trace allow the logging of all instruction executed, along with register dump

  * 0 : No trace. (Default.) 

  * 1 : Trace enabled. Trace start after the initialisation of all depending libraries is done.

  * symbolname : Trace only `symbolname` (trace is disable if the symbol is not found).

  * 0xXXXXXXX-0xYYYYYYY : Trace only between the 2 addresses.

 

-#### BOX64_TRACE_INIT

+#### BOX64_TRACE_INIT *

 Use BOX64_TRACE_INIT instead of BOX_TRACE to start trace before the initialisation of libraries and the running program

  * 0 : No trace. (Default.)

  * 1 : Trace enabled. The trace start with the initialisation of all depending libraries is done.

 

-#### BOX64_TRACE_START

+#### BOX64_TRACE_START *

 Only on builds with trace enabled.

  * NNNNNNN : Start trace only after NNNNNNNN opcode execute (number is an `uint64_t`).

 

-#### BOX64_TRACE_XMM

+#### BOX64_TRACE_XMM *

 Only on builds with trace enabled.

  * 0 : The XMM (i.e. SSE/SSE2) register will not be logged with the general and x86 registers. (Default.)

  * 1 : Dump the XMM registers.

 

-#### BOX64_TRACE_EMM

+#### BOX64_TRACE_EMM *

 Only on builds with trace enabled.

- * 0 : The EMM (i.e. XMM/x87) register will not be logged with the general and x86 registers. (Default.)

+ * 0 : The EMM (i.e. MMX) register will not be logged with the general and x86 registers. (Default.)

  * 1 : Dump the EMM registers.

 

-#### BOX64_TRACE_COLOR

+#### BOX64_TRACE_COLOR *

 Only on builds with trace enabled.

  * 0 : The general registers will always be the default white color. (Default.)

  * 1 : The general registers will change color in the dumps when they changed value.

 

-#### BOX64_LOAD_ADDR

+#### BOX64_LOAD_ADDR *

 Try to load at 0xXXXXXX main binary (if binary is a PIE)

  * 0xXXXXXXXX : The load address . (Only active on PIE programs.)

 

-#### BOX64_NOSIGSEGV

+#### BOX64_NOSIGSEGV *

 Disable handling of SigSEGV. (Very useful for debugging.)

  * 0 : Let the x86 program set sighandler for SEGV (Default.)

  * 1 : Disable the handling of SigSEGV.

 

-#### BOX64_NOSIGILL

+#### BOX64_NOSIGILL *

 Disable handling of SigILL (to ease debugging mainly).

  * 0 : Let x86 program set sighandler for Illegal Instruction

  * 1 : Disables the handling of SigILL 

 

-#### BOX64_SHOWSEGV

+#### BOX64_SHOWSEGV *

 Show Segfault signal even if a signal handler is present

  * 0 : Don"t force show the SIGSEGV analysis (Default.)

  * 1 : Show SIGSEGV detail, even if a signal handler is present

 

-#### BOX64_SHOWBT

+#### BOX64_SHOWBT *

 Show some Backtrace (Nativ e and Emulated) whgen a signal (SEGV, ILL or BUS) is caught

  * 0 : Don"t show backtraces (Default.)

  * 1 : Show Backtrace detail (for native, box64 is rename as the x86_64 binary run)

 

-#### BOX64_X11THREADS

+#### BOX64_X11THREADS *

 Call XInitThreads when loading X11. (This is mostly for old Loki games with the Loki_Compat library.)

  * 0 : Don't force call XInitThreads. (Default.)

  * 1 : Call XInitThreads as soon as libX11 is loaded.

 

-#### BOX64_X11GLX

+#### BOX64_X11GLX *

 Force libX11's GLX extension to be present.

 * 0 : Do not force libX11's GLX extension to be present. 

 * 1 : GLX will always be present when using XQueryExtension. (Default.)

 

-#### BOX64_DYNAREC_DUMP

+#### BOX64_DYNAREC_DUMP *

 Enables/disables Box64's Dynarec's dump.

  * 0 : Disable Dynarec's blocks dump. (Default.)

  * 1 : Enable Dynarec's blocks dump.

  * 2 : Enable Dynarec's blocks dump with some colors.

 

-#### BOX64_DYNAREC_LOG

+#### BOX64_DYNAREC_LOG *

 Set the level of DynaRec's logs.

  * 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.

 

-#### BOX64_DYNAREC

+#### BOX64_DYNAREC *

 Enables/Disables Box64's Dynarec.

  * 0 : Disables Dynarec.

  * 1 : Enable Dynarec. (Default.)

 

-#### BOX64_DYNAREC_TRACE

+#### BOX64_DYNAREC_TRACE *

 Enables/Disables trace for generated code.

  * 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).

 

-#### BOX64_NODYNAREC 

+#### BOX64_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)

 

-#### BOX64_DYNAREC_BIGBLOCK

+#### BOX64_DYNAREC_BIGBLOCK *

 Enables/Disables Box64's Dynarec building BigBlock.

  * 0 : Don't try to build block as big as possible (can help program using lots of thread and a JIT, like C#/Unity) (Default when libmonobdwgc-2.0.so is loaded)

  * 1 : Build Dynarec block as big as possible (Default.)

  * 2 : Build Dynarec block bigger (don't stop when block overlaps, but only for blocks in elf memory)

  * 3 : Build Dynarec block bigger (don't stop when block overlaps, for all type of memory)

 

-#### BOX64_DYNAREC_STRONGMEM

+#### BOX64_DYNAREC_STRONGMEM *

 Enable/Disable simulation of Strong Memory model

 * 0 : Don't try anything special (Default.)

 * 1 : Enable some Memory Barrier when reading from memory (on some MOV opcode) to simulate Strong Memory Model while trying to limit performance impact (Default when libmonobdwgc-2.0.so is loaded)

-* 2 : Enable some Memory Barrier when reading from memory (on some MOV opcode) to simulate Strong Memory Model (enabled with dota2 is detected)

+* 2 : Enable some Memory Barrier when reading from memory (on some MOV opcode) to simulate Strong Memory Model

 

-#### BOX64_DYNAREC_X87DOUBLE

+#### BOX64_DYNAREC_X87DOUBLE *

 Force the use of Double for x87 emulation

 * 0 : Try to use float when possible for x87 emulation (default, faster)

 * 1 : Only use Double for x87 emulation (slower, may be needed for some specific games, like Crysis)

 

-#### BOX64_DYNAREC_FASTNAN

+#### BOX64_DYNAREC_FASTNAN *

 Enable/Disable generation of -NAN

 * 0 : Generate -NAN like on x86

 * 1 : Don't do anything special with NAN, to go as fast as possible (default)

 

-#### BOX64_DYNAREC_SAFEFLAGS

+#### BOX64_DYNAREC_SAFEFLAGS *

 Handling of flags on CALL/RET opcodes

 * 0 : Treat CALL/RET as if it never needs any flags (faster but not advised)

 * 1 : most of RET will need flags, most of CALLS will not (Default)

 * 2 : All CALL/RET will need flags (slower, but might be needed. Automatically enabled for Vara.exe)

 

-#### BOX64_LIBGL

+#### BOX64_LIBGL *

  * libXXXX set the name for libGL (defaults to libGL.so.1).

  * /PATH/TO/libGLXXX : Sets the name and path for libGL

  You can also use SDL_VIDEO_GL_DRIVER

@@ -170,47 +171,47 @@ Handling of flags on CALL/RET opcodes
  * 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

  

-#### BOX64_EMULATED_LIBS

+#### BOX64_EMULATED_LIBS *

  * XXXX[:YYYYY] force lib XXXX (and YYYY...) to be emulated (and not wrapped)

 Some games uses an old version of some libraries, with an ABI incompatible with native version.

 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

 

-#### BOX64_ALLOWMISSINGLIBS

+#### BOX64_ALLOWMISSINGLIBS *

 Allow Box64 to continue even if a library is missing.

  * 0 : Box64 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.

 

-#### BOX64_PREFER_WRAPPED

+#### BOX64_PREFER_WRAPPED *

 Box64 will use wrapped libs even if the lib is specified with absolute path

  * 0 : Try to use emulated libs when they are defined with absolute path  (Default.)

  * 1 : Use Wrapped native libs even if path is absolute

 

-#### BOX64_PREFER_EMULATED

+#### BOX64_PREFER_EMULATED *

 Box64 will prefer emulated libs first (execpt for glibc, alsa, pulse, GL, vulkan and X11

  * 0 : Native libs are prefered (Default.)

  * 1 : Emulated libs are prefered (Default for program running inside pressure-vessel)

 

-#### BOX64_CRASHHANDLER

+#### BOX64_CRASHHANDLER *

 Box64 will use a dummy crashhandler.so library

  * 0 : Use Emulated crashhandler.so library if needed

  * 1 : Use an internal dummy (completly empty) crashhandler.so library (defaut for steam and dota2)

 

-#### BOX64_NOPULSE

+#### BOX64_NOPULSE *

 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

 

-#### BOX64_NOGTK

+#### BOX64_NOGTK *

 Disables the loading of wrapped GTK libraries.

  * 0 : Load wrapped GTK libraries if found. (Default.)

  * 1 : Disables loading wrapped GTK libraries.

 

-#### BOX64_NOVULKAN

+#### BOX64_NOVULKAN *

 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.)

 

-#### BOX64_BASH

+#### BOX64_BASH *

 Define x86_64 bash to launch script

  * yyyy

  Will use yyyy as x86_64 bash to launch script. yyyy needs to be a full path to a valid x86_64 version of bash

@@ -223,7 +224,7 @@ Define x86_64 bash to launch script
  * XXX=yyyy

  will add XXX=yyyy env. var. and continue with BOX86_ENV2 ... until var doesn't exist

 

-#### BOX64_JITGDB

+#### BOX64_JITGDB *

  * 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_box64signalhandler` in is stack)

@@ -233,3 +234,6 @@ Define x86_64 bash to launch script
  * 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/box64` 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 ` BOX64_JITGDB=1`.

  This mode can be usefullwhen programs redirect all console output to a file (like Unity3D Games)

+

+#### BOX64_NORCFILES

+If the env var exist, no rc files (like /etc/box64.box64rc and ~/.box64rc) will be loaded