Reputation: 41022
I would like to declare an array in kernel module and to access it within a userspace app. how can I do it?
How do I memory map it for using via userspace so it can be used by a user?
Upvotes: 2
Views: 2879
Reputation: 175
maybe the userspace I/O system will help you: https://www.osadl.org/?id=321
Upvotes: 0
Reputation: 3892
Linux Device Driver 3th Chapter 15. It talks about mmap. Chapter 3 and 6 talk about char devices.
Upvotes: 0
Reputation: 8143
I guess you have everything here: http://www.scs.ch/~frey/linux/memorymap.html
First result on Google, by the way.
Upvotes: 2
Reputation: 2875
You will most likely need to implement a character device. Then in your instance of struct file_operations
implement the mmap function.
Upvotes: 3