Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Passing data from Kspace to Uspace


    I am new to linux world, my background so far has been on RTOSs like VxWorks.

    Currently I am tasked with writing a driver for a sensor. Driver talks to device over I2C Bus.
    The way I am trying to design is,

    I will make driver module part of the kernel so that it will be loaded with the kernel runs. Its probe will register with evdev(input susbsystem), create attribute (coordinates) for i2c client and register its read and store routines.

    once the sensor crosses the threshold, it will issue INT, ISR will read x,y,z over I2C Bus and executes write on coordinates. Store function captures x,y & z and pushes out to input subsystem.

    Now my question is can I have a process in userspace that is pended on read(/dev/input/eventX,...,...) that will wake up once it gets the data, processes it and goes back to sleep again.

    Reason i want to do it this way is to differ processing to user space process rather than doing it in ISR.

    The problem here is the process would have to be started after the drivers probe registers with event subsystem since process is pending on /dev/input/eventX

    Can anyone suggest how should I go by implementing this.

  2. #2
    Just Joined!
    Join Date
    Oct 2008
    I need Help Also in this regard ,

    I am writing a test Char device driver as my course assignment

    so far i have written a module , that loads in /proc dir
    and i can view its content using less /proc/mytestMod

    but now as i have to do things finaly via divice driver , so dnt know how to post data from K-space to U-space ,
    but i think it uses copy_to_user() function , but dnt really know to use it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts