Merge pull request #504 from Seas0/master

[DOC] Chinese doc and some typo fix
This commit is contained in:
ptitSeb 2021-11-20 10:45:43 +01:00 committed by GitHub
commit 3ca24bd45c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 142 additions and 7 deletions

View File

@ -7,6 +7,8 @@ Linux Userspace x86 Emulator with a twist
----
[中文](README_CN.md)
Compiling/Installation
----
> Compilation instructions can be found [here](COMPILE.md)
@ -14,9 +16,9 @@ Compiling/Installation
Box86 lets you run x86 Linux programs (such as games) on non-x86 Linux systems, like ARM (host system needs to be 32bit little-endian).
You *NEED* a 32-bit subsystem to run and build Box86. Box86 is useless on 64-bit only systems. Also, you *NEED* a 32-bit toolchain to build Box86. A toolchain that only supports 64-bit will not compile Box86, and you'll get errors (typically on aarch64, you get "-marm" not recognized, and you'll need a multiarch or chroot environnement).
You *NEED* a 32-bit subsystem to run and build Box86. Box86 is useless on 64-bit only systems. Also, you *NEED* a 32-bit toolchain to build Box86. A toolchain that only supports 64-bit will not compile Box86, and you'll get errors (typically on aarch64, you get "-marm" not recognized, and you'll need a multiarch or chroot environment).
Because Box86 uses the native versions of some "system" libraries, like libc, libm, SDL, and OpenGL, it's easy to integrate and use with most applications, and performance can be surprisingly high in many cases. Take a look at thoses bench analysis for an example [here](https://box86.org/index.php/2021/06/game-performances/).
Because Box86 uses the native versions of some "system" libraries, like libc, libm, SDL, and OpenGL, it's easy to integrate and use with most applications, and performance can be surprisingly high in many cases. Take a look at those bench analysis for an example [here](https://box86.org/index.php/2021/06/game-performances/).
Most x86 Games need OpenGL, so on ARM platforms a solution like [gl4es](https://github.com/ptitSeb/gl4es) is usually necessary. (Most ARM platforms only support OpenGL ES and/or their OpenGL implementation is dodgy (see OpenGL on Android).)
@ -87,10 +89,10 @@ Notes about Steam
Linux Steam's can run now with box86. But it's still a bit unstable, and not everything works:
- First problem is Steam crashing after the sign-in window, if you encounter this issue, you may need to add libappindicator. To install it on Debian, run `sudo apt install libappindicator1`.
- If you select to "Remember password", Steam is crashing on subsequent starts, unless you have libnm intalled. To install it on Debian, run `sudo apt install libnm0`.
- If you select to "Remember password", Steam is crashing on subsequent starts, unless you have libnm installed. To install it on Debian, run `sudo apt install libnm0`.
- Once open, Steam will only work on "Small Mode" and in "Big Picture", not in the regular "Large Mode". This is because some Steam components used in the browser view are only 64-bit now. So go in the "View" menu and switch to "Small view", else the list will stay empty. Alternatively, Steam can be started in small mode directly by using `+open steam://open/minigameslist` command line arguments.
- To avoid the "libc.so.6 is absent" message, you can use `STEAMOS=1` and `STEAM_RUNTIME=1` as environment variables.
- Some Steam games (most Source engine games, like "Portal" or "Half-Life 2") use libtcmalloc. Box86 will detect it and will try to LD_PRELOAD it, for better compatibility. While it should work without the aformentionned feature, it is safer to add it to your system if you intend to play those game. To install it on Debian, run `sudo apt install libtcmalloc-minimal4`.
- Some Steam games (most Source engine games, like "Portal" or "Half-Life 2") use libtcmalloc. Box86 will detect it and will try to LD_PRELOAD it, for better compatibility. While it should work without the aforementioned feature, it is safer to add it to your system if you intend to play those game. To install it on Debian, run `sudo apt install libtcmalloc-minimal4`.
Steam for Windows installs fine but doesn't work yet.
@ -107,19 +109,19 @@ Note: if you plan to use box86 with Wine on Raspberry Pi 3 or earlier, those mod
Notes about Vulkan
----
Box86 already wrap vulikan. If your system has a 32bits vulkan driver, box86 will use it when needed. Note that vulkan wrapping has not been tested much, due to the limited vulkan support on the hardware I currently own. Profile 1.0 and 1.1, whith some extension, should be OK. 1.2 is not really wrapped. I know some demos work on Pi4 (Sascha Willems demos build for x86 work the same as if build on armhf directly). Note that the Vulkan driver of the Pi4 DOES NOT support dxvk for now (wine DirectX->Vulkan wrapper). It's not a box86 issue, it's missing extensions (hardxware support) and a few other things that make dxvk not working on pi4. On Panfrost side, PanVK is a bit young and I haven't tested dxvk with it yet.
Box86 already wrap Vulkan. If your system has a 32bits Vulkan driver, box86 will use it when needed. Note that Vulkan wrapping has not been tested much, due to the limited Vulkan support on the hardware I currently own. Profile 1.0 and 1.1, with some extension, should be OK. 1.2 is not really wrapped. I know some demos work on Pi4 (Sascha Willems demos build for x86 work the same as if build on armhf directly). Note that the Vulkan driver of the Pi4 DOES NOT support dxvk for now (wine DirectX->Vulkan wrapper). It's not a box86 issue, it's missing extensions (hardware support) and a few other things that make dxvk not working on pi4. On Panfrost side, PanVK is a bit young and I haven't tested dxvk with it yet.
----
Final word
----
I want to thank everyone who has contributed to box86 developpement.
I want to thank everyone who has contributed to box86 development.
There are many ways to contribute: code, financial, hardware and advertisement!
So, in no particular order, I want to thank:
* For their major code contribution: rajdakin, icecream95, M-HT
* For their major financial contribution: FlyingFathead, stormchaser3000
* For their hardware contribution: [Radxa](https://rockpi.org/), [Pine64](https://www.pine64.org/), [DragonBox](https://pyra-handheld.com/), [Novaspirit](https://www.youtube.com/channel/UCrjKdwxaQMSV_NDywgKXVmw), [HardKernel](https://www.hardkernel.com/), [TwisterOS team](https://twisteros.com/)
* For their continous advertisement of box86 project: salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS team](https://twisteros.com/), [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg)
* For their continuous advertisement of box86 project: salva ([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS team](https://twisteros.com/), [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg)
And I also thank the many other people who participated even once in the project.

133
docs/README_CN.md Normal file
View File

@ -0,0 +1,133 @@
# box86
![Official logo](img/Box86Logo.png "Official Logo")
Linux上用户空间的x86应用模拟器
[![Build Status](https://app.travis-ci.com/ptitSeb/box86.svg?branch=master)](https://app.travis-ci.com/ptitSeb/box86)
----
[English](README.md)
编译与安装
----
> [这里](COMPILE.md)有编译Box86的指南
> [这里](X86WINE.md)有为Box86安装Wine的指南
在ARM或其他非x86架构的Linux操作系统上使用Box86可以运行x86 Linux程序例如游戏请注意主机系统需要是**32位小端**的。
你需要一个**32位**的子系统来运行Box86因为Box86在纯64位系统上无法使用同时你也需要一个**32位**的Linux编译工具链来编译Box86例如**arm-linux-gnueabihf-gcc** 否则你将无法编译Box86 一般的64位ARM编译工具链如 aarch64-linux-gnu-gcc 不支持"-marm"编译选项,会编译失败并报错)。
因为Box86使用了一些“系统”库的原生版本例如libc、libm、SDL和OpenGL所以它很容易与大多数应用程序集成和使用并且在很多情况下性能会出奇的高。点击[此处](https://box86.org/index.php/2021/06/game-performances/)查看示例的基准测试分析。
大多数x86游戏都用到了OpenGL所以在ARM平台上类似于[gl4es](https://github.com/ptitSeb/gl4es)的解决方案通常是必要的。许多ARM平台仅提供OpenGL ES支持又或者他们的OpenGL实现很不可靠例如Android上的OpenGL
Box86为ARM平台集成了DynaRec动态重编译器比仅使用解释器提升5到10倍性能。关于Dynarec如何工作的更多信息可以在[这里](https://box86.org/2021/07/inner-workings-a-high%e2%80%91level-view-of-box86-and-a-low%e2%80%91level-view-of-the-dynarec/)找到。
许多游戏已经可以在不做多少改动的情况下直接运行,例如:《粘粘世界》(WorldOfGoo)、《航空大亨豪华版》(Airline Tycoon Deluxe)、《超越光速》(FTL)等而且许多基于GameMaker的游戏也跑得很好例如《传说之下》(UNDERTALE)等)。
如果你想开发Box86最好安装ccache因为它可以提高编译速度并且可以让你的编译结果可以被缓存以便下次编译时可以直接使用。
如果你需要启用Trace跟踪例如输出寄存器值与各条被执行的x86指令你也需要安装[Zydis](https://github.com/zyantific/zydis)。
一些x86内部操作码使用“Realmode X86 Emulator Library”的部分内容请参阅[x86primop.c](../src/emu/x86primop.c)了解版权详情
----
一些示例视频
----
[![Play on Youtube](https://img.youtube.com/vi/bLt0hMoFDLk/3.jpg)](https://www.youtube.com/watch?v=bLt0hMoFDLk) [![Play on Youtube](https://img.youtube.com/vi/MM7kWYts7IA/3.jpg)](https://www.youtube.com/watch?v=MM7kWYts7IA) [![Play on Youtube](https://img.youtube.com/vi/8hr71S029Hg/1.jpg)](https://www.youtube.com/watch?v=8hr71S029Hg) [![Play on Youtube](https://img.youtube.com/vi/B4YN37z3-ws/1.jpg)](https://www.youtube.com/watch?v=B4YN37z3-ws) [![Play on Youtube](https://img.youtube.com/vi/xk8Q30mxqPg/1.jpg)](https://www.youtube.com/watch?v=xk8Q30mxqPg) [![Play on Youtube](https://img.youtube.com/vi/_QMRMVvYrqU/1.jpg)](https://www.youtube.com/watch?v=_QMRMVvYrqU)
在这两个频道可以找到更多Box86的相关视频 [MicroLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ), [Pi Labs](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g) or [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA)
<img src="img/Box86Icon.png" width="96" height="96">
Logo和图标由grayduck制作感谢!
注意:
不要把本项目和[86box](https://github.com/86Box/86Box)搞混了,后者是一个"**全量**"的x86 PC模拟器。
----
使用方法
----
有若干环境变量可以设置Box86的行为。
点击[这里](USAGE.md)了解所有的环境变量和它们的作用。
请注意Box86的Dynarec提供了一种包含"内存保护"和段错误信号处理程序的机制来处理JIT代码。简单地说如果你想用GDB来调试一个使用JIT代码的运行程序比如mono/Unity3D就会触发很多“正常”的段错误。建议在GDB中使用类似于`handle SIGSEGV nostop`的东西,不要在每个段错误时都停止,如果你想捕获段错误,可以在`signals.c`中的`my_memprotectionhandler`中放置一个断点。
----
版本历史
----
版本日志在[这里](CHANGELOG.md)。
----
关于64位平台的注意事项
----
Box86的工作原理是直接将函数调用从x86_转换到主机系统主机系统Box86运行的系统需要有32位的库。Box86并不包括任何64位<->32位的转换。所以如果你需要在64位平台上运行Box86那么你需要建立一个32位的库环境并以32位ARM为目标系统编译Box86例如使用arm-linux-gnueabihf-gcc工具链交叉编译或直接在armhf chroot环境中编译运行
如果你需要运行64位应用请考虑使用[Box64](https://github.com/ptitSeb/box64)它可以在64位平台上运行x86_64程序但请再一次注意运行x86程序需要Box86与32位库环境就像在x86_64的Linux上运行x86程序需要x86 multiarch库一样
----
关于Unity游戏模拟的注意事项
----
当前Unity游戏模拟是一件碰运气的事情。Unity使用Mono它使用的信号还没有被完美模拟。理论上可以使用原生Mono库在[这里](https://github.com/Unity-Technologies/mono)可以找到但Mono的封装比较麻烦目前没完成所以我们使用了模拟的Mono库目前Mono的JIT动态编译代码已由"内存保护"(Protected memory)机制实现,应该能正常运行。
同时一些Unity3D游戏需要OpenGL 3+目前在ARM SBC单板计算机上提供OpenGL 3+是很棘手的。
所以并不是所有的Unity游戏都能运行尤其是那些需要提供很高的OpenGL配置3.2+)的游戏更有可能不行,但除此之外应该问题不大,而且能运行的游戏的性能应该不错。
提示如果游戏开始后在显示任何东西之前退出在Pi4上使用`MESA_GL_VERSION_OVERRIDE=3.2`在Panfrost上使用`PAN_MESA_DEBUG=gl3`来使用更高的配置文件。
----
关于Steam的注意事项
----
Linux Steam 现在可以在Box86上运行但还是有点不稳定而且有些功能可能不正常
- 如果Steam在显示登录界面后崩溃你可能需要安装libappindicator库例如运行`sudo apt install libappindicator1`。
- 如果你选择记住密码而Steam在下次启动时崩溃你可能需要安装libnm库例如运行`sudo apt install libnm0`。
- Steam不能在正常的大界面模式下工作因为Steam在浏览器模式使用的一些组件只能在64位平台上运行。所以请在查看选项卡中选择"小模式"否则Steam将无法正常显示列表。或者在启动Steam添加`+open steam://open/minigameslist`参数这样Steam将会直接在小模式下启动。
- 为了避免"libc.so.6 is absent"的错误,请添加环境变量`STEAMOS=1` 与 `STEAM_RUNTIME=1`
- 一些游戏例如基于起源引擎的游戏《传送门》、《半衰期2》使用了libtcmalloc库Box86会尝试检测它们并通过LD_PRELOAD预加载它们来获得更好的兼容性虽然应该可以在没有上述功能的情况下工作但保险起见我们还是建议你安装它例如运行`sudo apt install libtcmalloc-minimal4`。
Windows Steam 可以安装但目前不能运行。
----
关于Wine的注意事项
----
Box86现在已经支持Wine。Wine的内建程序全部能运行许多Windows 程序和游戏也运行良好。但是不要忘记大多数 Windows 游戏都使用 Direct3D这可能需要完整的 OpenGL 驱动程序和尽可能高的配置文件(基于 ES2 后端的 gl4es 现在不能运行 Wine 的Direct3D组件
注意:如果你想在 Raspberry Pi 3 或更早版本上用 Box86 运行 Wine由于这些设备的内核默认使用 2G/2G 虚拟内存分配2G 空间用于用户态程序2G 空间用于内核),与需要访问内存地址 > 2G 的 Wine 程序不兼容。 因此,你需要重新配置内核以使用 3G/1G 的内存分配方式。
----
关于Vulkan的注意事项
----
Box86已经封装了Vulkan。如果设备的系统有32位的Vulkan驱动程序Box86会在需要时使用它。但请注意由于作者目前拥有的硬件上的Vulkan支持有限因此Vulkan封装库尚未经过太多测试。 Vulkan 1.0、1.1与一些扩展应该能工作。 但Vulkan 1.2并没有被实现。现在已经有一些工作在树莓派4上的Vulkan演示 Sascha Willems 的演示中为x86构建的demo与与直接为armhf构建的demo工作一致。 请注意Pi4的Vulkan驱动程序目前不支持 dxvkwine DirectX->Vulkan 兼容层。这不是Box86的问题而是由于缺少扩展硬件支持和其他一些使dxvk无法在Pi4上工作的东西。在Panfrost上PanVK还不成熟暂时没有用它测试dxvk。
----
结语
----
我要感谢所有为 box86 开发做出贡献的人。
贡献方式有很多种:代码贡献、财务帮助、捐赠捐赠和广告合作!
以下感谢不分先后:
* 代码贡献rajdakin, icecream95, M-HT
* 财务帮助FlyingFathead, stormchaser3000
* 硬件捐赠:[Radxa](https://rockpi.org/), [Pine64](https://www.pine64.org/), [DragonBox](https://pyra-handheld.com/), [Novaspirit](https://www.youtube.com/channel/UCrjKdwxaQMSV_NDywgKXVmw), [HardKernel](https://www.hardkernel.com/), [TwisterOS team](https://twisteros.com/)
* 为本项目持续的宣传:([microLinux](https://www.youtube.com/channel/UCwFQAEj1lp3out4n7BeBatQ)), [PILab](https://www.youtube.com/channel/UCgfQjdc5RceRlTGfuthBs7g)/[TwisterOS team](https://twisteros.com/), [The Byteman](https://www.youtube.com/channel/UCEr8lpIJ3B5Ctc5BvcOHSnA), [NicoD](https://www.youtube.com/channel/UCpv7NFr0-9AB5xoklh3Snhg)
我还要感谢很多人,即使他们只参与了一次本项目。
(如果你的项目中使用了Box86请不要忘记提及)