i386 UNIX driver which allows user level inb's and outb's

Dick Dunn rcd at ico.isc.com
Tue Jan 9 14:34:35 AEST 1990


brian at apt.UUCP (Brian Litzinger) writes:
> here is a complete driver written for ISC System V.3.2 UNIX on a
> 386 PC like machine that allows user level programs to access IO ports.

I didn't see the point.  Perhaps the documentation is lacking, or Brian
missed something, but there's already provision in 386/ix for letting
user-level programs do in()s and out()s.  Moreover, it's a lot faster than
using a driver, since the I/O ports are accessed directly rather than
through kernel calls.

For access to displays, there are ioctl()s to get access to their I/O
ports.  There's also a sysi86 call that gives general access.  Have a look
in /usr/include/sys at sysi86.h, kd.h, and inline.h (which contains the
asm()s you'll need).

The same warning Brian gave applies to these as well:
> ...This driver makes a rather
> big security hole in your system so you will probably want to
> seriously restrict access...
> ...Otherwise, all sorts of users may be
> peeking and poking where you don't want them to...

The sysi86 call is obviously restricted to root.  The kd ioctl()s are not
so restricted, but even though they only give you access to the display,
that's enough power to completely curdle your display.  (I know; I did it
eleven (!) times today...:-)
-- 
Dick Dunn     rcd at ico.isc.com    uucp: {ncar,nbires}!ico!rcd     (303)449-2870
   ...Mr. Natural says, "Use the right tool for the job."



More information about the Comp.unix.i386 mailing list