2

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?

4 Answers 4

3

You will most likely need to implement a character device. Then in your instance of struct file_operations implement the mmap function.

Sign up to request clarification or add additional context in comments.

Comments

2

I guess you have everything here: http://www.scs.ch/~frey/linux/memorymap.html

First result on Google, by the way.

Comments

0

Linux Device Driver 3th Chapter 15. It talks about mmap. Chapter 3 and 6 talk about char devices.

Comments

0

maybe the userspace I/O system will help you: https://www.osadl.org/?id=321

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.