2008-03-22 01:43:32     ioctl to do low level stuff from user space

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-03-22 01:43:32     ioctl to do low level stuff from user space


Message: 52907    I understand memory mapped registers can not be accessed directly due to the memory protection offered by the kernel.


Hence I guess there are two options to access the registers from user space. Use the ioctl functions or turn off the memory protection.


For using the ioctl function, I need to know the parameters pertaining to the specific hardware am accessing. I checked out some of the code in the distribution under the directory: \user\blkfin-test\ . Some of the code use the ioctl function. Looking through those codes, I managed to figure out how to do simple stuff like making a gpio pin high etc... But the various parameters for all the available hardware for ioctl remains unclear. Is there any particular document out there that I have missed to read? Is there a link on the webpage that I have missed?


For the second option, is it possible to turn off the memory protection? If so, how?

Also is it a good idea to do such a thing?




2008-03-22 06:49:19     Re: ioctl to do low level stuff from user space

Mike Frysinger (UNITED STATES)

Message: 52915    even if you turned off all cplbs, you still would not be able to access the MMRs.  the hardware enforces MMR protection all the time and there is no way of turning it off.


why do you want to access the MMRs in the first place ?  are you just trying to debug things, or are you trying to develop a driver to do this ?  the FAQ covers this a bit: (How do I access system registers from user space?):