Re: RE: Blocking process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  
>  1.Is system_call() the interrutp handler for interrupt 0x80.If it is the
> case sys_socketcall() is the handler for all the socket calls. I am correct?
>  

no, system_call() is the top most kernel function called for any
system call and then this function calls the appropriate function in
kernel for each system call, for eg: for socket() system call
system_call() function will call sys_socket function, for bind system
call it will call sys_bind() function etc ......

>  
>  2.An Interrupt handler can not wait for long time. How the system_call() 
> [sys_socketcall() it is my requirement] is waiting for long time till the
> blocking function returns(for example sys_read or sys_accept)
>  

There is nothing as user function waiting for a system call to
complete, as I told earlier also, when a system call is done, user
process context is saved on the process kernel specific stack, which
is later poped up to return back to user process, when we return from
system call. Its the same mechanim of function calling, one function
calls another and the state of the caller is saved on to the stack of
function being called, the only difference is that the caller function
here is the user process functon (which do int 0x80) where as the
function being called (system_call) is the kernel function and the
state of the caller function is saved on the kernel speific process
stack which is different from user stack of that process.

>  
>  3.A software interrupt has come and control is changed to corresponding 
> kernel function, How actully the function is returning the values and output
> parameters to the appropriate process which has invoked that kernel
> fucntion. 
>

As mentioned earlier, the state of the user function is saved on the
process specific kernel stack, so while returning from system call in
kernel mode, this state is poped up and the control returns back to
the user function who called the system_call() function. The return
value is passed back using the EAX processor register.

--gd



>  
>  On Fri, 18 Mar 2005 Srinivas G. wrote :
> 
>  >Dear All,
>  >
>  >Here is link which shows how the system call will work in the user
>  >space.
>  >http://www.linux.it/~rubini/docs/ksys/ksys.html
>  >
>  >Regards,
>  >Srinivas G
>  >
>  > > -----Original Message-----
>  > > From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-
>  > > bounce@xxxxxxxxxxxx] On Behalf Of Gaurav Dhiman
>  > > Sent: Thursday, March 17, 2005 9:44 PM
>  > > To: Renaud Lienhart
>  > > Cc: Gaurav; jhoney jhoney; kernelnewbies@xxxxxxxxxxxx
>  > > Subject: Re: Blocking process
>  > >
>  > > On Wed, 16 Mar 2005 20:07:03 +0100, Renaud Lienhart
>  > > <renaud.lienhart@xxxxxxx> wrote:
>  > > > Gaurav wrote:
>  > > > > [...]
>  > > > > instruction, which actually switches the CPU mode from
>  > > > > user to kernel mode (ring0 to ring3), at this time the
>  > > >                        ^^^^^^^^^^^^^^
>  > > > Well actually ring3 is the user mode, and ring0 is the kernel
>  > > > mode. So you should have read "ring3 to ring0" :)
>  > > >
>  > > > --
>  > > > Renaud Lienhart
>  > >
>  > > sorry, my mistake,  yes ring3 is user mode and ring0 is kernel mode.
>  > >
>  > > --gd
>  > >
>  > > --
>  > > Kernelnewbies: Help each other learn about the Linux kernel.
>  > > Archive:      http://mail.nl.linux.org/kernelnewbies/
>  > > FAQ:          http://kernelnewbies.org/faq/
>  >
>  
> 
>  
> 
>

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux