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

    Communicating between user space and kernel space

    Hi all
    i want to write a module which tests a device driver. I want my testing program to sit in the kernel space. For example i am writing test code for testing a flash which has read and write operations. I want my code to be such that,when i insert my module the testing should start automatically and i have to store the log in a file. Please provide some good ideas to do this.



  2. #2
    I am not sure my idea is a good idea or not, I just think that it can work.

    You may want to implement file operation read on your test driver in kernel space, then use copy_to_user() in that read function to make your data available to user space program, then in your user space program you can store that data to log file as need.

  3. #3
    Thanks for your reply.

    I have found out another solution.
    There is a daemon process running which captures the log messages from the kernel. It is /sbin/klogd. This daemon takes the messages from the /proc/kmsg and sends to syslog. For saving this daemon to the log file i have edited the file /etc/sysconfig/syslog. KLOGD_OPTIONS=" -c 1 -x -f /home/bala/log.txt". That -f option is used for storing the log to the specified path. This is how i arrived to the solution. I dont know whether there is any more easy ways are there to do this. If you come to know please intimate me.



  4. $spacer_open

Posting Permissions

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