<!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="NetBSD.html"><EM>README for XFree86 on NetBSD</EM></A>
 <b>:</b> <EM>Kernel Support for X</EM><BR>
<b>Previous:</b> <A HREF="NetBSD7.html"><EM>Running X</EM></A><BR>
<b>Next:</b> <A HREF="NetBSD9.html"><EM>Rebuilding the XFree86 Distribution</EM></A>


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

<H3><A NAME="13"></A>8.1. Console drivers</H3>
<p>The server supports the standard NetBSD/i386
console drivers: pccons, pcvt and wscons (in pcvt compatibility
mode). They are detected at runtime and no 
configuration of the server itself is required.</p>

<p>The pccons driver is the most widely tested and is the console driver
contained in the NetBSD binary distribution's kernels.</p>

<p>The pcvt console driver is bundled with NetBSD. The pcvt X
mode is compatible with the pccons driver X mode. It offers several
virtual consoles and international keyboard support. In order to use
this driver, change the line:</p>
<p>
<blockquote><code>
device          pc0     at isa? port "IO_KBD" irq 1
</code></blockquote>
</p>
<p>to</p>
<p>
<blockquote><code>
device         vt0     at isa? port "IO_KBD" irq 1
</code></blockquote>
</p>
<p>in your kernel config file, and rebuild and install your kernel.</p>

<p>
<A NAME="wscons"></A>
XFree86 will also run with the wscons console driver in
NetBSD 1.4. For now, it uses the pcvt compatibility mode, so be
sure to have the lines:
<blockquote><code>
<pre>
options         WSDISPLAY_COMPAT_PCVT           # emulate some ioctls
options         WSDISPLAY_COMPAT_SYSCONS        # emulate some ioctls
options         WSDISPLAY_COMPAT_USL		# VT handling
options         WSDISPLAY_COMPAT_RAWKBD         # can get raw scancodes
</pre>
</code></blockquote>

in your kernel configuration file if you're using wscons. Refer to the 
<em>wscons(4)</em> and <em>wsmouse(4)</em> manual pages for
informations on how to configure wscons into the kernel.</p>

<H3><A NAME="14"></A>8.2. Aperture Driver</H3>
<p>By default NetBSD 0.9C and higher include 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>Moset recent accelerated servers require linear memory access, some
other can take advantage of it, but do not require it.</p>
<p>There are two ways to allow XFree86 to access linear memory:</p>
<p>The first way is to disable the kernel security feature by adding
`option INSECURE' in the kernel configuration file and build a new
kernel.</p>

<p>The second way is to install the aperture driver:
You can get the aperture driver sources from 
<A href="ftp://ftp.netbsd.org/pub/NetBSD/arch/i386/apNetBSD.shar">ftp://ftp.netbsd.org/pub/NetBSD/arch/i386/apNetBSD.shar</A>.</p>
<p>How to activate it is highly dependent from your exact operating
system version:
<ul>
<li> NetBSD 1.0, 1.1, 1.2, 1.2.1:
<p>Add the following lines to the end of <code>/etc/rc.local</code>:
<blockquote><code>
<pre>
 KERNDIR=/usr/X11R6/lib/X11/kernel
 if [ -f ${KERNDIR}/ap.o ]; then
   modload -o ${KERNDIR}/ap -e ap -p ${KERNDIR}/apinstall ${KERNDIR}/ap.o
 fi
</pre>
</code></blockquote>
</p>

</li>
<li> NetBSD 1.2D and later
<p>Add the following line to  <code>/etc/lkm.conf</code>:
<blockquote><code>
<pre>
/usr/X11R6/lib/X11/kernel/ap.o  -  ap /usr/X11R6/lib/X11/kernel/apinstall - 
</pre>
</code></blockquote>
 </p>

</li>
<li> NetBSD 1.2G, 1.3 and later
<p>The <code>lkm.conf</code> format changed in 1.2G. 
Add the following line to  <code>/etc/lkm.conf</code>:
<blockquote><code>
<pre>
/usr/X11R6/lib/X11/kernel/ap.o  -  ap /usr/X11R6/lib/X11/kernel/apinstall - -AFTERMOUNT
</pre>
</code></blockquote>
 </p>
</li>
</ul>
</p>
<p>Reboot your system. XFree86 will auto-detect the aperture
driver if available.</p>
<p><b>Warning:</b> if you boot another kernel than <code>/netbsd</code> or
<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>


<H3><A NAME="15"></A>8.3. MIT-SHM</H3>
<p>NetBSD 1.0 and later 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="NetBSD.html"><EM>README for XFree86 on NetBSD</EM></A>
 <b>:</b> <EM>Kernel Support for X</EM><BR>
<b>Previous:</b> <A HREF="NetBSD7.html"><EM>Running X</EM></A><BR>
<b>Next:</b> <A HREF="NetBSD9.html"><EM>Rebuilding the XFree86 Distribution</EM></A>



</BODY>
</HTML>
