how to pass information from kernel space - Embedded

This is a discussion on how to pass information from kernel space - Embedded ; 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 Thread
Results 1 to 7 of 7

Thread: how to pass information from kernel space

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


  2. Re: how to pass information from kernel space

    Hello,

    ask8y@yahoo.com wrote:
    > 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?


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

    best regards
    Wolfgang Muees


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


  4. Re: how to pass information from kernel space

    ask8y@yahoo.com wrote:
    > 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).


    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.

  5. Re: how to pass information from kernel space

    ask8y@yahoo.com wrote:
    > 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).
    >


    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

  6. 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?


  7. Re: how to pass information from kernel space

    ask8y@yahoo.com wrote:
    > 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?


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

    ciao, m

+ Reply to Thread