0x90
0x90

Reputation: 41022

How can I map a memory of bytes from a kernel module to user space app?

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

Answers (4)

matthias.bgg
matthias.bgg

Reputation: 175

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

Upvotes: 0

Federico
Federico

Reputation: 3892

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

Upvotes: 0

Gnurou
Gnurou

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

Giel
Giel

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

Related Questions