how to pass information from kernel space

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.

Reply to
ask8y
Loading thread data ...

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

best regards Wolfgang Muees

Reply to
Wolfgang Mües

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).

Reply to
ask8y

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.

Reply to
Geronimo W. Christ Esq

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

Reply to
Michael Schnell

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?

Reply to
ask8y

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

ciao, m

Reply to
M.Kmann

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.