Re: function squence

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

 



On 10/25/05, Raju RajaRam <oyeraju@xxxxxxxxx> wrote:
> Hi,
> iam new to linux kernel.
> Can anyone tell me how to get the sequence of function called during the
> library/system call invocation.
>
> For example frmo user application if we invoke read() function call which
> functions are called in function.

Any library function our application calls, further calls the system
call intreface thru int x080 instruction, this instruction changes the
CPU mode from user mode to kernel mode, switches the stack from
process specific user stack to process specific kernel stack and then
just after int x080 instruction CPU is pointed to execute system_call
() assembly function (find it in entry.S kernel source file). This
kernel function retrieves the system call arguments from CPU register
and pushes all the processor registers on process specific kernel
stack. It performs some checks related to ptrace (if our process is
being monitered by any debugger), finally it calls the actuall system
call function (starts with "sys_" in kernel sources) by looking in
system call table at system call number index (system call number is
passed library function as an argument to system call). This called
function is actually responsible for delivering the service requested
by library function.

Hope this clears something about how system calls are done on Linux.

cheers !!
-Guarav


 i know one method thru strace, is there
> any other way to know that.
>
> thanks.


--
- Gaurav
my blog: http://lkdp.blogspot.com/
--

--
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