Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Open() Function In Device Drivers, open function usage
vasanth
post Feb 26 2005, 05:42 AM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 6
Joined: 26-February 05
Member No.: 4,701



HI,
what is the difference between the two functions open(path of the file,flags) and the open function found in device drivers i.e open( struct file,inode).is there any relation between the two functions? which one to use to open devices? if first one,whats the use of the seconf function?
thanks in advance
vasanth
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 2)
Hemant
post Feb 26 2005, 08:10 PM
Post #2


RMS is my Hero
******

Group: Support Specialist
Posts: 782
Joined: 6-October 02
From: Trichy,INDIA
Member No.: 29



Both are different.I will try to explain how?

When a device driver programmer writes a device driver,he has to follow the unix standards.
For example,i am writting a sound card device driver,then i must provide methods with which the device can be opened(open()),some data could be written,send(write()),and some data could be read.Thus to give uniform programming interface to the programmers who will write application level programs(not kernel stuff),device driver programmers try to use same name for functions.

Now the standars unix system call,open().Which can be used to open a file can also be used to open a device.But the difference is...When it tries to open a file on the disk.....This open() system call will in turn invoke,the open() method provided by the disk device driver.If a network card is opened....then our standard unix system call...open() will use the open() method provided by the network driver.


--------------------
Hemant Kumar
user posted image
hemant@linuxhelp.net
Go to the top of the page
 
+Quote Post
vasanth
post Feb 28 2005, 03:23 AM
Post #3


Whats this Lie-nix Thing?
*

Group: Members
Posts: 6
Joined: 26-February 05
Member No.: 4,701



Thanks for the info.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 13th December 2017 - 10:09 AM