System call

For example, the rings model specifies multiple privilege levels under which software may be executed: a program is usually limited to its own address space so that it cannot access or modify other running programs or the operating system itself, and is usually prevented from directly manipulating hardware devices (e.g. the frame buffer or network devices).An interrupt automatically puts the CPU into some elevated privilege level and then passes control to the kernel, which determines whether the calling program should be granted the requested service.Making the system call directly in the application code is more complicated and may require embedded assembly code to be used (in C and C++), as well as requiring knowledge of the low-level binary interface for the system call operation, which may be subject to change over time and thus not be part of the application binary interface; the library functions are meant to abstract this away.On exokernels, libraries shield user applications from the very low level kernel API, and provide abstractions and resource management.[8] 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.It allows a program to call a kernel function directly using a safe control transfer mechanism, which the operating system sets up in advance.The hardware sees the world in terms of the execution mode according to the processor status register, and processes are an abstraction provided by the operating system.The handling of such calls is dependent on the design of the specific operating system kernel and the application runtime environment.
A high-level overview of the Linux kernel's system call interface, which handles communication between its various components and the userspace
System commanduserspacecomputer programoperating systemhard disk driveprocesseskernel servicesprocess schedulingOS/360 and successorsembedded systemsprivilege modearchitecturesecurity modeladdress spaceframe buffernetworkinterruptslibraryUnix-likeC librarywrapper functionsWindows NTNative APIWindows APIcalling conventionsubroutineassemblymodularprocessor registerscall stackportabilitykernel modesubroutine callInstruction set architecturesapplication codeapplication binary interfaceexokernelabstractionsresourceOS/360DOS/360TSS/360macroshigh-level languageMVS/SPOpenBSDNetBSDFreeBSDPlan 9straceftraceptraceprocfssoftware interruptkernelinstruction setregisterinterruptcall gateMulticsx86 memory segmentationIBM System/360Supervisor Call instructionService Request BlockPDP-11minicomputerterminate processexecutesignalallocatecontext switchstatus registermultithreadedthreadsLinux distributionsWindowsSolaristhread poolDOS APILinux kernel APIKernelTrapLinux kernelcalling conventionsAlignmentstaticMachine codeMemory segmentationName manglingObject codeOpaque pointerPosition-independent codeRelocationVirtual method tableBinary-code compatibilityForeign function interfaceLanguage bindingLinkerdynamicLoaderYear 2038 problem