Subject: Re: user space hw io: final
To: Frederick Bruckman <fredb@immanent.net>
From: Peter L. Peres <plp@actcom.co.il>
List: port-i386
Date: 12/24/2004 22:41:03
On Fri, 24 Dec 2004, Frederick Bruckman wrote:

> In article <Pine.LNX.4.60.0412240140480.10955@cyc.cyc.ubzr.bet>,
> 	plp@actcom.co.il (Peter L. Peres) writes:
>>
>> I have run all the necessary debugging, getting io space permissions as
>> user root with i386_get_ioperm and then reading and writing io space
>> using inb, outb, inw, outw yields the following:
>>
>> - the ioperm read map is initially always all 1's
>> - setting 0's in the map at addresses where I wish to write always
>> works, even if the addresses are taken by a configured driver (setting
>> zeros according to the manual page)
>> - reading from any address works
>> - writing to any address always busfaults, regardless of whether the
>> address is owned by a driver or not
>>
>> Kernel is netbsd-1.6.1 GENERIC, /dev/io is not configured
>>
>> I conclude that what I am trying to do is not possible (can't write to
>> kernel io bus space) with the current kernel.
>
> It works for me, on current and NetBSD 2.0, except that with the default
> of kern.securelevel=-1, writing always works, no matter what's in the map.

My securelevel is also -1. I do not know what is really going on yet, 
excepting my reads are correct (they reflect real hw port logic levels 
as they should), I got the kernel sources and I will know more later. I 
will try your program too, and report.

thanks,
Peter