-   Linux - Newbie (
-   -   how to test a simple char driver in FC5? (

agpperera 10-15-2007 11:50 PM

how to test a simple char driver in FC5?
Hi every one,

I'm quite new to linux device drivers but I made a simple char device driver(prety much the scull in LDD3) How can I write a program to test it? (The read/write functions) Do I hav to have a node in /dev to do this? example code would be nice! (i686 machine/kernel=2.6.15)


Mara 10-16-2007 05:15 PM

You can write a program using the standard calls. First use open(), then write() and read(), just like for any other device (of course, if you support both read and write...).

It depends on your driver if you need to create your file in /dev. In the 2.6 kernel, rather not, but simply check if the file exists.

agpperera 10-17-2007 02:16 AM


I tried it and it was quite ok. I used fread() fwrite() !!

All times are GMT -5. The time now is 08:02 AM.