Thread (31 messages) 31 messages, 13 authors, 2011-07-17

interview question how does application connects to device

From: Prashant Shah <hidden>
Date: 2011-07-05 05:43:50

Possibly related (same subject, not in this thread)

Hi,

On Tue, Jul 5, 2011 at 9:45 AM, Bond [off-list ref] 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
functions -> Makes System Calls for read/write -> (now inside kernel)
-> Process the system calls (check parameter, etc) -> Refer the
file_operations structure for that file -> Call the corresponding
read/write function.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help