<br><br><div class="gmail_quote">On 5 July 2011 13:01, Mandeep Sandhu <span dir="ltr"><<a href="mailto:mandeepsandhu.chd@gmail.com">mandeepsandhu.chd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Oops, accidentally pressed send...<br>
<div class="im"><br>
On Tue, Jul 5, 2011 at 12:58 PM, Mandeep Sandhu<br>
<<a href="mailto:mandeepsandhu.chd@gmail.com">mandeepsandhu.chd@gmail.com</a>> wrote:<br>
> On Tue, Jul 5, 2011 at 12:29 PM, Paraneetharan Chandrasekaran<br>
> <<a href="mailto:paraneetharanc@gmail.com">paraneetharanc@gmail.com</a>> wrote:<br>
>> I think the thread originator is asking about how the application knows<br>
>> which device file to read or write.<br>
>> This is done by h/w management system udev. udev creates/manages device<br>
>> nodes in /dev/ dir and notifes applications based on the udev rules written<br>
>> (via HAL events or DBUS signals).<br>
><br>
> I don't think udev is involved in the read/write file ops. Udev is<br>
> responsible for handling hotplug events, doing certain actions based<br>
> on events (as indicated by udev rules),persistent naming of devices<br>
> etc...but not file i/o.<br>
><br>
> That, I think, is handled by the VFS layer. Each device node is<br>
> uniquely identified by it's MAJOR-MINOR number combo. I guess the VFS<br>
> layer uses this to pick the correct file-ops struct to communicate<br>
> with the device.<br>
<br>
</div>>Eg; when we try to open a device, say /dev/ttyS0, it's major-minor<br>
>numbers (eg: 64-4 on my machine) are used to lookup the file-ops<br>
>struct and from then on, the VFS passes the read/write calls to this<br>
>device driver.<br></blockquote><div><br>Yes. whenever we read or write to the device, the file operations structure would be invoked for the device. And this device is identified by the Major and Minor number combination.<br>
The device driver / kernel module at registration time mention what major and minor it would be servicing.<br><br>This is what I think it should work. Good to get confirmation though.<br><br>Regards,<br>Abhijit <br></div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
HTH,<br>
<font color="#888888">-mandeep<br>
</font><div><div></div><div class="h5">><br>
> My info is a little dated, so plz CMIIW.<br>
><br>
> HTH,<br>
> -mandeep<br>
><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br>