Translation

(itstool) path: sect1/para
English
It operates by intercepting system calls, or requests from the software to the operating system, and translating them from <trademark class="registered">Windows</trademark> calls to calls that FreeBSD understands. It will also translate any responses as needed into what the <trademark class="registered">Windows</trademark> software is expecting. So in some ways, it <emphasis>emulates</emphasis> a <trademark class="registered">Windows</trademark> environment, in that it provides many of the resources <trademark class="registered">Windows</trademark> applications are expecting.
0/5820
Context English Chinese (Simplified) (zh_CN) State
<primary>Solaris</primary> <primary>Solaris</primary>
For the <trademark class="registered">Linux</trademark> <acronym>ABI</acronym> support, FreeBSD sees the magic number as an ELF binary. The ELF loader looks for a specialized <emphasis>brand</emphasis>, which is a comment section in the ELF image, and which is not present on SVR4/<trademark>Solaris</trademark> ELF binaries. 为了支持 <trademark class="registered">Linux</trademark> <acronym>ABI</acronym>, FreeBSD 看到了二进制 ELF 程序的魔数。 ELF 加载器会查找一个专用的 <emphasis>标记</emphasis>, 那是在 ELF 镜像中的一个注释部分, 此区域在 SVR4/<trademark>Solaris</trademark> ELF 二进制中并不存在。
For <trademark class="registered">Linux</trademark> binaries to function, they must be <emphasis>branded</emphasis> as type <literal>Linux</literal> using <citerefentry><refentrytitle>brandelf</refentrytitle><manvolnum>1</manvolnum></citerefentry>: 要运行 <trademark class="registered">Linux</trademark> 二进制程序, 必须先使用 <citerefentry><refentrytitle>brandelf</refentrytitle><manvolnum>1</manvolnum></citerefentry> 命令 <emphasis>标记</emphasis> 为 <literal>Linux</literal> 类型:
<prompt>#</prompt> <userinput>brandelf -t Linux file</userinput> <prompt>#</prompt> <userinput>brandelf -t Linux file</userinput>
<primary>ELF</primary> <secondary>branding</secondary> <primary>ELF</primary> <secondary>标记</secondary>
When the ELF loader sees the <literal>Linux</literal> brand, the loader replaces a pointer in the <literal>proc</literal> structure. All system calls are indexed through this pointer. In addition, the process is flagged for special handling of the trap vector for the signal trampoline code, and several other (minor) fix-ups that are handled by the <trademark class="registered">Linux</trademark> kernel module. 当 ELF 加载器看到了 <literal>Linux</literal> 标记,便会替换 <literal>proc</literal> 结构中的一个指针。 所有的系统调用都通过此指针来索引。 除此以外, 进程被标记以便对 signal trampoline 代码的陷阱向量做特殊处理, 还有一些其他由 <trademark class="registered">Linux</trademark> 内核模块来处理的(细微)修补。
The <trademark class="registered">Linux</trademark> system call vector contains, among other things, a list of <literal>sysent[]</literal> entries whose addresses reside in the kernel module. <trademark class="registered">Linux</trademark> 系统调用向量包含一个 <literal>sysent[]</literal> 记录的列表, 它的地址位于内核模块之中。
When a system call is called by the <trademark class="registered">Linux</trademark> binary, the trap code dereferences the system call function pointer off the <literal>proc</literal> structure, and gets the <trademark class="registered">Linux</trademark>, not the FreeBSD, system call entry points. 当一个系统调用被 <trademark class="registered">Linux</trademark> 二进制程序调用时, 陷阱代码会把系统调用函数指针从 <literal>proc</literal> 解引用至 <trademark class="registered">Linux</trademark> 而不是 FreeBSD 的系统调用入口。
<trademark class="registered">Linux</trademark> mode dynamically <emphasis>reroots</emphasis> lookups. This is, in effect, equivalent to <option>union</option> to file system mounts. First, an attempt is made to lookup the file in <filename>/compat/linux/<replaceable>original-path</replaceable></filename>. If that fails, the lookup is done in <filename>/<replaceable>original-path</replaceable></filename>. This makes sure that binaries that require other binaries can run. For example, the <trademark class="registered">Linux</trademark> toolchain can all run under <trademark class="registered">Linux</trademark> <acronym>ABI</acronym> support. It also means that the <trademark class="registered">Linux</trademark> binaries can load and execute FreeBSD binaries, if there are no corresponding <trademark class="registered">Linux</trademark> binaries present, and that a <citerefentry><refentrytitle>uname</refentrytitle><manvolnum>1</manvolnum></citerefentry> command can be placed in the <filename>/compat/linux</filename> directory tree to ensure that the <trademark class="registered">Linux</trademark> binaries cannot tell they are not running on <trademark class="registered">Linux</trademark>. <trademark class="registered">Linux</trademark> 模式会动态地 <emphasis>reroots</emphasis> 查找。 这与 <option>union</option> 文件系统选项是等效的。 首先会试图在 <filename class="directory">/compat/linux/<replaceable>original-path</replaceable></filename> 目录查找文件。 如果失败了, 就会在 <filename class="directory">/<replaceable>original-path</replaceable></filename> 目录下查找。 这使得需要其它程序的程序得以运行。 例如,<trademark class="registered">Linux</trademark> 工具链都可以在 <trademark class="registered">Linux</trademark> <acronym>ABI</acronym> 的支持下运行。 也就是说 <trademark class="registered">Linux</trademark> 二进制程序可以加载并执行 FreeBSD 二进制程序, 如果当前没有相应的 <trademark class="registered">Linux</trademark> 二进制程序, 可以在 <filename>/compat/linux</filename> 目录树中放置一个 <citerefentry><refentrytitle>uname</refentrytitle><manvolnum>1</manvolnum></citerefentry> 命令, 使 <trademark class="registered">Linux</trademark> 程序不易察觉它们并没有运行在 <trademark class="registered">Linux</trademark> 系统上。
In effect, there is a <trademark class="registered">Linux</trademark> kernel in the FreeBSD kernel. The various underlying functions that implement all of the services provided by the kernel are identical to both the FreeBSD system call table entries, and the <trademark class="registered">Linux</trademark> system call table entries: file system operations, virtual memory operations, signal delivery, and System V IPC. The only difference is that FreeBSD binaries get the FreeBSD <emphasis>glue</emphasis> functions, and <trademark class="registered">Linux</trademark> binaries get the <trademark class="registered">Linux</trademark> <emphasis>glue</emphasis> functions. The FreeBSD <emphasis>glue</emphasis> functions are statically linked into the kernel, and the <trademark class="registered">Linux</trademark> <emphasis>glue</emphasis> functions can be statically linked, or they can be accessed via a kernel module. 事实上, 在 FreeBSD 内核中有一个 <trademark class="registered">Linux</trademark> 内核。 所有由内核提供的服务的各种底层功能在 FreeBSD 系统调用表的记录和 <trademark class="registered">Linux</trademark> 系统调用表的记录是一样的: 文件系统操作, 虚拟内存操作, 信号发送, 和 System V IPC。 唯一的不同是 FreeBSD 会得到 FreeBSD 的 <emphasis>glue</emphasis> 功能, 而 <trademark class="registered">Linux</trademark> 程序会得到 <trademark class="registered">Linux</trademark> 的 <emphasis>glue</emphasis> 功能。 FreeBSD 的 <emphasis>glue</emphasis> 功能是静态链接入内核的, 而 <trademark class="registered">Linux</trademark> 的 <emphasis>glue</emphasis> 功能可以静态链接, 或者通过内核模块访问。
Technically, this is not really emulation, it is an <acronym>ABI</acronym> implementation. It is sometimes called <quote><trademark class="registered">Linux</trademark> emulation</quote> because the implementation was done at a time when there was no other word to describe what was going on. Saying that FreeBSD ran <trademark class="registered">Linux</trademark> binaries was not true, since the code was not compiled in. 严格说来其实并没有真正的模拟,这是一种 <acronym>ABI</acronym> 的实现。有时这被称为<quote><trademark class="registered">Linux</trademark> 模拟</quote>是因为在实现的时候还没有其他适合的词用来描述。 要说 FreeBSD 运行<trademark class="registered">Linux</trademark>二进制程序并不确切,因为当时代码并还没有被编译进去。
WINE WINE
<personname> <firstname>Aaron</firstname> <surname>Peters</surname> </personname> <contrib>Contributed by </contrib> <personname> <firstname>Aaron</firstname> <surname>Peters</surname> </personname> <contrib>作者</contrib>
<personname> <firstname>Benedict</firstname> <surname>Reuschling</surname> </personname> <contrib>DocBook markup edits by </contrib> <personname> <firstname>Benedict</firstname> <surname>Reuschling</surname> </personname> <contrib>DocBook 编写者 </contrib>
<link xlink:href="https://www.winehq.org/">WINE</link>, which stands for Wine Is Not an Emulator, is technically a software translation layer. It enables to install and run some software written for <trademark class="registered">Windows</trademark> on FreeBSD (and other) systems. <link xlink:href="https://www.winehq.org/">WINE</link>是一个软翻译层,让 <trademark class="registered">Windows</trademark> 可以运行在 FreeBSD(或其他)操作系统上。
It operates by intercepting system calls, or requests from the software to the operating system, and translating them from <trademark class="registered">Windows</trademark> calls to calls that FreeBSD understands. It will also translate any responses as needed into what the <trademark class="registered">Windows</trademark> software is expecting. So in some ways, it <emphasis>emulates</emphasis> a <trademark class="registered">Windows</trademark> environment, in that it provides many of the resources <trademark class="registered">Windows</trademark> applications are expecting.
However, it is not an emulator in the traditional sense. Many of these solutions operate by constructing an entire other computer using software processes in place of hardware Virtualization (such as that provided by the <package>emulators/qemu</package> port) operates in this way. One of the benefits of this approach is the ability to install a full version of the OS in question to the emulator. It means that the environment will not look any different to applications than a real machine, and chances are good that everything will work on it. The downside to this approach is the fact that software acting as hardware is inherently slower than actual hardware. The computer built in software (called the <emphasis>guest</emphasis>) requires resources from the real machine (the <emphasis>host</emphasis>), and holds on to those resources for as long as it is running.
The WINE Project, on the other hand, is much lighter on system's resources. It will translate system calls on the fly, so while it is difficult to be as fast as a real <trademark class="registered">Windows</trademark> computer, it can come very close. On the other hand, WINE is trying to keep up with a moving target in terms of all the different system calls and other functionality it needs to support. As a result there may be applications that do not work as expected on WINE, will not work at all, or will not even install to begin with.
At the end of the day, WINE provides another option to try to get a particular <trademark class="registered">Windows</trademark> software program running on FreeBSD. It can always serve as the first option which, if successful, offers a good experience without unnecessarily depleting the host FreeBSD system's resources. 最后,WINE 提供了另一个选项来尝试让一个特定的 <trademark class="registered">Windows</trademark> 软件程序在 FreeBSD 上运行。如果成功的话,它可以提供良好的体验,而不会过多的消耗系统资源。
This chapter will describe: 本章将介绍:
How to install WINE on a FreeBSD system. 如何在 FreeBSD 上安装 WINE。
How WINE operates, and how it is different from other alternatives like virtualizaton. WINE是如何运作的,它与其他替代品(如虚拟机)有什么不同。
How to fine-tune WINE to the specific needs of some applications.
How to install GUI helpers for WINE. 如何使用图形工具配置 WINE。
Common tips and solutions for on FreeBSD. FreeBSD 上的常见问题和解决方案。
Considerations for WINE on FreeBSD in terms of the multi-user environment. WINE on FreeBSD 在多用户环境中的注意事项。
Before reading this chapter, it will be useful to: 在阅读这个章节之前,您应当先具备以下知识:
Understand the <link linkend="basics">basics of <trademark class="registered">UNIX</trademark> and FreeBSD</link>. 了解<link linkend="basics"><trademark class="registered">UNIX</trademark>与FreeBSD的基础</link>。
Know how to <link linkend="bsdinstall">install FreeBSD</link>. 知道如何<link linkend="bsdinstall">安装 FreeBSD</link>。
Know how to <link linkend="advanced-networking">set up a network connection</link>. 知道如何<link linkend="advanced-networking">建立网络连接</link>。
Know how to <link linkend="ports">install additional third-party software</link>. 了解如何<link linkend="ports">安装第三方软件</link>。

Loading…

No matching activity found.

Browse all component changes

Glossary

English Chinese (Simplified) (zh_CN)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect1/para
Source string location
book.translate.xml:19560
String age
10 days ago
Source string age
10 days ago
Translation file
books/zh_CN/handbook.po, string 3192