Results 1 to 3 of 3
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 ...
- 04-25-2005 #1Just Joined!
- Join Date
- Mar 2005
- Posts
- 6
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.
Thanks
Regards
Bala
- 04-27-2005 #2Just Joined!
- Join Date
- Nov 2004
- Posts
- 47
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.
- 04-28-2005 #3Just Joined!
- Join Date
- Mar 2005
- Posts
- 6
Hi
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.
Thanks
regards
Bala


Reply With Quote
