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.


Sign Up Now
> Open() Function In Device Drivers, open function usage
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

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
Go to the top of the page
+Quote Post
Start new topic
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 will use the open() method provided by the network driver.

Hemant Kumar
user posted image
Go to the top of the page
+Quote Post

Posts in this topic
- vasanth   Open() Function In Device Drivers   Feb 26 2005, 05:42 AM
- - Hemant   Both are different.I will try to explain how? Whe...   Feb 26 2005, 08:10 PM
- - vasanth   Thanks for the info.   Feb 28 2005, 03:23 AM

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: 21st June 2018 - 03:14 PM