Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-12-2014, 07: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, 07:37 AM   #2
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,704

Rep: Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270Reputation: 1270
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.


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 08:21 PM > Forums > Linux Forums > Linux - Newbie

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

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