<P> Implementing system calls requires a transfer of control from user space to kernel space, which involves some sort of architecture - specific feature . A typical way to implement this is to use a software interrupt or trap . Interrupts transfer control to the operating system kernel, so software simply needs to set up some register with the system call number needed, and execute the software interrupt . </P> <P> This is the only technique provided for many RISC processors, but CISC architectures such as x86 support additional techniques . For example, the x86 instruction set contains the instructions SYSCALL / SYSRET and SYSENTER / SYSEXIT (these two mechanisms were independently created by AMD and Intel, respectively, but in essence they do the same thing). These are "fast" control transfer instructions that are designed to quickly transfer control to the kernel for a system call without the overhead of an interrupt . Linux 2.5 began using this on the x86, where available; formerly it used the INT instruction, where the system call number was placed in the EAX register before interrupt 0x80 was executed . </P> <P> An older x86 mechanism is the call gate . It allows a program to call a kernel function directly using a safe control transfer mechanism, which the operating system sets up in advance . This approach has been unpopular, presumably due to the requirement of a far call (a call to a procedure located in a different segment than the current code segment) which uses x86 memory segmentation and the resulting lack of portability it causes, and existence of the faster instructions mentioned above . </P> <P> For IA - 64 architecture, EPC (Enter Privileged Code) instruction is used . The first eight system call arguments are passed in registers, and the rest are passed on the stack . </P>

How system calls are called by number and name