<div class='quotetop'>QUOTE (asafvm @ Aug 1 2009, 08:10 PM) <{post_snapback}> (index.php?act=findpost&pid=23365)</div>
--- Quote Start ---
you mean I need to use "mknod" to create the virtual device file?[/b]
--- Quote End ---
Not really. Either you can activate the device file system and provide a hook in the driver and the device node is created automatically, or you can have the uCLinux make process create the device node in romfs and thus it is already available at boot time.
<div class='quotetop'>QUOTE (asafvm @ Aug 1 2009, 08:10 PM) <{post_snapback}> (index.php?act=findpost&pid=23365)</div>
--- Quote Start ---
then I can use fopen/fclose to write/read from my module? (assuming the driver allows it, of course :))[/b]
--- Quote End ---
yep. The driver would need to provide the appropriate open, close, read and write handler functions. The read and write handler need to use the copy form/to user function provided by the Kernel to access the memory the userland process holds.
BTW.: it might be sensible to e.g. have the driver provide a blocking read so that the user program can do a non-busy wait if the driver needs to wait or some hardware action to complete. If you want to allow the user land program to wait for multiple drivers at the same time, you would use select() or something similar and the driver would need to provide a handler for that, as well.
-Michael