summaryrefslogtreecommitdiff
path: root/lkm/ap/README
blob: 3103f1204c506f514fddff818e8e06b93f9c3f2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#	$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.