Subject: Re: XFree86
To: Mark Willey <mwilley@hillres142.cc.purdue.edu>
From: John Evans <john@hillnet.com>
List: current-users
Date: 01/18/1995 20:31:11
On Wed, 18 Jan 1995, Mark Willey wrote:

> Rob Windsor writes:
> > 
> > Verily did John Evans write:
> > 
> > [more removed...]
> > > checkDevMem: warning: failed to open /dev/mem (Operation not permitted)
> > > 	trying aperture driver
> > > checkDevMem: warning: failed to open /dev/xf86 (No such file or directory)
> > > 	linear fb access unavailable
> 
> I am also getting this error.  The su workaround didn't seem to do
> anything...  Does anyone else get thie /dev/mem not permitted in thier
> error file?

This error was something I was aware of and turned out not to be the problem
(in case you didn't get my other message, everything is up and working
now)... 

Here's the quote from the README that explains these errors:

           README for XFree86 3.1 on NetBSD 1.0_BETA
           -----------------------------------------

[clip]

    Aperture Driver
    =-------------=

By default NetBSD 0.9C and higher include a 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.

The P9000 and AGX servers require linear memory access, other
accelerated servers can take advantage of it, but do not require it.

There are two ways to allow XFree86 to access linear memory:

1. Disable the kernel security feature by initializing the
   `securelevel' variable to -1 in /sys/kern/kern_sysctl.c, line 205
   and building a new kernel. For more informations, see the comments
   in /usr/include/sys/systm.h.

2. Install the NetBSD aperture driver: 

   a) add the following lines to the end of /etc/rc.local:

	if [ -f /usr/X11R6/lib/X11/kernel/ap.o ]; then
	    echo  'loading ap driver'
    	    modload -o /usr/X11R6/lib/X11/kernel/ap -e ap \
		/usr/X11R6/lib/X11/kernel/ap.o
	fi

   b) Since NetBSD modload does not execute post-install scripts, create
      the device manually:
  
      WARNING: be sure to understand what you'll do before proceeding

      i) 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...

     ii) 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.

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

   Caveat: the NetBSD 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.

    MIT-SHM
    =-----= 

NetBSD 1.0_BETA supports System V shared memory. If XFree86 3.1 detects
this support in your kernel, it will support the MIT-SHM extension.

    Under NetBSD 1.0_BETA, use the following to add shared memory
    support to your kernel:

    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. Then from /sys/arch/i386/config, type

	# rm -f ../compile/<KERNEL-NAME>/*
	# config <KERNEL-NAME>
	# cd ../compile/<KERNEL-NAME>
	# make depend 
	# make

    Then install your new kernel and re-boot:

	# cp /netbsd /onetbsd
	# cp netbsd /
	# reboot

[clip]

$XFree86: xc/programs/Xserver/hw/xfree86/doc/README.NetBSD,v 3.7 1994/10/03 08:28:52 dawes Exp $

Hope this helps.

-
John