Hello, I have been trying to write a driver to bee able to read and write to any memory address given by the user. I suspected that I was going to have some problems because of memory violation issues and it turns out I was right....
When I try to access address B8002050 for example I get "Unable to handle kernel paging request at virtual address b8002050".....
Isn't there any way to do this whitout getting errors? I though I could access any memory address using a driver as it is executing as root and has the maximum priority level in the CPU....
The reason I am trying to do this is to check some configuration registers directly, as I am working on an embedded system which is having some issues....
Any ideas on how to do this?
Thanks a lot :)
Although the kernel runs in physical memory, there are still rules to follow in order to utilize some specific physical address. In userland, Linux does not allow direct access to physical ram, unless it is mapped first to a virtual address. In fact, you can do that in a user application with the mmap() function. You really do not need a kernel driver. Anyway, you might want to read this first: http://tldp.org/LDP/tlk/mm/memory.html, which is part of this document: The Linux Kernel
All address below PAGE_OFFSET (0xC0000000 in 32bit x86) are user space (not true for ARM). To access this region within kernel, you must use copy_to_user/copy_from_user functions.
Originally Posted by albert-mcfly