I'd like to be able to access some ioports to some custom hardware directly
from userspace, without creating a specialized kernel-level driver. Is
there a way to do that?
Matt
--
Matthew Dharm Home: [email protected]
Maintainer, Linux USB Mass Storage Driver
M: No, Windows doesn't have any nag screens.
C: Then what are those blue and white screens I get every day?
-- Mike and Cobb
User Friendly, 1/4/1999
On Thu, Sep 25, 2003 at 04:03:51PM -0700, Matthew Dharm wrote:
> I'd like to be able to access some ioports to some custom hardware directly
> from userspace, without creating a specialized kernel-level driver. Is
> there a way to do that?
/dev/port?
On Thu, Sep 25, 2003 at 04:03:51PM -0700, Matthew Dharm wrote:
> I'd like to be able to access some ioports to some custom hardware directly
> from userspace, without creating a specialized kernel-level driver. Is
> there a way to do that?
Either use /dev/port, or if it's performance critical (but not performance
critical enough to do in kernelspace), use ioperm/iopl and inb/outb.
--
Frank v Waveren Fingerprint: 21A7 C7F3
fvw@[var.cx|stack.nl|dse.nl] ICQ#10074100 1FF3 47FF 545C CB53
Public key: hkp://wwwkeys.pgp.net/[email protected] 7BD9 09C0 3AC1 6DF2
On Fri, 2003-09-26 at 07:26, Frank v Waveren wrote:
> On Thu, Sep 25, 2003 at 04:03:51PM -0700, Matthew Dharm wrote:
> > I'd like to be able to access some ioports to some custom hardware directly
> > from userspace, without creating a specialized kernel-level driver. Is
> > there a way to do that?
> Either use /dev/port, or if it's performance critical (but not performance
> critical enough to do in kernelspace), use ioperm/iopl and inb/outb.
Simple note: the above will work on x86 only...
Ben.
On Fri, 2003-09-26 at 09:34, Frank v Waveren wrote:
> On Fri, Sep 26, 2003 at 09:27:05AM +0200, Benjamin Herrenschmidt wrote:
> > Simple note: the above will work on x86 only...
> in[bwl]/out[bwl] are available on a lot more than just x86. Mind you, the
> mechanisms are subtly different. Then again, if you're using direct hardware
> access you're not going for portability anyway.
Are they from userland ? I doubt it...
Ben.
On Fri, Sep 26, 2003 at 09:27:05AM +0200, Benjamin Herrenschmidt wrote:
> Simple note: the above will work on x86 only...
in[bwl]/out[bwl] are available on a lot more than just x86. Mind you, the
mechanisms are subtly different. Then again, if you're using direct hardware
access you're not going for portability anyway.
--
Frank v Waveren Fingerprint: 21A7 C7F3
fvw@[var.cx|stack.nl|dse.nl] ICQ#10074100 1FF3 47FF 545C CB53
Public key: hkp://wwwkeys.pgp.net/[email protected] 7BD9 09C0 3AC1 6DF2
On Fri, Sep 26, 2003 at 09:40:42AM +0200, Benjamin Herrenschmidt wrote:
> > in[bwl]/out[bwl] are available on a lot more than just x86. Mind you, the
> > mechanisms are subtly different. Then again, if you're using direct hardware
> > access you're not going for portability anyway.
> Are they from userland ? I doubt it...
Have a look at your include files, they're defined everywhere, and defined
to something useful almost everywhere.
--
Frank v Waveren Fingerprint: 21A7 C7F3
fvw@[var.cx|stack.nl|dse.nl] ICQ#10074100 1FF3 47FF 545C CB53
Public key: hkp://wwwkeys.pgp.net/[email protected] 7BD9 09C0 3AC1 6DF2
>>>>> "Ben" == Benjamin Herrenschmidt <[email protected]> writes:
Ben> On Fri, 2003-09-26 at 09:34, Frank v Waveren wrote:
>> in[bwl]/out[bwl] are available on a lot more than just x86. Mind
>> you, the mechanisms are subtly different. Then again, if you're
>> using direct hardware access you're not going for portability
>> anyway.
Ben> Are they from userland ? I doubt it...
Actually yes on some architectures, ia64 emulates it the ia32
API. That said, it's certainly not something one should be encouraged
to do, using MMIO is a far better approach.
Cheers,
Jes
>>>>> "Jes" == Jes Sorensen <[email protected]> writes:
>>>>> "Ben" == Benjamin Herrenschmidt <[email protected]> writes:
Ben> On Fri, 2003-09-26 at 09:34, Frank v Waveren wrote:
>>> in[bwl]/out[bwl] are available on a lot more than just x86. Mind
>>> you, the mechanisms are subtly different. Then again, if you're
>>> using direct hardware access you're not going for portability
>>> anyway.
Ben> Are they from userland ? I doubt it...
Jes> Actually yes on some architectures, ia64 emulates it the ia32
Jes> API. That said, it's certainly not something one should be
Jes> encouraged to do, using MMIO is a far better approach.
They're available at least in i386, alpha, ia64.
However they allow access only to the first 64k of IO address space.
So you may not be able to access you device if it's in the wrong PCI
slot...
--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
You are lost in a maze of BitKeeper repositories, all slightly different.