*BSD News Article 58574


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!news.kei.com!news.mathworks.com!fu-berlin.de!zrz.TU-Berlin.DE!zib-berlin.de!news.tu-chemnitz.de!irz401!uriah.heep!news
From: j@uriah.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: ioperm call on FreeBSD?
Date: 30 Dec 1995 21:04:45 GMT
Organization: Private BSD site, Dresden
Lines: 29
Message-ID: <4c49he$f8v@uriah.heep.sax.de>
References: <DKEMoG.C19@midway.uchicago.edu>
Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch)
NNTP-Posting-Host: localhost.heep.sax.de
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: knews 0.9.3

Tim Pierce <twpierce@midway.uchicago.edu> writes:
> There is apparently a Linux `ioperm' system call that is used to
> set permissions on various I/O ports.  I'm afraid I have no idea
> what this call does or how it works, but I'm attempting to port
> some software that makes use of it, so I'm curious whether FreeBSD
> provides any analogous facility, or whether the BSD version of the
> code should take any action where Linux would use ioperm.

FreeBSD doesn't provide the fine-grain IO permission control Linux
has.  It is done there by the io permission bits in the extended task
state segment.  (However, it's usually limited to IO addresses < 0x400
anyway.)

The only way on FreeBSD is to open /dev/io, which will grant the
process access to any and all IO registers (the permissions of /dev/io
should be fairly restrictive, in order to prevent abusing it).  Be
careful with your application, triple-check that all IO accesses are
to the intented ports.

(If you can, the better way is writing a device driver that performs
the low-level interface part inside the kernel, while the user-level
interface is being separated.)

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)