how to pass information from kernel space

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,
What are the ways to pass async event from kernel space to user space
application? More specificly, when un interrupts happens
how does ISR information the event plus some other information to an
application?

Thanks in advance.


Re: how to pass information from kernel space
Hello,

Quoted text here. Click to load it

Write a kernel (char) driver. Do a blocking read.
Wakeup() the blocking process from interrupt.

best regards
Wolfgang Muees


Re: how to pass information from kernel space
Is that suitable for
1)rare happened event like, a fault condition in the system?
2)very frequent event, like user input?

It looks like good for 2).


Re: how to pass information from kernel space
Quoted text here. Click to load it

It doesn't matter what kind of event it is, but the frequency of the
events and the volume of data are critical factors. It is more expensive
to do most kinds of operations which involve dealing with hardware in
userspace.

Re: how to pass information from kernel space
I have created file like /proc/file

It seems the read() from user space does not reflect what I send back
from my proc_read(), from exmaple,
I return , the application only get half, sometime not at all, but my
proc_read return always data back.

Any one has experiance?


Re: how to pass information from kernel space
Quoted text here. Click to load it

play with the return value of the read function and see what happens!

ciao, m

Re: how to pass information from kernel space
Quoted text here. Click to load it

User space programs can be delayed _looong_ (100 msek and more) by
Kernel activities and higher priority user programs. So they can miss
such an event once and again. You should do a counter or FiFo in the
Kernel driver so that the user program can acknpowlage several Kernel /
Interrupt events in a single user event that is started by the return
from the "read()". The read() can easily pass such data to the user
space program.

Same is true when designing the interface between the hardware ISR and
driver functions that are not directly done in the ISR.

-Michael

Site Timeline