Eradicate the world "emulat{ion,or}".
Mention more of the popular Linux software we can run. Capitalize "Linux" when it is not a command.
This commit is contained in:
parent
6327c10ea7
commit
95ea7f519f
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=5630
2 changed files with 100 additions and 98 deletions
|
@ -1,43 +1,44 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/linuxemu/chapter.sgml,v 1.19 1999/09/06 06:53:00 peter Exp $
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/linuxemu/chapter.sgml,v 1.20 1999/09/15 01:15:03 obrien Exp $
|
||||
-->
|
||||
|
||||
<chapter id="linuxemu">
|
||||
<title>Linux Emulation</title>
|
||||
<title>Linux Mode</title>
|
||||
|
||||
<para><emphasis>Contributed by &a.handy; and &a.rich;</emphasis></para>
|
||||
|
||||
<sect1>
|
||||
<title>How to Install the Linux Emulator</title>
|
||||
<title>How to Install the Linux Mode</title>
|
||||
|
||||
<para>Linux emulation in FreeBSD has reached a point where it is possible
|
||||
<para>Linux binary compatibility in FreeBSD has reached a point where it is possible
|
||||
to run a large fraction of Linux binaries in both a.out and ELF format.
|
||||
The linux emulation in the 2.1-STABLE branch is capable of running Linux
|
||||
The Linux compatibility in the 2.1-STABLE branch is capable of running Linux
|
||||
DOOM and Mathematica; the version present in &rel.current;-RELEASE is
|
||||
vastly more capable and runs all these as well as Quake, Abuse, IDL,
|
||||
vastly more capable and runs all these as well as Oracle8,
|
||||
WordPerfect, StarOffice, Acrobat, Quake, Abuse, IDL,
|
||||
netrek for Linux and a whole host of other programs.</para>
|
||||
|
||||
<para>There are some Linux-specific operating system features that are not
|
||||
supported on FreeBSD. Linux binaries will not work on FreeBSD if they
|
||||
use the Linux <filename>/proc</filename> filesystem (which is different
|
||||
overly use the Linux <filename>/proc</filename> filesystem (which is different
|
||||
from the optional FreeBSD <filename>/proc</filename> filesystem) or
|
||||
i386-specific calls, such as enabling virtual 8086 mode.</para>
|
||||
|
||||
<para>Depending on which version of FreeBSD you are running, how you get
|
||||
Linux-emulation up will vary slightly:</para>
|
||||
Linux-mode up will vary somewhat:</para>
|
||||
|
||||
<sect2>
|
||||
<title>Installing Linux Emulation in 2.1-STABLE</title>
|
||||
<title>Installing Linux Mode in 2.1-STABLE</title>
|
||||
|
||||
<para>The <filename>GENERIC</filename> kernel in 2.1-STABLE is not
|
||||
configured for linux compatibility so you must reconfigure your kernel
|
||||
for it. There are two ways to do this: 1. linking the emulator
|
||||
configured for Linux compatibility so you must reconfigure your kernel
|
||||
for it. There are two ways to do this: 1. linking the binary compatibility
|
||||
statically in the kernel itself and 2. configuring your kernel to
|
||||
dynamically load the linux loadable kernel module (LKM).</para>
|
||||
dynamically load the Linux loadable kernel module (LKM).</para>
|
||||
|
||||
<para>To enable the emulator, add the following to your configuration
|
||||
<para>To enable Linux binary compatibility, add the following to your configuration
|
||||
file (c.f. <filename>/sys/i386/conf/LINT</filename>):</para>
|
||||
|
||||
<programlisting>
|
||||
|
@ -49,19 +50,19 @@ options COMPAT_LINUX</programlisting>
|
|||
<programlisting>
|
||||
options SYSVSHM</programlisting>
|
||||
|
||||
<para>The linux system calls require 4.3BSD system call compatibility.
|
||||
<para>The Linux system calls require 4.3BSD system call compatibility.
|
||||
So make sure you have the following.</para>
|
||||
|
||||
<programlisting>
|
||||
options "COMPAT_43"</programlisting>
|
||||
|
||||
<para>If you prefer to statically link the emulator in the kernel rather
|
||||
<para>If you prefer to statically link the binary compatibility in the kernel rather
|
||||
than use the loadable kernel module (LKM), then add</para>
|
||||
|
||||
<programlisting>
|
||||
options LINUX</programlisting>
|
||||
|
||||
<para>Then run config and install the new kernel as described in the
|
||||
<para>Then run <command>config</command> and install the new kernel as described in the
|
||||
<link linkend="kernelconfig">kernel configuration</link>
|
||||
section.</para>
|
||||
|
||||
|
@ -74,7 +75,7 @@ options LINUX</programlisting>
|
|||
&prompt.root; <userinput>make all install</userinput></screen>
|
||||
|
||||
<para>Once you have installed the kernel and the LKM, you can invoke
|
||||
`linux' as root to load the LKM.</para>
|
||||
<command>linux</command> as root to load the LKM.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>linux</userinput>
|
||||
Linux emulator installed
|
||||
|
@ -103,11 +104,11 @@ linux</programlisting>
|
|||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Installing Linux Emulation in 2.2.2-RELEASE and later 2.2 versions</title>
|
||||
<title>Installing Linux Mode in 2.2.2-RELEASE and later 2.2.x versions</title>
|
||||
|
||||
<para>It is no longer necessary to specify <literal>options
|
||||
LINUX</literal> or <literal>options COMPAT_LINUX</literal>. Linux
|
||||
emulation is done with an LKM (“Loadable Kernel Module”)
|
||||
binary compatibility is done with an LKM (“Loadable Kernel Module”)
|
||||
so it can be installed on the fly without having to reboot. You will
|
||||
need the following things in your startup files, however:</para>
|
||||
|
||||
|
@ -140,7 +141,7 @@ EXEC 0 4 f09e6000 001c f09ec010 1 linux_mod</screen>
|
|||
|
||||
<para>However, there have been reports that this fails on some
|
||||
2.2-RELEASE and later systems. If for some reason you cannot load the
|
||||
linux LKM, then statically link the emulator in the kernel by
|
||||
Linux LKM, then statically link the Linux compatibility in the kernel by
|
||||
adding
|
||||
|
||||
<programlisting>
|
||||
|
@ -152,11 +153,11 @@ options LINUX</programlisting>
|
|||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Installing Linux Emulation in 3.0-RELEASE and later</title>
|
||||
<title>Installing Linux Mode in 3.0-RELEASE and later</title>
|
||||
|
||||
<para>It is no longer necessary to specify <literal>options
|
||||
LINUX</literal> or <literal>options COMPAT_LINUX</literal>. Linux
|
||||
emulation is done with an KLD object (“Kernel LoaDable object”)
|
||||
binary compatibility is done with an KLD object (“Kernel LoaDable object”)
|
||||
so it can be installed on the fly without having to reboot. You will
|
||||
need the following things in your startup files, however:</para>
|
||||
|
||||
|
@ -174,7 +175,7 @@ linux_enable=YES</programlisting>
|
|||
<filename>/etc/rc.i386</filename>:</para>
|
||||
|
||||
<programlisting>
|
||||
# Start the Linux binary emulation if requested.
|
||||
# Start the Linux binary compatibility if requested.
|
||||
if [ "X${linux_enable}" = X"YES" ]; then echo -n '
|
||||
linux'; linux > /dev/null 2>&1
|
||||
fi</programlisting>
|
||||
|
@ -189,7 +190,7 @@ Id Refs Address Size Name
|
|||
7 1 0xc24db000 d000 linux.ko</screen>
|
||||
|
||||
<para>If for some reason you do not want to or cannot load the
|
||||
linux KLD, then statically link the emulator in the kernel by
|
||||
Linux KLD, then statically link the binary compatibility in the kernel by
|
||||
adding
|
||||
|
||||
<programlisting>
|
||||
|
@ -206,7 +207,7 @@ options LINUX</programlisting>
|
|||
<sect3>
|
||||
<title>Installing using the linux_base port</title>
|
||||
|
||||
<para>Most linux applications use shared libraries, so you are still
|
||||
<para>Most Linux applications use shared libraries, so you are still
|
||||
not done until you install the shared libraries. It is possible to
|
||||
do this by hand, however, it is vastly simpler to just grab the
|
||||
linux_base port:</para>
|
||||
|
@ -214,11 +215,11 @@ options LINUX</programlisting>
|
|||
<screen>&prompt.root; <userinput>cd /usr/ports/emulators/linux_base</userinput>
|
||||
&prompt.root; <userinput>make all install</userinput></screen>
|
||||
|
||||
<para>and you should have a working linux emulator. Legend (and the
|
||||
mail archives <!-- smiley -->:-) seems to hold that Linux emulation
|
||||
works best with linux binaries linked against the ZMAGIC libraries;
|
||||
<para>and you should have working Linux binary compatibility. Legend (and the
|
||||
mail archives <!-- smiley -->:-) seems to hold that Linux mode
|
||||
works best with Linux binaries linked against the ZMAGIC libraries;
|
||||
QMAGIC libraries (such as those used in Slackware V2.0) may tend to
|
||||
give the Linuxulator heartburn. Also, expect some programs to
|
||||
give the Linux mode heartburn. Also, expect some programs to
|
||||
complain about incorrect minor versions of the system libraries. In
|
||||
general, however, this does not seem to be a problem.</para>
|
||||
</sect3>
|
||||
|
@ -367,7 +368,7 @@ libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29</screen>
|
|||
<para>Create the file
|
||||
<filename>/compat/linux/etc/ld.so.conf</filename>, containing the
|
||||
directories in which the Linux runtime linker should look for shared
|
||||
libs. It is a plain text file, containing a directory name on each
|
||||
libraries. It is a plain text file, containing a directory name on each
|
||||
line. <filename>/lib</filename> and <filename>/usr/lib</filename>
|
||||
are standard, you could add the following:</para>
|
||||
|
||||
|
@ -375,13 +376,13 @@ libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29</screen>
|
|||
/usr/X11/lib
|
||||
/usr/local/lib</programlisting>
|
||||
|
||||
<para>When a linux binary opens a library such as
|
||||
<filename>/lib/libc.so</filename> the emulator maps the name to
|
||||
<para>When a Linux binary opens a library such as
|
||||
<filename>/lib/libc.so</filename> the Linux ABI support maps the name to
|
||||
<filename>/compat/linux/lib/libc.so</filename> internally. All
|
||||
linux libraries should be installed under /compat/linux (e.g.
|
||||
Linux libraries should be installed under /compat/linux (e.g.
|
||||
<filename>/compat/linux/lib/libc.so</filename>,
|
||||
<filename>/compat/linux/usr/X11/lib/libX11.so</filename>, etc.) in
|
||||
order for the emulator to find them.</para>
|
||||
order for the Linux ABI loader to find them.</para>
|
||||
|
||||
<para>Those running FreeBSD 2.2-RELEASE should run the Linux ldconfig
|
||||
program.</para>
|
||||
|
@ -546,10 +547,10 @@ multi on</programlisting>
|
|||
separate packages. Normally, they are controlled by an install
|
||||
program, but you can retrieve files “by hand” too. First
|
||||
of all, you will need to look in the <filename>contents</filename>
|
||||
subdir of the distribution. You will find a lot of small text files
|
||||
subdirectory of the distribution. You will find a lot of small text files
|
||||
here describing the contents of the separate packages. The fastest
|
||||
way to look something up is to retrieve all the files in the contents
|
||||
subdirectory, and grep through them for the file you need. Here is an
|
||||
subdirectory, and <command>grep</command> through them for the file you need. Here is an
|
||||
example of a list of files that you might need, and in which
|
||||
contents-file you will find it by grepping through them:</para>
|
||||
|
||||
|
@ -719,8 +720,8 @@ multi on</programlisting>
|
|||
<para>Before you can run Mathematica you will have to obtain a password
|
||||
from Wolfram that corresponds to your “machine ID”.</para>
|
||||
|
||||
<para>Once you have installed the linux compatibility runtime libraries
|
||||
and unpacked the mathematica you can obtain the “machine
|
||||
<para>Once you have installed the Linux compatibility runtime libraries
|
||||
and unpacked Mathematica you can obtain the “machine
|
||||
ID” by running the program <command>mathinfo</command> in the
|
||||
Install directory.</para>
|
||||
|
||||
|
@ -740,7 +741,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
will give them the “machine ID” and they will respond with
|
||||
a corresponding password consisting of groups of numbers. You need to
|
||||
add them both along with the machine name and license number in your
|
||||
mathpass file.</para>
|
||||
<filename>mathpass</filename> file.</para>
|
||||
|
||||
<para>You can do this by invoking:</para>
|
||||
|
||||
|
@ -780,7 +781,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
|
||||
<row>
|
||||
<entry>/usr/local/Mathematica/lib/X11</entry>
|
||||
<entry>for the XKeysymb file</entry>
|
||||
<entry>for the <filename>XKeysymb</filename> file</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
@ -818,7 +819,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
|
||||
<screen>&prompt.user; <userinput>RESOLV_HOST_CONF=/compat/linux/etc/host.conf; export RESOLV_HOST_CONF</userinput></screen>
|
||||
|
||||
<para>This tells Mathematica to use the linux version of host.conf.
|
||||
<para>This tells Mathematica to use the Linux version of host.conf.
|
||||
This file has a different syntax from FreeBSD's host.conf, so you will
|
||||
get an error message about <filename>/etc/host.conf</filename> if you
|
||||
leave this out.</para>
|
||||
|
@ -854,14 +855,14 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
<title>Acknowledgments</title>
|
||||
|
||||
<para>A well-deserved thanks should go to &a.sos; and &a.peter; who made
|
||||
linux emulation what it is today, and Michael Smith who drove these
|
||||
Linux mode what it is today, and Michael Smith who drove these
|
||||
two guys like dogs to get it to the point where it runs Linux binaries
|
||||
better than linux! <!-- smiley -->:-)</para>
|
||||
better than Linux! <!-- smiley -->:-)</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1>
|
||||
<title>How does the emulation work?</title>
|
||||
<title>How does the Linux mode work?</title>
|
||||
|
||||
<para>This section is based heavily on an e-mail written to the
|
||||
<email>chat@FreeBSD.org</email> mailing list, written by Terry Lambert
|
||||
|
@ -898,7 +899,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
the characters which follow to the next whitespace next to last,
|
||||
followed by a fallback to <filename>/bin/sh</filename>.</para>
|
||||
|
||||
<para>For the Linux binary emulation, FreeBSD sees the magic number as an
|
||||
<para>For the Linux ABI support, FreeBSD sees the magic number as an
|
||||
ELF binary (it makes no distinction between FreeBSD, Solaris, Linux, or
|
||||
any other OS which has an ELF image type, at this point).</para>
|
||||
|
||||
|
@ -921,7 +922,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
traditional UNIX system, this would be the <literal>sysent[]</literal> structure array, containing the system
|
||||
calls). In addition, the process is flagged for special handling of the
|
||||
trap vector for the signal trampoline code, and sever other (minor)
|
||||
fixups that are handled by the Linux kernel module.</para>
|
||||
fix-ups that are handled by the Linux kernel module.</para>
|
||||
|
||||
<para>The Linux system call vector contains, among other things, a list of
|
||||
<literal>sysent[]</literal> entries whose addresses reside in the kernel
|
||||
|
@ -932,7 +933,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
<literal>proc</literal> structure, and gets the Linux, not the FreeBSD,
|
||||
system call entry points.</para>
|
||||
|
||||
<para>In addition, the Linux emulation dynamically
|
||||
<para>In addition, the Linux mode dynamically
|
||||
<emphasis>reroots</emphasis> lookups; this is, in effect, what the
|
||||
<literal>union</literal> option to FS mounts ( <emphasis>not</emphasis>
|
||||
the unionfs!) does. First, an attempt is made to lookup the file in the
|
||||
|
@ -941,7 +942,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
done in the
|
||||
<filename>/<replaceable>original-path</replaceable></filename>
|
||||
directory. This makes sure that binaries that require other binaries
|
||||
can run (e.g., the Linux toolchain can all run under emulation). It
|
||||
can run (e.g., the Linux toolchain can all run under Linux ABI support). It
|
||||
also means that the Linux binaries can load and exec FreeBSD binaries,
|
||||
if there are no corresponding Linux binaries present, and that you could
|
||||
place a &man.uname.1; command in the <filename>/compat/linux</filename>
|
||||
|
@ -973,7 +974,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
implementation, not an emulation. There is no emulator (or simulator,
|
||||
to cut off the next question) involved.</para>
|
||||
|
||||
<para>So why is it called “Linux emulation”? To make it hard
|
||||
<para>So why is it sometimes called “Linux emulation”? To make it hard
|
||||
to sell FreeBSD! <!-- smiley -->8-). Really, it is because the
|
||||
historical implementation was done at a time when there was really no
|
||||
word other than that to describe what was going on; saying that FreeBSD
|
||||
|
|
|
@ -1,43 +1,44 @@
|
|||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/linuxemu/chapter.sgml,v 1.19 1999/09/06 06:53:00 peter Exp $
|
||||
$FreeBSD: doc/en_US.ISO_8859-1/books/handbook/linuxemu/chapter.sgml,v 1.20 1999/09/15 01:15:03 obrien Exp $
|
||||
-->
|
||||
|
||||
<chapter id="linuxemu">
|
||||
<title>Linux Emulation</title>
|
||||
<title>Linux Mode</title>
|
||||
|
||||
<para><emphasis>Contributed by &a.handy; and &a.rich;</emphasis></para>
|
||||
|
||||
<sect1>
|
||||
<title>How to Install the Linux Emulator</title>
|
||||
<title>How to Install the Linux Mode</title>
|
||||
|
||||
<para>Linux emulation in FreeBSD has reached a point where it is possible
|
||||
<para>Linux binary compatibility in FreeBSD has reached a point where it is possible
|
||||
to run a large fraction of Linux binaries in both a.out and ELF format.
|
||||
The linux emulation in the 2.1-STABLE branch is capable of running Linux
|
||||
The Linux compatibility in the 2.1-STABLE branch is capable of running Linux
|
||||
DOOM and Mathematica; the version present in &rel.current;-RELEASE is
|
||||
vastly more capable and runs all these as well as Quake, Abuse, IDL,
|
||||
vastly more capable and runs all these as well as Oracle8,
|
||||
WordPerfect, StarOffice, Acrobat, Quake, Abuse, IDL,
|
||||
netrek for Linux and a whole host of other programs.</para>
|
||||
|
||||
<para>There are some Linux-specific operating system features that are not
|
||||
supported on FreeBSD. Linux binaries will not work on FreeBSD if they
|
||||
use the Linux <filename>/proc</filename> filesystem (which is different
|
||||
overly use the Linux <filename>/proc</filename> filesystem (which is different
|
||||
from the optional FreeBSD <filename>/proc</filename> filesystem) or
|
||||
i386-specific calls, such as enabling virtual 8086 mode.</para>
|
||||
|
||||
<para>Depending on which version of FreeBSD you are running, how you get
|
||||
Linux-emulation up will vary slightly:</para>
|
||||
Linux-mode up will vary somewhat:</para>
|
||||
|
||||
<sect2>
|
||||
<title>Installing Linux Emulation in 2.1-STABLE</title>
|
||||
<title>Installing Linux Mode in 2.1-STABLE</title>
|
||||
|
||||
<para>The <filename>GENERIC</filename> kernel in 2.1-STABLE is not
|
||||
configured for linux compatibility so you must reconfigure your kernel
|
||||
for it. There are two ways to do this: 1. linking the emulator
|
||||
configured for Linux compatibility so you must reconfigure your kernel
|
||||
for it. There are two ways to do this: 1. linking the binary compatibility
|
||||
statically in the kernel itself and 2. configuring your kernel to
|
||||
dynamically load the linux loadable kernel module (LKM).</para>
|
||||
dynamically load the Linux loadable kernel module (LKM).</para>
|
||||
|
||||
<para>To enable the emulator, add the following to your configuration
|
||||
<para>To enable Linux binary compatibility, add the following to your configuration
|
||||
file (c.f. <filename>/sys/i386/conf/LINT</filename>):</para>
|
||||
|
||||
<programlisting>
|
||||
|
@ -49,19 +50,19 @@ options COMPAT_LINUX</programlisting>
|
|||
<programlisting>
|
||||
options SYSVSHM</programlisting>
|
||||
|
||||
<para>The linux system calls require 4.3BSD system call compatibility.
|
||||
<para>The Linux system calls require 4.3BSD system call compatibility.
|
||||
So make sure you have the following.</para>
|
||||
|
||||
<programlisting>
|
||||
options "COMPAT_43"</programlisting>
|
||||
|
||||
<para>If you prefer to statically link the emulator in the kernel rather
|
||||
<para>If you prefer to statically link the binary compatibility in the kernel rather
|
||||
than use the loadable kernel module (LKM), then add</para>
|
||||
|
||||
<programlisting>
|
||||
options LINUX</programlisting>
|
||||
|
||||
<para>Then run config and install the new kernel as described in the
|
||||
<para>Then run <command>config</command> and install the new kernel as described in the
|
||||
<link linkend="kernelconfig">kernel configuration</link>
|
||||
section.</para>
|
||||
|
||||
|
@ -74,7 +75,7 @@ options LINUX</programlisting>
|
|||
&prompt.root; <userinput>make all install</userinput></screen>
|
||||
|
||||
<para>Once you have installed the kernel and the LKM, you can invoke
|
||||
`linux' as root to load the LKM.</para>
|
||||
<command>linux</command> as root to load the LKM.</para>
|
||||
|
||||
<screen>&prompt.root; <userinput>linux</userinput>
|
||||
Linux emulator installed
|
||||
|
@ -103,11 +104,11 @@ linux</programlisting>
|
|||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Installing Linux Emulation in 2.2.2-RELEASE and later 2.2 versions</title>
|
||||
<title>Installing Linux Mode in 2.2.2-RELEASE and later 2.2.x versions</title>
|
||||
|
||||
<para>It is no longer necessary to specify <literal>options
|
||||
LINUX</literal> or <literal>options COMPAT_LINUX</literal>. Linux
|
||||
emulation is done with an LKM (“Loadable Kernel Module”)
|
||||
binary compatibility is done with an LKM (“Loadable Kernel Module”)
|
||||
so it can be installed on the fly without having to reboot. You will
|
||||
need the following things in your startup files, however:</para>
|
||||
|
||||
|
@ -140,7 +141,7 @@ EXEC 0 4 f09e6000 001c f09ec010 1 linux_mod</screen>
|
|||
|
||||
<para>However, there have been reports that this fails on some
|
||||
2.2-RELEASE and later systems. If for some reason you cannot load the
|
||||
linux LKM, then statically link the emulator in the kernel by
|
||||
Linux LKM, then statically link the Linux compatibility in the kernel by
|
||||
adding
|
||||
|
||||
<programlisting>
|
||||
|
@ -152,11 +153,11 @@ options LINUX</programlisting>
|
|||
</sect2>
|
||||
|
||||
<sect2>
|
||||
<title>Installing Linux Emulation in 3.0-RELEASE and later</title>
|
||||
<title>Installing Linux Mode in 3.0-RELEASE and later</title>
|
||||
|
||||
<para>It is no longer necessary to specify <literal>options
|
||||
LINUX</literal> or <literal>options COMPAT_LINUX</literal>. Linux
|
||||
emulation is done with an KLD object (“Kernel LoaDable object”)
|
||||
binary compatibility is done with an KLD object (“Kernel LoaDable object”)
|
||||
so it can be installed on the fly without having to reboot. You will
|
||||
need the following things in your startup files, however:</para>
|
||||
|
||||
|
@ -174,7 +175,7 @@ linux_enable=YES</programlisting>
|
|||
<filename>/etc/rc.i386</filename>:</para>
|
||||
|
||||
<programlisting>
|
||||
# Start the Linux binary emulation if requested.
|
||||
# Start the Linux binary compatibility if requested.
|
||||
if [ "X${linux_enable}" = X"YES" ]; then echo -n '
|
||||
linux'; linux > /dev/null 2>&1
|
||||
fi</programlisting>
|
||||
|
@ -189,7 +190,7 @@ Id Refs Address Size Name
|
|||
7 1 0xc24db000 d000 linux.ko</screen>
|
||||
|
||||
<para>If for some reason you do not want to or cannot load the
|
||||
linux KLD, then statically link the emulator in the kernel by
|
||||
Linux KLD, then statically link the binary compatibility in the kernel by
|
||||
adding
|
||||
|
||||
<programlisting>
|
||||
|
@ -206,7 +207,7 @@ options LINUX</programlisting>
|
|||
<sect3>
|
||||
<title>Installing using the linux_base port</title>
|
||||
|
||||
<para>Most linux applications use shared libraries, so you are still
|
||||
<para>Most Linux applications use shared libraries, so you are still
|
||||
not done until you install the shared libraries. It is possible to
|
||||
do this by hand, however, it is vastly simpler to just grab the
|
||||
linux_base port:</para>
|
||||
|
@ -214,11 +215,11 @@ options LINUX</programlisting>
|
|||
<screen>&prompt.root; <userinput>cd /usr/ports/emulators/linux_base</userinput>
|
||||
&prompt.root; <userinput>make all install</userinput></screen>
|
||||
|
||||
<para>and you should have a working linux emulator. Legend (and the
|
||||
mail archives <!-- smiley -->:-) seems to hold that Linux emulation
|
||||
works best with linux binaries linked against the ZMAGIC libraries;
|
||||
<para>and you should have working Linux binary compatibility. Legend (and the
|
||||
mail archives <!-- smiley -->:-) seems to hold that Linux mode
|
||||
works best with Linux binaries linked against the ZMAGIC libraries;
|
||||
QMAGIC libraries (such as those used in Slackware V2.0) may tend to
|
||||
give the Linuxulator heartburn. Also, expect some programs to
|
||||
give the Linux mode heartburn. Also, expect some programs to
|
||||
complain about incorrect minor versions of the system libraries. In
|
||||
general, however, this does not seem to be a problem.</para>
|
||||
</sect3>
|
||||
|
@ -367,7 +368,7 @@ libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29</screen>
|
|||
<para>Create the file
|
||||
<filename>/compat/linux/etc/ld.so.conf</filename>, containing the
|
||||
directories in which the Linux runtime linker should look for shared
|
||||
libs. It is a plain text file, containing a directory name on each
|
||||
libraries. It is a plain text file, containing a directory name on each
|
||||
line. <filename>/lib</filename> and <filename>/usr/lib</filename>
|
||||
are standard, you could add the following:</para>
|
||||
|
||||
|
@ -375,13 +376,13 @@ libc.so.4 (DLL Jump 4.5pl26) => /lib/libc.so.4.6.29</screen>
|
|||
/usr/X11/lib
|
||||
/usr/local/lib</programlisting>
|
||||
|
||||
<para>When a linux binary opens a library such as
|
||||
<filename>/lib/libc.so</filename> the emulator maps the name to
|
||||
<para>When a Linux binary opens a library such as
|
||||
<filename>/lib/libc.so</filename> the Linux ABI support maps the name to
|
||||
<filename>/compat/linux/lib/libc.so</filename> internally. All
|
||||
linux libraries should be installed under /compat/linux (e.g.
|
||||
Linux libraries should be installed under /compat/linux (e.g.
|
||||
<filename>/compat/linux/lib/libc.so</filename>,
|
||||
<filename>/compat/linux/usr/X11/lib/libX11.so</filename>, etc.) in
|
||||
order for the emulator to find them.</para>
|
||||
order for the Linux ABI loader to find them.</para>
|
||||
|
||||
<para>Those running FreeBSD 2.2-RELEASE should run the Linux ldconfig
|
||||
program.</para>
|
||||
|
@ -546,10 +547,10 @@ multi on</programlisting>
|
|||
separate packages. Normally, they are controlled by an install
|
||||
program, but you can retrieve files “by hand” too. First
|
||||
of all, you will need to look in the <filename>contents</filename>
|
||||
subdir of the distribution. You will find a lot of small text files
|
||||
subdirectory of the distribution. You will find a lot of small text files
|
||||
here describing the contents of the separate packages. The fastest
|
||||
way to look something up is to retrieve all the files in the contents
|
||||
subdirectory, and grep through them for the file you need. Here is an
|
||||
subdirectory, and <command>grep</command> through them for the file you need. Here is an
|
||||
example of a list of files that you might need, and in which
|
||||
contents-file you will find it by grepping through them:</para>
|
||||
|
||||
|
@ -719,8 +720,8 @@ multi on</programlisting>
|
|||
<para>Before you can run Mathematica you will have to obtain a password
|
||||
from Wolfram that corresponds to your “machine ID”.</para>
|
||||
|
||||
<para>Once you have installed the linux compatibility runtime libraries
|
||||
and unpacked the mathematica you can obtain the “machine
|
||||
<para>Once you have installed the Linux compatibility runtime libraries
|
||||
and unpacked Mathematica you can obtain the “machine
|
||||
ID” by running the program <command>mathinfo</command> in the
|
||||
Install directory.</para>
|
||||
|
||||
|
@ -740,7 +741,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
will give them the “machine ID” and they will respond with
|
||||
a corresponding password consisting of groups of numbers. You need to
|
||||
add them both along with the machine name and license number in your
|
||||
mathpass file.</para>
|
||||
<filename>mathpass</filename> file.</para>
|
||||
|
||||
<para>You can do this by invoking:</para>
|
||||
|
||||
|
@ -780,7 +781,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
|
||||
<row>
|
||||
<entry>/usr/local/Mathematica/lib/X11</entry>
|
||||
<entry>for the XKeysymb file</entry>
|
||||
<entry>for the <filename>XKeysymb</filename> file</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
|
@ -818,7 +819,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
|
||||
<screen>&prompt.user; <userinput>RESOLV_HOST_CONF=/compat/linux/etc/host.conf; export RESOLV_HOST_CONF</userinput></screen>
|
||||
|
||||
<para>This tells Mathematica to use the linux version of host.conf.
|
||||
<para>This tells Mathematica to use the Linux version of host.conf.
|
||||
This file has a different syntax from FreeBSD's host.conf, so you will
|
||||
get an error message about <filename>/etc/host.conf</filename> if you
|
||||
leave this out.</para>
|
||||
|
@ -854,14 +855,14 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
<title>Acknowledgments</title>
|
||||
|
||||
<para>A well-deserved thanks should go to &a.sos; and &a.peter; who made
|
||||
linux emulation what it is today, and Michael Smith who drove these
|
||||
Linux mode what it is today, and Michael Smith who drove these
|
||||
two guys like dogs to get it to the point where it runs Linux binaries
|
||||
better than linux! <!-- smiley -->:-)</para>
|
||||
better than Linux! <!-- smiley -->:-)</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
<sect1>
|
||||
<title>How does the emulation work?</title>
|
||||
<title>How does the Linux mode work?</title>
|
||||
|
||||
<para>This section is based heavily on an e-mail written to the
|
||||
<email>chat@FreeBSD.org</email> mailing list, written by Terry Lambert
|
||||
|
@ -898,7 +899,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
the characters which follow to the next whitespace next to last,
|
||||
followed by a fallback to <filename>/bin/sh</filename>.</para>
|
||||
|
||||
<para>For the Linux binary emulation, FreeBSD sees the magic number as an
|
||||
<para>For the Linux ABI support, FreeBSD sees the magic number as an
|
||||
ELF binary (it makes no distinction between FreeBSD, Solaris, Linux, or
|
||||
any other OS which has an ELF image type, at this point).</para>
|
||||
|
||||
|
@ -921,7 +922,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
traditional UNIX system, this would be the <literal>sysent[]</literal> structure array, containing the system
|
||||
calls). In addition, the process is flagged for special handling of the
|
||||
trap vector for the signal trampoline code, and sever other (minor)
|
||||
fixups that are handled by the Linux kernel module.</para>
|
||||
fix-ups that are handled by the Linux kernel module.</para>
|
||||
|
||||
<para>The Linux system call vector contains, among other things, a list of
|
||||
<literal>sysent[]</literal> entries whose addresses reside in the kernel
|
||||
|
@ -932,7 +933,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
<literal>proc</literal> structure, and gets the Linux, not the FreeBSD,
|
||||
system call entry points.</para>
|
||||
|
||||
<para>In addition, the Linux emulation dynamically
|
||||
<para>In addition, the Linux mode dynamically
|
||||
<emphasis>reroots</emphasis> lookups; this is, in effect, what the
|
||||
<literal>union</literal> option to FS mounts ( <emphasis>not</emphasis>
|
||||
the unionfs!) does. First, an attempt is made to lookup the file in the
|
||||
|
@ -941,7 +942,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
done in the
|
||||
<filename>/<replaceable>original-path</replaceable></filename>
|
||||
directory. This makes sure that binaries that require other binaries
|
||||
can run (e.g., the Linux toolchain can all run under emulation). It
|
||||
can run (e.g., the Linux toolchain can all run under Linux ABI support). It
|
||||
also means that the Linux binaries can load and exec FreeBSD binaries,
|
||||
if there are no corresponding Linux binaries present, and that you could
|
||||
place a &man.uname.1; command in the <filename>/compat/linux</filename>
|
||||
|
@ -973,7 +974,7 @@ richc.isdn.bcm.tmc.edu 9845-03452-90255</screen>
|
|||
implementation, not an emulation. There is no emulator (or simulator,
|
||||
to cut off the next question) involved.</para>
|
||||
|
||||
<para>So why is it called “Linux emulation”? To make it hard
|
||||
<para>So why is it sometimes called “Linux emulation”? To make it hard
|
||||
to sell FreeBSD! <!-- smiley -->8-). Really, it is because the
|
||||
historical implementation was done at a time when there was really no
|
||||
word other than that to describe what was going on; saying that FreeBSD
|
||||
|
|
Loading…
Reference in a new issue