Re: Newbie question regarding ports

From: Andrew Valencia <vandys_at_nospam.org>
Date: Fri Apr 28 1995 - 08:26:35 PDT

[erewhon@dsg.com (Steven Byrnes) writes:]

>I was trying to write a little program that output to some of the I/O ports
>but didn't have any luck. From browsing the machine-dependent server code,
>I see that it is possible. Are only servers allowed to do it? What is the
>minimal incantation necessary to write to (or read from) an I/O port? Am I
>doing something wrong?

main()
{
        enable_io(<low-port>, <high-port>);
        outportb(<port>, <val>);
}

Make sure you're in sys.sys group, otherwise the kernel won't allow the
io_enable(). I could've included error checking in the example, but you
*did* say minimal!

                                                Andy
Received on Fri Apr 28 07:33:46 1995

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:27 PDT