aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/articles/linux-emulation/article.xml
diff options
context:
space:
mode:
Diffstat (limited to 'en_US.ISO8859-1/articles/linux-emulation/article.xml')
-rw-r--r--en_US.ISO8859-1/articles/linux-emulation/article.xml245
1 files changed, 119 insertions, 126 deletions
diff --git a/en_US.ISO8859-1/articles/linux-emulation/article.xml b/en_US.ISO8859-1/articles/linux-emulation/article.xml
index eec01db036..7c4191fd72 100644
--- a/en_US.ISO8859-1/articles/linux-emulation/article.xml
+++ b/en_US.ISO8859-1/articles/linux-emulation/article.xml
@@ -1,24 +1,17 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.5-Based Extension//EN"
- "../../../share/xml/freebsd45.dtd">
-
+<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN"
+ "../../../share/xml/freebsd50.dtd">
<!-- $FreeBSD$ -->
<!-- The FreeBSD Documentation Project -->
+<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
+ <info><title>&linux; emulation in &os;</title>
+
-<article lang='en'>
- <articleinfo>
- <title>&linux; emulation in &os;</title>
-
- <author>
- <firstname>Roman</firstname>
- <surname>Divacky</surname>
-
- <affiliation>
+ <author><personname><firstname>Roman</firstname><surname>Divacky</surname></personname><affiliation>
<address><email>rdivacky@FreeBSD.org</email></address>
- </affiliation>
- </author>
+ </affiliation></author>
- <legalnotice id="trademarks" role="trademarks">
+ <legalnotice xml:id="trademarks" role="trademarks">
&tm-attrib.adobe;
&tm-attrib.ibm;
&tm-attrib.freebsd;
@@ -52,9 +45,9 @@
the emulation development team, are working on making the
&linux; 2.6 emulation the default emulation layer in &os;.</para>
</abstract>
- </articleinfo>
+ </info>
- <sect1 id="intro">
+ <sect1 xml:id="intro">
<title>Introduction</title>
<para>In the last few years the open source &unix; based operating systems
@@ -79,7 +72,7 @@
part of this project.</para>
</sect1>
- <sect1 id="inside">
+ <sect1 xml:id="inside">
<title>A look inside&hellip;</title>
<para>In this section we are going to describe every operating system in
@@ -89,7 +82,7 @@
subsection we talk about how &unix; on &unix; emulation could be done
in general.</para>
- <sect2 id="what-is-unix">
+ <sect2 xml:id="what-is-unix">
<title>What is &unix;</title>
<para>&unix; is an operating system with a long history that has
@@ -110,7 +103,7 @@
&unix; characteristics.</para>
</sect2>
- <sect2 id="tech-details">
+ <sect2 xml:id="tech-details">
<title>Technical details</title>
<para>Every running program constitutes a process that represents a state
@@ -122,7 +115,7 @@
provides a standard unified &unix; API to the user space. The most
important ones are covered below.</para>
- <sect3 id="kern-proc-comm">
+ <sect3 xml:id="kern-proc-comm">
<title>Communication between kernel and user space process</title>
<para>Common &unix; API defines a syscall as a way to issue commands
@@ -145,7 +138,7 @@
(division by zero).</para>
</sect3>
- <sect3 id="proc-proc-comm">
+ <sect3 xml:id="proc-proc-comm">
<title>Communication between processes</title>
<para>There are other APIs (System V IPC, shared memory etc.) but the
@@ -155,7 +148,7 @@
in a predefined action that cannot be altered or ignored.</para>
</sect3>
- <sect3 id="proc-mgmt">
+ <sect3 xml:id="proc-mgmt">
<title>Process management</title>
<para>Kernel instances are processed first in the system (so called
@@ -170,7 +163,7 @@
defined parent (identified by its PID).</para>
</sect3>
- <sect3 id="thread-mgmt">
+ <sect3 xml:id="thread-mgmt">
<title>Thread management</title>
<para>Traditional &unix; does not define any API nor implementation
@@ -218,7 +211,7 @@
</sect3>
</sect2>
- <sect2 id="what-is-freebsd">
+ <sect2 xml:id="what-is-freebsd">
<title>What is &os;?</title>
<para>The &os; project is one of the oldest open source operating
@@ -293,7 +286,7 @@
<para>More info about the &os; operating system can be found
at [2].</para>
- <sect3 id="freebsd-tech-details">
+ <sect3 xml:id="freebsd-tech-details">
<title>Technical details</title>
<para>&os; is traditional flavor of &unix; in the sense of dividing the
@@ -305,7 +298,7 @@
only exists there but the concept is similar on other architectures.
The information was taken from [1] and the source code.</para>
- <sect4 id="freebsd-sys-entries">
+ <sect4 xml:id="freebsd-sys-entries">
<title>System entries</title>
<para>&os; has an abstraction called an execution class loader,
@@ -320,7 +313,7 @@
kernel-space and the user-space at once.</para>
</sect4>
- <sect4 id="freebsd-syscalls">
+ <sect4 xml:id="freebsd-syscalls">
<title>Syscalls</title>
<para>Syscalls on &os; are issued by executing interrupt
@@ -349,7 +342,7 @@
parameters.</para>
</sect4>
- <sect4 id="freebsd-traps">
+ <sect4 xml:id="freebsd-traps">
<title>Traps</title>
<para>Handling of traps in &os; is similar to the handling of
@@ -363,7 +356,7 @@
<literal>userret()</literal>.</para>
</sect4>
- <sect4 id="freebsd-exits">
+ <sect4 xml:id="freebsd-exits">
<title>Exits</title>
<para>Exits from kernel to userspace happen using the assembler
@@ -372,7 +365,7 @@
status from the stack and returns to the userspace.</para>
</sect4>
- <sect4 id="freebsd-unix-primitives">
+ <sect4 xml:id="freebsd-unix-primitives">
<title>&unix; primitives</title>
<para>&os; operating system adheres to the traditional &unix; scheme,
@@ -419,7 +412,7 @@
</sect3>
</sect2>
- <sect2 id="what-is-linux">
+ <sect2 xml:id="what-is-linux">
<title>What is &linux;</title>
<para>&linux; is a &unix;-like kernel originally developed by Linus
@@ -453,7 +446,7 @@
<para>More information can be obtained from [4].</para>
- <sect3 id="linux-tech-details">
+ <sect3 xml:id="linux-tech-details">
<title>Technical details</title>
<para>&linux; follows the traditional &unix; scheme of dividing the run
@@ -463,7 +456,7 @@
&linux;&nbsp;2.6 on the &i386; architecture. This information was
taken from [3].</para>
- <sect4 id="linux-syscalls">
+ <sect4 xml:id="linux-syscalls">
<title>Syscalls</title>
<para>Syscalls in &linux; are performed (in userspace) using
@@ -483,22 +476,22 @@
<orderedlist>
<listitem>
- <para>parameter -> <varname>%ebx</varname></para>
+ <para>parameter -&gt; <varname>%ebx</varname></para>
</listitem>
<listitem>
- <para>parameter -> <varname>%ecx</varname></para>
+ <para>parameter -&gt; <varname>%ecx</varname></para>
</listitem>
<listitem>
- <para>parameter -> <varname>%edx</varname></para>
+ <para>parameter -&gt; <varname>%edx</varname></para>
</listitem>
<listitem>
- <para>parameter -> <varname>%esi</varname></para>
+ <para>parameter -&gt; <varname>%esi</varname></para>
</listitem>
<listitem>
- <para>parameter -> <varname>%edi</varname></para>
+ <para>parameter -&gt; <varname>%edi</varname></para>
</listitem>
<listitem>
- <para>parameter -> <varname>%ebp</varname></para>
+ <para>parameter -&gt; <varname>%ebp</varname></para>
</listitem>
</orderedlist>
@@ -507,7 +500,7 @@
syscall).</para>
</sect4>
- <sect4 id="linux-traps">
+ <sect4 xml:id="linux-traps">
<title>Traps</title>
<para>The trap handlers are introduced in
@@ -516,7 +509,7 @@
where handling of the traps happens.</para>
</sect4>
- <sect4 id="linux-exits">
+ <sect4 xml:id="linux-exits">
<title>Exits</title>
<para>Return from the syscall is managed by syscall &man.exit.3;,
@@ -526,7 +519,7 @@
stack and the process returns to the userspace.</para>
</sect4>
- <sect4 id="linux-unix-primitives">
+ <sect4 xml:id="linux-unix-primitives">
<title>&unix; primitives</title>
<para>In the 2.6 version, the &linux; operating system redefined some
@@ -648,7 +641,7 @@
</sect3>
</sect2>
- <sect2 id="what-is-emu">
+ <sect2 xml:id="what-is-emu">
<title>What is emulation</title>
<para>According to a dictionary definition, emulation is the ability of
@@ -719,7 +712,7 @@
</sect2>
</sect1>
- <sect1 id="freebsd-emulation">
+ <sect1 xml:id="freebsd-emulation">
<title>Emulation</title>
<sect2>
@@ -763,14 +756,14 @@
only things necessary to implement the &linux; emulation layer.</para>
</sect2>
- <sect2 id="freebsd-common-primitives">
+ <sect2 xml:id="freebsd-common-primitives">
<title>Common primitives in the &os; kernel</title>
<para>Emulation layers need some support from the operating system. I am
going to describe some of the supported primitives in the &os;
operating system.</para>
- <sect3 id="freebsd-locking-primitives">
+ <sect3 xml:id="freebsd-locking-primitives">
<title>Locking primitives</title>
<para>Contributed by: &a.attilio.email;</para>
@@ -799,7 +792,7 @@
you should really check the linked manpage (where possible) for
more detailed explanations.</para>
- <sect4 id="freebsd-atomic-op">
+ <sect4 xml:id="freebsd-atomic-op">
<title>Atomic operations and memory barriers</title>
<para>Atomic operations are implemented through a set of functions
@@ -828,7 +821,7 @@
mutexes).</para>
</sect4>
- <sect4 id="freebsd-refcounts">
+ <sect4 xml:id="freebsd-refcounts">
<title>Refcounts</title>
<para>Refcounts are interfaces for handling reference counters.
@@ -843,7 +836,7 @@
existing API.</para>
</sect4>
- <sect4 id="freebsd-locks">
+ <sect4 xml:id="freebsd-locks">
<title>Locks</title>
<para>&os; kernel has huge classes of locks. Every lock is defined
@@ -869,7 +862,7 @@
</note>
</sect4>
- <sect4 id="freebsd-spinlocks">
+ <sect4 xml:id="freebsd-spinlocks">
<title>Spinning locks</title>
<para>Spin locks let waiters to spin until they cannot acquire the
@@ -884,7 +877,7 @@
requested (explained later).</para>
</sect4>
- <sect4 id="freebsd-blocking">
+ <sect4 xml:id="freebsd-blocking">
<title>Blocking</title>
<para>Block locks let waiters to be descheduled and blocked until
@@ -896,7 +889,7 @@
particular conditions are met.</para>
</sect4>
- <sect4 id="freebsd-sleeping">
+ <sect4 xml:id="freebsd-sleeping">
<title>Sleeping</title>
<para>Sleep locks let waiters to be descheduled and fall asleep
@@ -958,7 +951,7 @@
supported by mutexes and lockmgrs.</para>
</sect4>
- <sect4 id="freebsd-scheduling">
+ <sect4 xml:id="freebsd-scheduling">
<title>Scheduling barriers</title>
<para>Scheduling barriers are intended to be used in order to drive
@@ -983,7 +976,7 @@
with locking debugging tools (as &man.witness.4;).</para>
</sect4>
- <sect4 id="freebsd-critical">
+ <sect4 xml:id="freebsd-critical">
<title>Critical sections</title>
<para>The &os; kernel has been made preemptive basically to deal with
@@ -1002,7 +995,7 @@
brings.</para>
</sect4>
- <sect4 id="freebsd-schedpin">
+ <sect4 xml:id="freebsd-schedpin">
<title>sched_pin/sched_unpin</title>
<para>Another way to deal with preemption is the
@@ -1017,7 +1010,7 @@
as a too strong condition for our code.</para>
</sect4>
- <sect4 id="freebsd-schedbind">
+ <sect4 xml:id="freebsd-schedbind">
<title>sched_bind/sched_unbind</title>
<para><function>sched_bind</function> is an API used in order to bind
@@ -1034,7 +1027,7 @@
</sect4>
</sect3>
- <sect3 id="freebsd-proc">
+ <sect3 xml:id="freebsd-proc">
<title>Proc structure</title>
<para>Various emulation layers sometimes require some additional
@@ -1055,7 +1048,7 @@
whether the process belongs to our emulation layer. The code
typically looks like:</para>
- <programlisting>if (__predict_true(p->p_sysent != &amp;elf_&linux;_sysvec))
+ <programlisting>if (__predict_true(p-&gt;p_sysent != &amp;elf_&linux;_sysvec))
return;</programlisting>
<para>As you can see, we effectively use the
@@ -1067,7 +1060,7 @@
on i386.</para>
</sect3>
- <sect3 id="freebsd-vfs">
+ <sect3 xml:id="freebsd-vfs">
<title>VFS</title>
<para>The &os; VFS subsystem is very complex but the &linux; emulation
@@ -1079,7 +1072,7 @@
an ordinary file. A file handler contains a pointer to its vnode.
More then one file handler can point to the same vnode.</para>
- <sect4 id="freebsd-namei">
+ <sect4 xml:id="freebsd-namei">
<title>namei</title>
<para>The &man.namei.9; routine is a central entry point to pathname
@@ -1092,7 +1085,7 @@
performance is very critical.</para>
</sect4>
- <sect4 id="freebsd-vn">
+ <sect4 xml:id="freebsd-vn">
<title>vn_fullpath</title>
<para>The &man.vn.fullpath.9; function takes the best effort to
@@ -1104,7 +1097,7 @@
Linuxulator.</para>
</sect4>
- <sect4 id="freebsd-vnode">
+ <sect4 xml:id="freebsd-vnode">
<title>Vnode operations</title>
<itemizedlist>
@@ -1151,7 +1144,7 @@
</itemizedlist>
</sect4>
- <sect4 id="freebsd-file-handler">
+ <sect4 xml:id="freebsd-file-handler">
<title>File handler operations</title>
<itemizedlist>
@@ -1174,7 +1167,7 @@
</sect2>
</sect1>
- <sect1 id="md">
+ <sect1 xml:id="md">
<title>&linux; emulation layer -MD part</title>
<para>This section deals with implementation of &linux; emulation layer in
@@ -1186,7 +1179,7 @@
independent part of the Linuxulator. This section only covers i386 and ELF
handling. A.OUT is obsolete and untested.</para>
- <sect2 id="syscall-handling">
+ <sect2 xml:id="syscall-handling">
<title>Syscall handling</title>
<para>Syscall handling is mostly written in
@@ -1195,7 +1188,7 @@
&linux; process running on &os; issues a syscall, the general syscall
routine calls linux prepsyscall routine for the &linux; ABI.</para>
- <sect3 id="linux-prepsyscall">
+ <sect3 xml:id="linux-prepsyscall">
<title>&linux; prepsyscall</title>
<para>&linux; passes arguments to syscalls via registers (that is why
@@ -1211,7 +1204,7 @@
in the <function>linux_clone</function> prototype.</para>
</sect3>
- <sect3 id="syscall-writing">
+ <sect3 xml:id="syscall-writing">
<title>Syscall writing</title>
<para>Every syscall implemented in the Linuxulator must have its
@@ -1274,7 +1267,7 @@
with linux as it calls the real &man.close.2; in the kernel.</para>
</sect3>
- <sect3 id="dummy-syscalls">
+ <sect3 xml:id="dummy-syscalls">
<title>Dummy syscalls</title>
<para>The &linux; emulation layer is not complete, as some syscalls are
@@ -1291,7 +1284,7 @@
</sect3>
</sect2>
- <sect2 id="signal-handling">
+ <sect2 xml:id="signal-handling">
<title>Signal handling</title>
<para>Signal handling is done generally in the &os; kernel for all
@@ -1299,7 +1292,7 @@
&linux; compatibility layer defines
<function>linux_sendsig</function> routine for this purpose.</para>
- <sect3 id="linux-sendsig">
+ <sect3 xml:id="linux-sendsig">
<title>&linux; sendsig</title>
<para>This routine first checks whether the signal has been installed
@@ -1315,7 +1308,7 @@
signal handler to run.</para>
</sect3>
- <sect3 id="linux-rt-sendsig">
+ <sect3 xml:id="linux-rt-sendsig">
<title>linux_rt_sendsig</title>
<para>This routine is similar to <function>linux_sendsig</function>
@@ -1326,7 +1319,7 @@
and possibly even faster execution.</para>
</sect3>
- <sect3 id="linux-sigreturn">
+ <sect3 xml:id="linux-sigreturn">
<title>linux_sigreturn</title>
<para>This syscall is used for return from the signal handler. It does
@@ -1335,7 +1328,7 @@
</sect3>
</sect2>
- <sect2 id="ptrace">
+ <sect2 xml:id="ptrace">
<title>Ptrace</title>
<para>Many &unix; derivates implement the &man.ptrace.2; syscall in order
@@ -1367,7 +1360,7 @@
implemented.</para>
</sect2>
- <sect2 id="traps">
+ <sect2 xml:id="traps">
<title>Traps</title>
<para>Whenever a &linux; process running in the emulation layer traps
@@ -1397,7 +1390,7 @@ translate_traps(int signal, int trap_code)
}</programlisting>
</sect2>
- <sect2 id="stack-fixup">
+ <sect2 xml:id="stack-fixup">
<title>Stack fixup</title>
<para>The RTLD run-time link-editor expects so called AUX tags on stack
@@ -1410,7 +1403,7 @@ translate_traps(int signal, int trap_code)
smart way.</para>
</sect2>
- <sect2 id="aout-support">
+ <sect2 xml:id="aout-support">
<title>A.OUT support</title>
<para>The &linux; emulation layer on i386 also supports &linux; A.OUT
@@ -1425,7 +1418,7 @@ translate_traps(int signal, int trap_code)
</sect2>
</sect1>
- <sect1 id="mi">
+ <sect1 xml:id="mi">
<title>&linux; emulation layer -MI part</title>
<para>This section talks about machine independent part of the
@@ -1433,7 +1426,7 @@ translate_traps(int signal, int trap_code)
2.6 emulation, the thread local storage (TLS) implementation (on i386)
and futexes. Then we talk briefly about some syscalls.</para>
- <sect2 id="nptl-desc">
+ <sect2 xml:id="nptl-desc">
<title>Description of NPTL</title>
<para>One of the major areas of progress in development of &linux; 2.6
@@ -1464,13 +1457,13 @@ translate_traps(int signal, int trap_code)
areas.</para>
</sect2>
- <sect2 id="linux26-emu">
+ <sect2 xml:id="linux26-emu">
<title>&linux; 2.6 emulation infrastructure</title>
<para>These sections deal with the way &linux; threads are managed and
how we simulate that in &os;.</para>
- <sect3 id="linux26-runtime">
+ <sect3 xml:id="linux26-runtime">
<title>Runtime determining of 2.6 emulation</title>
<para>The &linux; emulation layer in &os; supports runtime setting of
@@ -1489,7 +1482,7 @@ translate_traps(int signal, int trap_code)
&linux; binary as it might harm things.</para>
</sect3>
- <sect3 id="linux-proc-thread">
+ <sect3 xml:id="linux-proc-thread">
<title>&linux; processes and thread identifiers</title>
<para>The semantics of &linux; threading are a little confusing and
@@ -1572,7 +1565,7 @@ translate_traps(int signal, int trap_code)
later.</para>
</sect3>
- <sect3 id="pid-mangling">
+ <sect3 xml:id="pid-mangling">
<title>PID mangling</title>
<para>Because of the described different view knowing what a process
@@ -1592,7 +1585,7 @@ translate_traps(int signal, int trap_code)
<function>child_set_tid</function> we copy out &os; PID.</para>
</sect3>
- <sect3 id="clone-syscall">
+ <sect3 xml:id="clone-syscall">
<title>Clone syscall</title>
<para>The <function>clone</function> syscall is the way threads are
@@ -1654,7 +1647,7 @@ void * child_tidptr);</programlisting>
to implement &man.fork.2; and &man.vfork.2; syscalls.</para>
</sect3>
- <sect3 id="locking">
+ <sect3 xml:id="locking">
<title>Locking</title>
<para>The locking is implemented to be per-subsystem because we do not
@@ -1671,13 +1664,13 @@ void * child_tidptr);</programlisting>
</sect3>
</sect2>
- <sect2 id="tls">
+ <sect2 xml:id="tls">
<title>TLS</title>
<para>This section deals with TLS also known as thread local
storage.</para>
- <sect3 id="trheading-intro">
+ <sect3 xml:id="trheading-intro">
<title>Introduction to threading</title>
<para>Threads in computer science are entities within a process that
@@ -1717,7 +1710,7 @@ void * child_tidptr);</programlisting>
switches.</para>
</sect3>
- <sect3 id="i386-segs">
+ <sect3 xml:id="i386-segs">
<title>Segments on i386</title>
<para>The i386 architecture implements the so called segments. A
@@ -1743,7 +1736,7 @@ void * child_tidptr);</programlisting>
Both tables define up to 8191 entries.</para>
</sect3>
- <sect3 id="linux-i386">
+ <sect3 xml:id="linux-i386">
<title>Implementation on &linux; i386</title>
<para>There are two main ways of setting up TLS in &linux;. It can be
@@ -1761,10 +1754,10 @@ void * child_tidptr);</programlisting>
emulation and in fact depend on it.</para>
</sect3>
- <sect3 id="tls-emu">
+ <sect3 xml:id="tls-emu">
<title>Emulation of &linux; TLS</title>
- <sect4 id="tls-i386">
+ <sect4 xml:id="tls-i386">
<title>i386</title>
<para>Loading of TLS for the current thread happens by calling
@@ -1799,7 +1792,7 @@ void * child_tidptr);</programlisting>
plain &os;.</para>
</sect4>
- <sect4 id="tls-amd64">
+ <sect4 xml:id="tls-amd64">
<title>amd64</title>
<para>The amd64 implementation is similar to the i386 one but there
@@ -1814,10 +1807,10 @@ void * child_tidptr);</programlisting>
</sect3>
</sect2>
- <sect2 id="futexes">
+ <sect2 xml:id="futexes">
<title>Futexes</title>
- <sect3 id="sync-intro">
+ <sect3 xml:id="sync-intro">
<title>Introduction to synchronization</title>
<para>Threads need some kind of synchronization and &posix; provides
@@ -1847,7 +1840,7 @@ void * child_tidptr);</programlisting>
threaded programs show little locks contention.</para>
</sect3>
- <sect3 id="futex-intro">
+ <sect3 xml:id="futex-intro">
<title>Futexes introduction</title>
<para>&linux; implements 1:1 threading, i.e. it has to use in-kernel
@@ -1872,7 +1865,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
implementation.</para>
</sect3>
- <sect3 id="futex-api">
+ <sect3 xml:id="futex-api">
<title>Futex API</title>
<para>The futex syscall looks like this:</para>
@@ -1907,7 +1900,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
</listitem>
</itemizedlist>
- <sect4 id="futex-wait">
+ <sect4 xml:id="futex-wait">
<title>FUTEX_WAIT</title>
<para>This operation verifies that on address
@@ -1919,7 +1912,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
otherwise the sleeping is infinite.</para>
</sect4>
- <sect4 id="futex-wake">
+ <sect4 xml:id="futex-wake">
<title>FUTEX_WAKE</title>
<para>This operation takes a futex at <varname>uaddr</varname>
@@ -1927,14 +1920,14 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
on this futex.</para>
</sect4>
- <sect4 id="futex-fd">
+ <sect4 xml:id="futex-fd">
<title>FUTEX_FD</title>
<para>This operations associates a file descriptor with a given
futex.</para>
</sect4>
- <sect4 id="futex-requeue">
+ <sect4 xml:id="futex-requeue">
<title>FUTEX_REQUEUE</title>
<para>This operation takes <varname>val</varname> threads
@@ -1943,7 +1936,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
on futex at <varname>uaddr2</varname>.</para>
</sect4>
- <sect4 id="futex-cmp-requeue">
+ <sect4 xml:id="futex-cmp-requeue">
<title>FUTEX_CMP_REQUEUE</title>
<para>This operation does the same as
@@ -1952,7 +1945,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
first.</para>
</sect4>
- <sect4 id="futex-wake-op">
+ <sect4 xml:id="futex-wake-op">
<title>FUTEX_WAKE_OP</title>
<para>This operation performs an atomic operation on
@@ -1995,7 +1988,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
</sect4>
</sect3>
- <sect3 id="futex-emu">
+ <sect3 xml:id="futex-emu">
<title>Futex emulation in &os;</title>
<para>The futex emulation in &os; is taken from NetBSD and further
@@ -2023,7 +2016,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
TAILQ_ENTRY(waiting_proc) wp_list;
};</programlisting>
- <sect4 id="futex-get">
+ <sect4 xml:id="futex-get">
<title>futex_get / futex_put</title>
<para>A futex is obtained using the <function>futex_get</function>
@@ -2034,7 +2027,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
reaches zero it is released.</para>
</sect4>
- <sect4 id="futex-sleep">
+ <sect4 xml:id="futex-sleep">
<title>futex_sleep</title>
<para>When a futex queues a thread for sleeping it creates a
@@ -2050,7 +2043,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
the actual requeueing is done in this function.</para>
</sect4>
- <sect4 id="futex-wake-2">
+ <sect4 xml:id="futex-wake-2">
<title>futex_wake</title>
<para>Waking up a thread sleeping on a futex is performed in the
@@ -2065,7 +2058,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
<function>futex_sleep</function>.</para>
</sect4>
- <sect4 id="futex-wake-op-2">
+ <sect4 xml:id="futex-wake-op-2">
<title>futex_wake_op</title>
<para>The <literal>FUTEX_WAKE_OP</literal> operation is quite
@@ -2078,7 +2071,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
<varname>timeout</varname>) waiter on the second futex.</para>
</sect4>
- <sect4 id="futex-atomic-op">
+ <sect4 xml:id="futex-atomic-op">
<title>futex atomic operation</title>
<para>The atomic operation takes two parameters
@@ -2097,7 +2090,7 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
<varname>cmparg</varname> argument with cmp comparator.</para>
</sect4>
- <sect4 id="futex-locking">
+ <sect4 xml:id="futex-locking">
<title>Futex locking</title>
<para>Futex implementation uses two lock lists protecting
@@ -2108,14 +2101,14 @@ pthread_mutex_unlock(&amp;mutex);</programlisting>
</sect3>
</sect2>
- <sect2 id="syscall-impl">
+ <sect2 xml:id="syscall-impl">
<title>Various syscalls implementation</title>
<para>In this section I am going to describe some smaller syscalls that
are worth mentioning because their implementation is not obvious or
those syscalls are interesting from other point of view.</para>
- <sect3 id="syscall-at">
+ <sect3 xml:id="syscall-at">
<title>*at family of syscalls</title>
<para>During development of &linux; 2.6.16 kernel, the *at syscalls
@@ -2168,7 +2161,7 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
using the modified &man.namei.9; routine and simple
wrapping layer.</para>
- <sect4 id="implementation">
+ <sect4 xml:id="implementation">
<title>Implementation</title>
<para>The implementation is done by altering the
@@ -2194,7 +2187,7 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
levels. For example the <function>openat</function> goes like
this:</para>
- <programlisting>openat() --> kern_openat() --> vn_open() -> namei()</programlisting>
+ <programlisting>openat() --&gt; kern_openat() --&gt; vn_open() -&gt; namei()</programlisting>
<para>For this reason <function>kern_open</function> and
<function>vn_open</function> must be altered to incorporate
@@ -2206,7 +2199,7 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
</sect4>
</sect3>
- <sect3 id="ioctl">
+ <sect3 xml:id="ioctl">
<title>Ioctl</title>
<para>The ioctl interface is quite fragile due to its generality.
@@ -2234,7 +2227,7 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
because of the easy porting of applications.</para>
</sect3>
- <sect3 id="debugging">
+ <sect3 xml:id="debugging">
<title>Debugging</title>
<para>Every syscall should be debuggable. For this purpose we
@@ -2246,10 +2239,10 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
</sect2>
</sect1>
- <sect1 id="conclusion">
+ <sect1 xml:id="conclusion">
<title>Conclusion</title>
- <sect2 id="results">
+ <sect2 xml:id="results">
<title>Results</title>
<para>As of April 2007 the &linux; emulation layer is capable of
@@ -2267,9 +2260,9 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
stuff.</para>
<para>We are able to run the most used applications like
- <filename role="package">www/linux-firefox</filename>,
- <filename role="package">www/linux-opera</filename>,
- <filename role="package">net-im/skype</filename> and some games from
+ <package>www/linux-firefox</package>,
+ <package>www/linux-opera</package>,
+ <package>net-im/skype</package> and some games from
the Ports&nbsp;Collection. Some of the programs exhibit bad behaviour
under 2.6 emulation but this is currently under investigation and
hopefully will be fixed soon. The only big application that is
@@ -2284,7 +2277,7 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
Fedora&nbsp;Core&nbsp;6 linux_base, which is the ultimate plan.</para>
</sect2>
- <sect2 id="future-work">
+ <sect2 xml:id="future-work">
<title>Future work</title>
<para>Future work should focus on fixing the remaining issues with
@@ -2310,7 +2303,7 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
improvements can also be made, finer grained locking and others.</para>
</sect2>
- <sect2 id="team">
+ <sect2 xml:id="team">
<title>Team</title>
<para>I cooperated on this project with (in alphabetical order):</para>
@@ -2350,7 +2343,7 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
</sect2>
</sect1>
- <sect1 id="literatures">
+ <sect1 xml:id="literatures">
<title>Literatures</title>
<orderedlist>
@@ -2360,13 +2353,13 @@ openat(stdio, bah\, flags, mode) /* returns error because stdio is not a directo
2005.</para>
</listitem>
<listitem>
- <para><ulink url="http://www.FreeBSD.org"></ulink></para>
+ <para><uri xlink:href="http://www.FreeBSD.org">http://www.FreeBSD.org</uri></para>
</listitem>
<listitem>
- <para><ulink url="http://tldp.org"></ulink></para>
+ <para><uri xlink:href="http://tldp.org">http://tldp.org</uri></para>
</listitem>
<listitem>
- <para><ulink url="http://www.linux.org"></ulink></para>
+ <para><uri xlink:href="http://www.linux.org">http://www.linux.org</uri></para>
</listitem>
</orderedlist>
</sect1>