lkml.org 
[lkml]   [2004]   [Jul]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 6 Jul 2004 11:24:38 +0200
FromJan-Benedict Glaw <>
SubjectRe: system calls-(query)
On Tue, 2004-07-06 09:00:30 +0100, Susheel Raj <susheel_nuguru@yahoo.co.in>
wrote in message <20040706080030.35778.qmail@web8310.mail.in.yahoo.com>:
> i have been trying to understand how the system calls
> are being made by applications and how the kernel
> reacts to them...this is what i got into my brain....
> when an application makes a system call ( for i386)
> %eax register is filled with the system call number
> and some other registers are to be given some
> appropriate values..for example ..if i amke an exit ()
> system call.. then its system call number "1" is
> filled in %eax and the status code is filled in
> %ebx...
> 
> so i want to know what are the requirements for other
> systems calls to execute ...what all registers they
> access..any documentation would be a great help.... 

Userland has to place arguments where the kernel expects them. Have a
look at ./linux/asm-$ARCH/unistd.h to see how syscalls can be made. You
can think of the _syscallX() macros as the lowest-level "function" to
get access to a system call slot. From there, the syscall is usually
dispatched from entry.S.

Syscalls trigger some kind of interrupt or exception; an exception
handler then gets the system call number and dispatches it through the
syscall function pointer's addresses in sys_call_table (in entry.S).

MfG, JBG


-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 14:04    [from the cache]
©2003-2008