# $OpenBSD: README,v 1.1 1996/03/05 11:25:27 mickey Exp $ XFree86 Framebuffer aperture driver for NetBSD. ----------------------------------------------- This module was written to help work around the security feature of NetBSD 0.9C and later that prevents read/write access to /dev/mem. XFree86 can take advantage of having direct access to video memory (especially with VLB and PCI cards) and even requires it for the P9000 server. This driver works like the standard /dev/mem driver. It just allows mapping of the VGA framebuffer even if kernel security level is > 0. The driver only implements the open(), close() and mmap() calls. In order not to defeat kernel security, only one open() at a time is allowed and only a process with effective user id of 0 can perform it. So while you're running XFree86, no other process will be allowed to open /dev/xf86. This work is heavily inspired from the Solaris x86 aperture driver by Doug Anson (danson@lgc.com) and David Holland (davidh@use.com). Installation: ------------- 1. Edit the Makefile if you want to modify the default installation directory. 2. run make depend && make; then as root, run make install. 3. add these lines somehere at the end of /etc/rc.local (before the sysctl that raises the security level): 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 to load the driver at bootime. 4. Reboot your system. 5. If you're running a version prior to NetBSD 1.0, modload does not execute post-install scripts. So you have to create the device manually. If you're running NetBSD 1.0 or later, skip this. WARNING: be sure to understand what you'll do before proceeding a) find out what major device number will be allocated to you by modload. Modload allocates major numbers beginning at 29. So if 'ap' is your only device driver module, it will have major number 29. If it's the third, it will be 31... b) goto the /dev directory and type ``mknod xf86 c 29 0'' (replace 29 by the appropriate value if you load more than one device driver module. Make sure that rc.local loads the module every time at the same position as it did now. 6. Test the module by running 'aptest' as root. The outpout will look like: # ./aptest NOTICE: VGA mapped [0xa0000 ,size=4096) to addr=0x10073000... DONE displaying memory contents (80 bytes) UNMAPPING [0xa0000 ,size=4096) to addr=0x10073000... and closing...DONE. Exiting successful... 7. If you're running XFree86 3.1 or higher, just make sure that HasNetBSDApertureDriver is set to YES in xf86site.def before building your server. The netBSD binary distribution has the aperture driver code enabled. Bug reports, comments, suggestions can be sent to matthieu@laas.fr --Matthieu Herrb ---------------------------------------------------------------------- Copyright (c) 1994 The XFree86 Project Inc.