Port Access

Steve Friedl friedl at mtndew.UUCP
Sun Jan 7 07:32:35 AEST 1990


Kirk Trost asks:
>Is there an easy way to access 386 ports using C under UNIX.

Scott Amspoker replies:
> I would be very surprised if UNIX system allowed a user process
> to access ports directly.

Surprise!

General-purpose access to I/O ports is not supported, but there
is limited access to display-related ports.  <sys/kd.h> contains
a handful of what are referred to as "VP/ix reserved ioctls", and
two are

/* VP/ix reserved ioctls */
#define KDENABIO	(KIOC|60)	/* enable direct I/O to ports */
#define KDDISABIO	(KIOC|61)	/* disable direct I/O to ports */

The third arg to ioctl is not used.  I am not sure exactly which
I/O addresses are permitted, but I do know that the port input
and output instructions work for some ports (the display, probably)
while they don't work for others.

     Steve

-- 
Stephen J. Friedl, KA8CMY   /  Consultant   /   Tustin, CA  /  3B2-kind-of-guy
714 544 6561 voice /  714 544 6496 fax  / uunet!mtndew!friedl / friedl at vsi.com

"PostScript wizard in training." - me



More information about the Comp.lang.c mailing list