Using inb() and outb()

Robert Bonomi bonomi at
Tue May 22 21:06:22 UTC 2012

> From owner-freebsd-questions at  Tue May 22 15:18:43 2012
> Date: Tue, 22 May 2012 13:13:35 -0700
> From: "Thomas D. Dean" <tomdean at>
> To: freebsd-questions at
> 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.

More information about the freebsd-questions mailing list