2009-03-03 00:52:56     Kernel buffers for user space application

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

2009-03-03 00:52:56     Kernel buffers for user space application

P SENTHIL KUMAR (INDIA)

Message: 70241   

 

Dear All,

 

I am using 2008R1 kernel and BF561 based custom board for our application.

 

We had our own audio driver at kernel side and audio decoder at user space.

 

I had declared the two static buffers at the kernel side and trying to use the same for the audio decoder at the user space.

 

I can`t able to use the two static kernel buffers for my user space.

 

But i can able to use the user space buffers at kernel side.

 

Let me know,

 

is it possible to use static kernel buffer at user space. if yes please let me know the suggestion

 

Thanks & Regards,Senthil

QuoteReplyEditDelete

 

 

2009-03-03 00:56:52     Re: Kernel buffers for user space application

Mike Frysinger (UNITED STATES)

Message: 70242   

 

if you want to share buffers, then use mmap()

QuoteReplyEditDelete

 

 

2009-03-03 02:06:28     Re: Kernel buffers for user space application

P SENTHIL KUMAR (INDIA)

Message: 70249   

 

Hi Mike,

 

Thanks for the reply,

 

Is there any method other than mmap();

 

For using the user space static buffer in kernel side( drivers), we just use ioctl call from user to kernel with buffer address as arguments. It works well.

 

But for the kernel space static buffer we cant able to get the kernel buffer address using ioctl call from user space.

 

Also we have found that static kernel buffer at the system.map at where exactly it is located and hardcoded the address in the user space. its also not working.

 

Example:

 

volatile unsigned int temp1[1290];

 

volatile unsigned int temp2[4100];

 

Above are the two static buffere declared at the kernel side( one our audio driver file ). And found that two buffers are located at below address in System.map

 

002ac324 B _temp1

002ad74c B _temp2

 

 

Let me know your suggestion how use this buffers in our user space application.

 

Regards,Senthil

 

 

QuoteReplyEditDelete

 

 

2009-03-03 02:10:33     Re: Kernel buffers for user space application

Mike Frysinger (UNITED STATES)

Message: 70251   

 

using mmap() is the correct method.  anything else is an unsupported hack.

QuoteReplyEditDelete

 

 

2009-03-03 02:23:53     Re: Kernel buffers for user space application

P SENTHIL KUMAR (INDIA)

Message: 70253   

 

Hi Mike,

 

Thanks for the reply and suggestion.

 

Regard,Senthil

Attachments

    Outcomes