<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Kernel Support for X</TITLE>
</HEAD>
<BODY BGCOLOR="#efefef" TEXT="black" LINK="blue" VLINK="#551A8B" ALINK="red">

<A HREF="OpenBSD.html"><EM>README for XFree86 on OpenBSD</EM></A>
 <b>:</b> <EM>Kernel Support for X</EM><BR>
<b>Previous:</b> <A HREF="OpenBSD7.html"><EM>Running X</EM></A><BR>
<b>Next:</b> <A HREF="OpenBSD9.html"><EM>Rebuilding the XFree86 Distribution</EM></A>


<HR NOSHADE>
  <H2><A NAME="13"></A>8. Kernel Support for X</H2>
<p>To make sure X support is enabled under  OpenBSD, the following
line must be in your config file in <code>/sys/arch/i386/conf</code>:</p>
<p>
<blockquote><code>
options XSERVER
</code></blockquote>
</p>

<H3><A NAME="14"></A>8.1. Console drivers</H3>
<p>The server supports the two standard  OpenBSD/i386
console drivers: pccons and pcvt. They are detected at runtime and no
configuration of the server itself is required.</p>

<p>The pcvt console driver is the default in OpenBSD.  It offers
several virtual consoles and international keyboard support. </p>


<H3><A NAME="15"></A>8.2. Aperture Driver</H3>
<p>By default OpenBSD includes the BSD 4.4 kernel security
feature that disable access to the <code>/dev/mem</code> device when in
multi-users mode. But XFree86 servers can take advantage (or require)
linear access to the display memory.</p>
<p>The P9000, Mach64 and AGX servers require linear memory access, other
accelerated servers can take advantage of it, but do not require it.
Some drivers in the SVGA server require linear memory access too,
notably the Matrox driver.</p>
<p>The preferred  way to allow XFree86 to access linear memory is to use
the aperture driver </p>
<p>Ths step is highly dependent from your exact operating
system version:
<ul>
<li> OpenBSD 2.0
    
Use the aperture driver from /usr/lkm: 
    
add the following lines to the end of <code>/etc/rc.local</code>:
<blockquote><code>
<pre>
 KERNDIR=/usr/lkm
 if [ -f ${KERNDIR}/ap.o ]; then
   modload -o ${KERNDIR}/ap -e ap -p \
   ${KERNDIR}/apinstall ${KERNDIR}/ap.o
 fi
</pre>
</code></blockquote>

</li>
<li> OpenBSD 2.1, 2.2
    
Uncomment the lines loading the aperture driver from
<code>/etc/rc.securelevel</code> 
</li>
<li> OpenBSD 2.3
     
The aperture driver is part of the kernel.  Add 'option APERTURE' to
your kernel configuration file, build and install the new kernel and
run <code>./MAKEDEV std</code> in <code>/dev</code>. Edit
<code>/etc/sysctl.conf</code> to set the variable
<b>machdep.allowaperture</b> to 1.
</li>
<li> OpenBSD 2.4 and later

OpenBSD now requires the aperture driver to be enabled for all X
servers, because the aperture driver also controls access to the
I/O ports of the video boards.
</li>
</ul>
</p>
<p>After doing that, reboot your system. XFree86 will auto-detect the
aperture driver if available.</p>

<p><b>Warning:</b> if you boot another kernel than <code>/bsd</code>,
loadable kernel modules can crash your system. Always boot in
single user mode when you want to run another kernel.</p>

<p>
<blockquote>
<b>Caveat:</b> the aperture driver only allows one access at a time
(so that the system is in the same security state once X is
launched). This means that if you run multiple servers on multiples
VT, only the first one will have linear memory access.  Use 'option
INSECURE' if you need more that one X server at a time.
</blockquote>
</p>

<p>Another (less recommended) way to enable linear memory access is to
disable the kernel security feature by adding ``option INSECURE'' in
your kernel configuration file and build a new kernel.  In OpenBSD 2.2
and later, you will also need to comment out the line initializing
<code>securelevel</code> to 1 in <code>/etc/rc.securelevel</code>.</p>

<H3><A NAME="16"></A>8.3. MIT-SHM</H3>
<p>OpenBSD supports System V shared memory. If XFree86 
detects this support in your kernel, it will support the MIT-SHM
extension.</p>
<p>To add support for system V shared memory to your kernel add the
lines:</p>
<p>
<blockquote><code>
<pre>
 # System V-like IPC
 options         SYSVMSG
 options         SYSVSEM
 options         SYSVSHM
</pre>
</code></blockquote>
</p>
<p>to your kernel config file. </p>

 <HR NOSHADE>
<A HREF="OpenBSD.html"><EM>README for XFree86 on OpenBSD</EM></A>
 <b>:</b> <EM>Kernel Support for X</EM><BR>
<b>Previous:</b> <A HREF="OpenBSD7.html"><EM>Running X</EM></A><BR>
<b>Next:</b> <A HREF="OpenBSD9.html"><EM>Rebuilding the XFree86 Distribution</EM></A>



</BODY>
</HTML>
