All of lore.kernel.org
 help / color / mirror / Atom feed
From: mandeepsandhu.chd@gmail.com (Mandeep Sandhu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: interview question how does application connects to device
Date: Tue, 5 Jul 2011 13:01:48 +0530	[thread overview]
Message-ID: <CAC+QLdSZji3i4dsUT2q3cjb60Wkh7kJhqLxmve15LsDEp2mRBQ@mail.gmail.com> (raw)
In-Reply-To: <CAC+QLdR9cxCbT04YHNju1CEEfztNx8Qvtk++N2TBS9f1ST81mA@mail.gmail.com>

Oops, accidentally pressed send...

On Tue, Jul 5, 2011 at 12:58 PM, Mandeep Sandhu
<mandeepsandhu.chd@gmail.com> wrote:
> On Tue, Jul 5, 2011 at 12:29 PM, Paraneetharan Chandrasekaran
> <paraneetharanc@gmail.com> wrote:
>> I think the thread originator is asking about how the application knows
>> which device file to read or write.
>> This is done by h/w management system udev. udev creates/manages device
>> nodes in /dev/ dir and notifes applications based on the udev rules written
>> (via HAL events or DBUS signals).
>
> I don't think udev is involved in the read/write file ops. Udev is
> responsible for handling hotplug events, doing certain actions based
> on events (as indicated by udev rules),persistent naming of devices
> etc...but not file i/o.
>
> That, I think, is handled by the VFS layer. Each device node is
> uniquely identified by it's MAJOR-MINOR number combo. I guess the VFS
> layer uses this to pick the correct file-ops struct to communicate
> with the device.

Eg; when we try to open a device, say /dev/ttyS0, it's major-minor
numbers (eg: 64-4 on my machine) are used to lookup the file-ops
struct and from then on, the VFS passes the read/write calls to this
device driver.

HTH,
-mandeep
>
> My info is a little dated, so plz CMIIW.
>
> HTH,
> -mandeep
>

  reply	other threads:[~2011-07-05  7:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOQuo6Nf9-uXBbHOi1_tpBmBOVPzuBtW699=ywDGSsfT_NVphA@mail.gmail.com>
2011-07-05  4:15 ` interview question how does application connects to device Bond
2011-07-05  5:43   ` Prashant Shah
2011-07-17 15:10     ` Bond
2011-07-17 15:34       ` Anuz Pratap Singh Tomar
2011-07-17 15:40         ` Bond
2011-07-17 15:47           ` Anuz Pratap Singh Tomar
2011-07-17 15:52             ` Bond
2011-07-17 16:06               ` Mulyadi Santosa
2011-07-17 17:34                 ` Bond
2011-07-17 17:49                   ` Anuz Pratap Singh Tomar
2011-07-17 19:25                   ` Greg Freemyer
2011-07-17 16:14               ` Anuz Pratap Singh Tomar
2011-07-17 17:31                 ` Bond
2011-07-05  6:51   ` Philipp Ittershagen
2011-07-05  6:59     ` Paraneetharan Chandrasekaran
2011-07-05  7:28       ` Mandeep Sandhu
2011-07-05  7:31         ` Mandeep Sandhu [this message]
2011-07-05  7:51           ` Abhijit Pawar
2011-07-05  8:12             ` er krishna
2011-07-05  9:13               ` Mandeep Sandhu
2011-07-05  9:38                 ` er krishna
2011-07-05 12:56   ` Greg Freemyer
2011-07-05 13:43     ` Mandeep Sandhu
2011-07-05 16:03       ` Greg Freemyer
2011-07-06  4:08         ` Abhijit Pawar
2011-07-06  4:43           ` Prashant Shah
2011-07-06  5:27             ` Abhijit Pawar
2011-07-11 17:43         ` StephanT
2011-07-11 18:13           ` Greg KH
2011-07-11 18:14           ` Greg Freemyer
     [not found]       ` <769A0B32-0869-4A2B-A005-D6AC0376D1E3@gmail.com>
2011-07-06  5:12         ` Mandeep Sandhu
2011-07-06 23:29           ` Javier Martinez Canillas
2011-07-07  3:20             ` Greg Freemyer
2011-07-07 12:51               ` Javier Martinez Canillas
2011-07-05 13:36   ` Shaz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAC+QLdSZji3i4dsUT2q3cjb60Wkh7kJhqLxmve15LsDEp2mRBQ@mail.gmail.com \
    --to=mandeepsandhu.chd@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.