Subject: [Q] How is access to 386 io instructions controlled in user program ?
To: Gary Henderson <garyh@wet.sbi.com>
From: Matthieu Herrb <matthieu@laas.fr>
List: port-i386
Date: 06/17/1995 15:45:26
You wrote (in your message from Wed 14)
 > The subject line says it all.
 > 
 > I've compiled a XFree86 3.11 X server on my 1.0A system, intending to fix
 > a couple of bugs I've seen when running NetBSD on my i486 100Mhz portable.
 > 
 > The trouble is the freshly compiled X server bus errors when tring to do
 > outb instructions to the video controller. The XFree86 bsd i/o permisson
 > code says something about bsd systems allowing access to i/o instructions 
 > if the user program has opened the console or something.
 > 
 > Does any one have any ideas what the problem might be ?
 > 
 > Yes, the server is running setuid root. The super vga X server that came
 > precompiled with the XFree86 binary distribution works fine but can
 > only access 512K of my machine's 1Mb video RAM.
 > 
 > The XFree86 super vga server compiled ok, but I did have to disable support
 > for virtual consoles due to a missing header file; could this be the
 > problem ?
 > 
 > Where in the kernel are i/o instruction permissions handled ?

i/o permission is granted to the X server by the
ioctl(.,X_MODE_ON,...) call. Look at /sys/arch/i386/isa/pccons.c for
how it is done.

Another way to achieve that that is to open /dev/io. But that's not
the way used by XFree86.

Your problem can have various sources, for example an inconsistency
between the console drivers known by your X server and the one you
use. 

Could you send the output of your server startup ?


BTW the "missing" console drivers include files (console.h and
ioctl_pc.h) are included in the XFree86 source. Just read
README.NetBSD for how to install them on your system.


					Matthieu