LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-26-2005, 07:14 AM   #1
chandansingh
LQ Newbie
 
Registered: Mar 2005
Location: bangalore india
Posts: 3

Rep: Reputation: 0
linux device driver programming


hi friends,

In struct file_options{ (*read)();(*open)() ...} we store the address of our function to be executed.but during the call in driver program,we only use read(),open() etc. How the compiler knows that it is a member of struct though we don't dereferenced the struct member by dot operator?How it is defferenciated with the same system call functions read(),open() etc.

waiting for response...
chandan
 
Old 03-26-2005, 07:30 AM   #2
zeropash
Member
 
Registered: Apr 2003
Location: Bangalore,India
Distribution: FC2, RHES, RH9, FC3, FC1, Slackware 3.0
Posts: 208

Rep: Reputation: 30
The compiler does not. things are little more complex than that.
I dont think I can give a full explanation a high level overview will be something like this.
the read() call you make invokes a library call.
this does some neat little tricks and call the generic system call stub and end up somewhere in sys_read. sys read will again do some tricks find the file ops structure for your device (this will be stored in the file table when you did the open). and it will call your read routine.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ or pure C for Linux kernel module, Linux device driver development. What to use? Igor007 Programming 91 07-19-2014 11:55 AM
Linux Device Driver malacma Linux - Software 10 10-09-2007 06:14 AM
Linux device driver programming iammisc Programming 1 11-26-2005 10:46 AM
I want some guide to know the basic about device drivers programming in linux. kadhiravan.r Linux - Software 2 07-18-2005 07:07 AM
Linux Driver Programming prowzen General 6 06-05-2001 02:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration