README for XFree86 4.2.1 on NetBSD : Kernel Support for X
Previous: Running X
Next: Rebuilding the XFree86 Distribution

7. Kernel Support for X

To make sure X support is enabled under NetBSD, the following line must be in your config file in /sys/arch/i386/conf:

options XSERVER, UCONSOLE

7.1. Console drivers

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.

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

The pcvt console driver was bundled with NetBSD until 1.4. 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:

device pc0 at isa? port "IO_KBD" irq 1

to

device vt0 at isa? port "IO_KBD" irq 1

in your kernel config file, and rebuild and install your kernel.

Wscons is the current console driver, included in NetBSD 1.4 and later. For now, XFree86 supports wscons using the pcvt compatibility mode, so be sure to have the lines:

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
in your kernel configuration file if you're using wscons. Refer to the wscons(4) and wsmouse(4) manual pages for informations on how to configure wscons into the kernel.

7.2. Aperture Driver

By default NetBSD include the BSD 4.4 kernel security feature that disable access to the /dev/mem device when in multi-users mode. But XFree86 servers can take advantage (or require) linear access to the display memory.

Most XFree86 4.2.1 card drivers require linear memory access. There are two ways to allow XFree86 to access linear memory:

The first way is to disable the kernel security feature by adding ``option INSECURE'' in the kernel configuration file and build a new kernel.

The second way is to install the aperture driver, included in source form in xc/programs/Xserver/hw/xfree86/etc/apNetBSD.shar in the XFree86 4.2.1 source distribution. Unpack it in a new directory of your choice by running:

  sh apNetBSD.shar
By default the aperture driver will be installed in /usr/local/aperture. You can change this default directory by editing Makefile.inc before building it.

Then run ``make build'' as root to install it. To enable it, add the following line to /etc/lkm.conf:

/usr/local/aperture/lkm/xf86.o  -  - /usr/local/aperture/lkm/xf86_mod_install - -
and set ``lkm=YES'' in /etc/rc.conf

Reboot your system. XFree86 will auto-detect the aperture driver if available.

Warning 1: if you boot another kernel than /netbsd, loadable kernel modules can crash your system. Always boot in single user mode when you want to run another kernel.

Warning 2: 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.

Starting with XFree86 3.9.17, the XFree86 aperture driver also supports MTRR write combining on Pentiums II and AMD K6 class processors.

7.3. MIT-SHM

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.

To add support for system V shared memory to your kernel add the lines:

 # System V-like IPC
 options         SYSVMSG
 options         SYSVSEM
 options         SYSVSHM

to your kernel config file.


README for XFree86 4.2.1 on NetBSD : Kernel Support for X
Previous: Running X
Next: Rebuilding the XFree86 Distribution