LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-12-2014, 08:11 AM   #1
Amit Rakshe
LQ Newbie
 
Registered: Sep 2013
Posts: 6

Rep: Reputation: Disabled
linux kernel


hii friends need help...
i doing kernel programming,using ubuntu 12.04lts.
i'm confused about "user open() function", "kernel open() function", "file_operation structure".
1> how those three are related to each other?
2> if linux transfers data using device file then why we use copy to user & copy fom user?
 
Old 06-12-2014, 08:37 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,602

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
1. The kernel handles a number of different filesystems. This is handled by a virtual filesystem which has a list of functions supported by the various filesystems. The "user open" will invoke the kernel via system call (kernel open), which must then pass the operation to the appropriate filesystem support by using the file operation structure to get the proper function.

2. The kernel does not run in the same address space as the user. The "copy to/from user" takes care of that by moving data to/from a users buffer and a kernel buffer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Howto: build Linux kernel module against installed kernel w/o full kernel source tree LXer Syndicated Linux News 0 09-03-2006 09:21 PM


All times are GMT -5. The time now is 04:43 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration