Date: Tue, 22 May 2012 16:08:04 -0500 (CDT) From: Robert Bonomi <bonomi@mail.r-bonomi.com> To: freebsd-questions@freebsd.org, tomdean@speakeasy.org Subject: Re: Using inb() and outb() Message-ID: <201205222108.q4ML84Zc070244@mail.r-bonomi.com> In-Reply-To: <4FBBF36F.9000804@speakeasy.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> From owner-freebsd-questions@freebsd.org Tue May 22 15:18:43 2012 > Date: Tue, 22 May 2012 13:13:35 -0700 > From: "Thomas D. Dean" <tomdean@speakeasy.org> > To: freebsd-questions@freebsd.org > Subject: Using inb() and outb() > > I have nanoBSD running a hardware control application. > > To do this, I need inb() and outb() functions. > > I an do this as root. However, it is better if none of the control > system is run as root. > > How do I allow these functions to one specific user? To do that, you would have to re-build a significant portion of the security controls of the O/S. Good luck. 'regular' users are simply -not- allowed to acces hardware I/O ports directly. Only the 'superuser' can do that. Thus, to use inb()/outb() the application must be running with EUID 0. No other options. If you don't want the application to run as root, The only other option is to write an actual 'device driver' -- which would execute as part of the kernel -- that provides the required functionality to the app, and does the actual hardware port IN/OUT operations iself, inside the driver.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205222108.q4ML84Zc070244>