LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 04-05-2012, 03:51 AM   #1
jinxin16897123
LQ Newbie
 
Registered: Aug 2011
Location: Shanghai,China
Posts: 9

Rep: Reputation: Disabled
how did a system call invoke kernel call,ie: fwrite->sys_write


I have already been told the procedure of a system call,like this: in glibc,fopen->use the sysenter instruction to enter privilege level,and then call the function with prefix such as sys_,and waiting until job was done,and then it return to userspace.
I really don't like the description above,is there any one who can give me a more detail description.I'd appreciate if you describe the procedure in real source code,not the pseudo code.the following is the best,A() call B() ,B() call C(),C() call D() and so on.
 
Old 04-05-2012, 02:04 PM   #2
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,382

Rep: Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109Reputation: 1109
There are several ways that the system call can occur: the options are processor-specific but also may vary within a particular type of processor.

The user program's request, made through some kind of shared userspace library like glibc, will result in one or more system calls to request OS services. The kernel-side (filesystem driver) code will validate the request and break it down into one or more asynchronous request blocks which will track the progress of the approved request. The user process is flagged as "not runnable" so that the dispatcher will ignore it: the process therefore "stops running." Eventually, the process will be flagged as "runnable" again so that it once again becomes eligible to receive slices of processor time.
 
1 members found this post helpful.
  


Reply

Tags
glibc, kernel, system


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
how to write a system call which returns current system time using call by reference mukul2kul4 Debian 2 09-25-2011 11:17 PM
How to call system call from usb driver's code Mr.J Linux - Kernel 4 09-29-2008 03:47 AM
How can i make centos 4.5's system call using vDSO(call *%gs:0x10) instead of int80 tclwp Red Hat 3 08-06-2007 12:07 AM
problem in intercepting sys_write system call appas Programming 7 09-03-2004 12:33 PM


All times are GMT -5. The time now is 10:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration