From: Jon E. <el...@pi...> - 2012-12-29 00:34:00
|
andy pugh wrote: > On 28 December 2012 09:56, Michael Haberler <ma...@ma...> wrote: > > >>> If rtapi abstracts inb and outb then I probably just need to make the >>> driver use the rtapi_inb and rtapi_outb versions? (I wasn't aware of >>> them when I wrote the driver) >>> > > >> There is no point whatsoever in 'abstracting' an instruction which is available on exactly one platform to start with. >> > > Doesn't the instruction require kernel-level access to hardware, though? > Just to clarify a bit, the X86 instruction set has different instructions to access memory and I/O ports. The parallel port appears as a set of I/O registers, PCI cards can appear as a bank of memory locations AND/OR I/O ports. Many of the other architectures such as the ARM do not have this I/O port architecture, so all GPIO and other dedicated peripheral I/O appears as memory. You can map these memory ranges as if they were an array, refer to them by pointers, etc. You still need kernel permissions to set up the mapping and access these registers. But, they can be accessed by what is generally a user program with the correct privileges set. You can do this with sudo, su to root, or have root own the program and set the s mode bit so any user can run it and it gets root privilege when run. Jon |