Re: interview question how does application connects to device

2011-07-17 Thread Greg Freemyer
On Sun, Jul 17, 2011 at 1:34 PM, Bond wrote: > On Sun, Jul 17, 2011 at 9:36 PM, Mulyadi Santosa > wrote: >> On Sun, Jul 17, 2011 at 22:52, Bond wrote: >>> Let me know what do you understand from this. >> >> >> And Greg already kindly answer that for you too. Didn't you see his >> answer? And why

Re: interview question how does application connects to device

2011-07-17 Thread Anuz Pratap Singh Tomar
On Sun, Jul 17, 2011 at 6:34 PM, Bond wrote: > On Sun, Jul 17, 2011 at 9:36 PM, Mulyadi Santosa > wrote: > > On Sun, Jul 17, 2011 at 22:52, Bond wrote: > >> Let me know what do you understand from this. > > > > > > And Greg already kindly answer that for you too. Didn't you see his > > answer?

Re: interview question how does application connects to device

2011-07-17 Thread Bond
On Sun, Jul 17, 2011 at 9:36 PM, Mulyadi Santosa wrote: > On Sun, Jul 17, 2011 at 22:52, Bond wrote: >> Let me know what do you understand from this. > > > And Greg already kindly answer that for you too. Didn't you see his > answer? And why do you rant here anyway? Simply getting an answer > her

Re: interview question how does application connects to device

2011-07-17 Thread Bond
On Sun, Jul 17, 2011 at 9:44 PM, Anuz Pratap Singh Tomar wrote: > > > On Sun, Jul 17, 2011 at 4:52 PM, Bond wrote: >> >> On Sun, Jul 17, 2011 at 9:17 PM, Anuz Pratap Singh Tomar >> wrote: >> > >> > >> > On Sun, Jul 17, 2011 at 4:40 PM, Bond wrote: >> >> >> >> On Sun, Jul 17, 2011 at 9:04 PM, An

Re: interview question how does application connects to device

2011-07-17 Thread Anuz Pratap Singh Tomar
On Sun, Jul 17, 2011 at 4:52 PM, Bond wrote: > On Sun, Jul 17, 2011 at 9:17 PM, Anuz Pratap Singh Tomar > wrote: > > > > > > On Sun, Jul 17, 2011 at 4:40 PM, Bond wrote: > >> > >> On Sun, Jul 17, 2011 at 9:04 PM, Anuz Pratap Singh Tomar > >> wrote: > >> > > >> > > >> > On Sun, Jul 17, 2011 at

Re: interview question how does application connects to device

2011-07-17 Thread Mulyadi Santosa
On Sun, Jul 17, 2011 at 22:52, Bond wrote: > Let me know what do you understand from this. And Greg already kindly answer that for you too. Didn't you see his answer? And why do you rant here anyway? Simply getting an answer here, you already lucky and you should be thankful. -- regards, Muly

Re: interview question how does application connects to device

2011-07-17 Thread Bond
On Sun, Jul 17, 2011 at 9:17 PM, Anuz Pratap Singh Tomar wrote: > > > On Sun, Jul 17, 2011 at 4:40 PM, Bond wrote: >> >> On Sun, Jul 17, 2011 at 9:04 PM, Anuz Pratap Singh Tomar >> wrote: >> > >> > >> > On Sun, Jul 17, 2011 at 4:10 PM, Bond wrote: >> >> >> >> On Tue, Jul 5, 2011 at 11:13 AM, Pr

Re: interview question how does application connects to device

2011-07-17 Thread Anuz Pratap Singh Tomar
On Sun, Jul 17, 2011 at 4:40 PM, Bond wrote: > On Sun, Jul 17, 2011 at 9:04 PM, Anuz Pratap Singh Tomar > wrote: > > > > > > On Sun, Jul 17, 2011 at 4:10 PM, Bond wrote: > >> > >> On Tue, Jul 5, 2011 at 11:13 AM, Prashant Shah > >> wrote: > >> > Hi, > >> > > >> > On Tue, Jul 5, 2011 at 9:45 AM

Re: interview question how does application connects to device

2011-07-17 Thread Bond
On Sun, Jul 17, 2011 at 9:04 PM, Anuz Pratap Singh Tomar wrote: > > > On Sun, Jul 17, 2011 at 4:10 PM, Bond wrote: >> >> On Tue, Jul 5, 2011 at 11:13 AM, Prashant Shah >> wrote: >> > Hi, >> > >> > On Tue, Jul 5, 2011 at 9:45 AM, Bond wrote: >> >> This is an interview question. >> >> My answer w

Re: interview question how does application connects to device

2011-07-17 Thread Anuz Pratap Singh Tomar
On Sun, Jul 17, 2011 at 4:10 PM, Bond wrote: > On Tue, Jul 5, 2011 at 11:13 AM, Prashant Shah > wrote: > > Hi, > > > > On Tue, Jul 5, 2011 at 9:45 AM, Bond wrote: > >> This is an interview question. > >> My answer was > >> In unix it simply opens the device node as a file and sends/receives > >

Re: interview question how does application connects to device

2011-07-17 Thread Bond
On Tue, Jul 5, 2011 at 11:13 AM, Prashant Shah wrote: > Hi, > > On Tue, Jul 5, 2011 at 9:45 AM, Bond wrote: >> This is an interview question. >> My answer was >> In unix it simply opens the device node as a file and sends/receives >> data and commands from it. >> > > A little more detailed method

Re: interview question how does application connects to device

2011-07-11 Thread Greg KH
On Mon, Jul 11, 2011 at 10:43:50AM -0700, StephanT wrote: > Hi all, > > - Original Message - > > From: Greg Freemyer > > > > > > Correct, ioctl is no longer preferred, but it is definitely still > > used.  And the ext4 team is still adding new ioctl commands despite it > > being discou

Re: interview question how does application connects to device

2011-07-11 Thread Greg Freemyer
On Mon, Jul 11, 2011 at 1:43 PM, StephanT wrote: > Hi all, > > - Original Message - >> From: Greg Freemyer > > >> >> Correct, ioctl is no longer preferred, but it is definitely still >> used.  And the ext4 team is still adding new ioctl commands despite it >> being discouraged. >> > > > I

Re: interview question how does application connects to device

2011-07-11 Thread StephanT
Hi all, - Original Message - > From: Greg Freemyer > > Correct, ioctl is no longer preferred, but it is definitely still > used.  And the ext4 team is still adding new ioctl commands despite it > being discouraged. > If ioctl is no longer preferred what is its preferred alternative

Re: interview question how does application connects to device

2011-07-07 Thread Javier Martinez Canillas
>> My question is, why netlink sockets are better than ioctls? It is not >> yet another interface to use as a wildcard to pass any data you wan't >> between the kernel and userpace with the only difference that you use >> another paradigm? (network sockets with a specific protocol family >> instead

Re: interview question how does application connects to device

2011-07-06 Thread Greg Freemyer
2011/7/6 Javier Martinez Canillas : > 2011/7/6 Mandeep Sandhu : >>> How would using sysfs be useful if we were to talk about interacting with, >>> let's say, a file system? ioctl's are quite versatile and rather easy to >>> use when one wants to interact with a given FS. >>> >>> For instance, one

Re: interview question how does application connects to device

2011-07-06 Thread Javier Martinez Canillas
2011/7/6 Mandeep Sandhu : >> How would using sysfs be useful if we were to talk about interacting with, >> let's say, a file system? ioctl's are quite versatile and rather easy to use >> when one wants to interact with a given FS. >> >> For instance, one can manage a Btrfs file system by using an

Re: interview question how does application connects to device

2011-07-05 Thread Abhijit Pawar
On 6 July 2011 10:13, Prashant Shah wrote: > Hi, > > On Wed, Jul 6, 2011 at 9:38 AM, Abhijit Pawar > wrote: > > > > This is good. One more addition from my side which is not necessarily the > > answer to Greg's question: Bottom Halves are discouraged now days in > driver. > > then what are the a

Re: interview question how does application connects to device

2011-07-05 Thread Mandeep Sandhu
> How would using sysfs be useful if we were to talk about interacting with, > let's say, a file system? ioctl's are quite versatile and rather easy to use > when one wants to interact with a given FS. > > For instance, one can manage a Btrfs file system by using an user-level tool, > which heav

Re: interview question how does application connects to device

2011-07-05 Thread Prashant Shah
Hi, On Wed, Jul 6, 2011 at 9:38 AM, Abhijit Pawar wrote: > > This is good. One more addition from my side which is not necessarily the > answer to Greg's question: Bottom Halves are discouraged now days in driver. then what are the alternatives ? are there any articles or documentation for it ?

Re: interview question how does application connects to device

2011-07-05 Thread Abhijit Pawar
On 5 July 2011 21:33, Greg Freemyer wrote: > On Tue, Jul 5, 2011 at 9:43 AM, Mandeep Sandhu > wrote: > >> Let me simplify the question. > > > > I'll attempt to answer your questions...for my own edification! :) > > > >> > >> 1) What are the FIVE classic system calls for interfacing with a > >> c

Re: interview question how does application connects to device

2011-07-05 Thread Greg Freemyer
On Tue, Jul 5, 2011 at 9:43 AM, Mandeep Sandhu wrote: >> Let me simplify the question. > > I'll attempt to answer your questions...for my own edification! :) > >> >> 1) What are the FIVE classic system calls for interfacing with a >> character device.  (ie. If it did not exist in 1970, don't list

Re: interview question how does application connects to device

2011-07-05 Thread Mandeep Sandhu
> Let me simplify the question. I'll attempt to answer your questions...for my own edification! :) > > 1) What are the FIVE classic system calls for interfacing with a > character device.  (ie. If it did not exist in 1970, don't list it). open/close/read/write/seek?...and the infamous ioctl. > >

Re: interview question how does application connects to device

2011-07-05 Thread Shaz
On Tue, Jul 5, 2011 at 9:15 AM, Bond wrote: > This is an interview question. > > I had written device driver for a char device so I know that code > structure looks like this > > struct file_operations something { > .owner=my_device_open; > .read=my_device_read; > .close=my_device_close; > .w

Re: interview question how does application connects to device

2011-07-05 Thread Greg Freemyer
On Tue, Jul 5, 2011 at 12:15 AM, Bond wrote: > This is an interview question. > > I had written device driver for a char device so I know that code > structure looks like this > > struct file_operations something { >  .owner=my_device_open; >  .read=my_device_read; >  .close=my_device_close; >  .w

Re: interview question how does application connects to device

2011-07-05 Thread er krishna
On Tue, Jul 5, 2011 at 2:43 PM, Mandeep Sandhu wrote: > > picture for read and write. It will try to read the data from cache > (buffer > > cache) and if not avilable there then from disk... > > This is applicable only for block devices, not for all devices (eg: char > dev). > Yep...100% true

Re: interview question how does application connects to device

2011-07-05 Thread Mandeep Sandhu
> picture for read and write. It will try to read the data from cache (buffer > cache) and if not avilable there then from disk... This is applicable only for block devices, not for all devices (eg: char dev). -mandeep ___ Kernelnewbies mailing list Ke

Re: interview question how does application connects to device

2011-07-05 Thread er krishna
On Tue, Jul 5, 2011 at 1:21 PM, Abhijit Pawar wrote: > > > On 5 July 2011 13:01, Mandeep Sandhu wrote: > >> Oops, accidentally pressed send... >> >> On Tue, Jul 5, 2011 at 12:58 PM, Mandeep Sandhu >> wrote: >> > On Tue, Jul 5, 2011 at 12:29 PM, Paraneetharan Chandrasekaran >> > wrote: >> >> I t

Re: interview question how does application connects to device

2011-07-05 Thread Abhijit Pawar
On 5 July 2011 13:01, Mandeep Sandhu wrote: > Oops, accidentally pressed send... > > On Tue, Jul 5, 2011 at 12:58 PM, Mandeep Sandhu > wrote: > > On Tue, Jul 5, 2011 at 12:29 PM, Paraneetharan Chandrasekaran > > wrote: > >> I think the thread originator is asking about how the application knows

Re: interview question how does application connects to device

2011-07-05 Thread Mandeep Sandhu
Oops, accidentally pressed send... On Tue, Jul 5, 2011 at 12:58 PM, Mandeep Sandhu wrote: > On Tue, Jul 5, 2011 at 12:29 PM, Paraneetharan Chandrasekaran > wrote: >> I think the thread originator is asking about how the application knows >> which device file to read or write. >> This is done by

Re: interview question how does application connects to device

2011-07-05 Thread Mandeep Sandhu
On Tue, Jul 5, 2011 at 12:29 PM, Paraneetharan Chandrasekaran 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 applicatio

Re: interview question how does application connects to device

2011-07-05 Thread Paraneetharan Chandrasekaran
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). Thanks,

Re: interview question how does application connects to device

2011-07-04 Thread Philipp Ittershagen
On 07/05/2011 06:15 AM, Bond wrote: > But he was expecting some thing more complex. Well, to be honest, I also was expecting something more complex when I first looked at kernel programming and creating character devices ;) But the file_operations interface is really straight-forward and simple, v

Re: interview question how does application connects to device

2011-07-04 Thread Prashant Shah
Hi, On Tue, Jul 5, 2011 at 9:45 AM, Bond wrote: > This is an interview question. > My answer was > In unix it simply opens the device node as a file and sends/receives > data and commands from it. > A little more detailed method : Userland read/write to the file -> Calls C Library read/write fu

interview question how does application connects to device

2011-07-04 Thread Bond
This is an interview question. I had written device driver for a char device so I know that code structure looks like this struct file_operations something {  .owner=my_device_open;  .read=my_device_read;  .close=my_device_close;  .write=my_device_write;  } When the device driver is active then