Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!ames!ncar!ico!rcd From: rcd@ico.isc.com (Dick Dunn) Newsgroups: comp.unix.i386 Subject: Re: i386 UNIX driver which allows user level inb's and outb's Summary: Why? Message-ID: <1990Jan9.033435.17468@ico.isc.com> Date: 9 Jan 90 03:34:35 GMT References: <1737@apt.UUCP> Organization: Interactive Systems Corporation, Boulder, CO Lines: 29 brian@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@ico.isc.com uucp: {ncar,nbires}!ico!rcd (303)449-2870 ...Mr. Natural says, "Use the right tool for the job."