Subject: Re: inb, outb, i386_set_ioperm and such
To: None <tech-userlevel@netbsd.org>
From: Bruce J.A. Nourish <bjan@bjan.freeshell.org>
List: tech-userlevel
Date: 03/28/2004 15:36:01
On Sun, Mar 28, 2004 at 04:25:19PM -0600, Dave Huang wrote:
> On Sun, Mar 28, 2004 at 04:20:54PM -0600, Dave Huang wrote:
> > On Sun, Mar 28, 2004 at 08:25:06AM -0700, Bruce J.A. Nourish wrote:
> > > * Given "from" and "num", two integers that describe a range of ports
> > >   to open up for inb/outb access, does the following code set up the
> > >   iomap correctly?
> > > 
> > >   for (i = 0; i < num; ++i)
> > >        iomap[(from + num) / 32] |= 1 << (from + num) % 32;
> > 
> > Shouldn't "i" be in that loop somewhere? s/from + num/from + i/g
> 
> Oh, and permission is granted if the bit is clear, not set. So you
> should call i386_get_ioperm() first to get the current permission map,
> then:

Thanks for pointing this out. I actually switched to using Jachym 
Holecek's code posted earlier, although I'm still having problems,
which I'll describe in another thread.
-- 
Bruce J.A. Nourish <bjan@bjan.freeshell.org> http://bjan.freeshell.org
SDF Public Access UNIX System - http://sdf.lonestar.org