Regarding User Space access of IO ports

Venkateswara Rao Dokku dvrao.584 at gmail.com
Mon Oct 12 11:45:35 UTC 2015


Hi,

I am trying to access the IO ports from user space. This I am doing by
having an ioctl that will return the address of the IO port & I am using
this IO port address returned from kernel, in user space application to
write to that port via outw();

In short, I did this

1. Give IOCTL to kernel which will return the IO port address
2. FD = open("/dev/io",O_RDWR) in my user space app, this will give the
privilege to user space to write to the IO address
3. outw( ioport_addr+ offset, value)

The question here is, how the outw() work? Does it write to the address
directly as in kernel  mode or will it give an ioctl on the FD which will
result in kernel switch?

Thanks for the response

-- 
Thanks & Regards,
Venkateswara Rao Dokku.


More information about the freebsd-drivers mailing list