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.
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.
|All times are GMT -5. The time now is 12:35 AM.|