Mechanisms for user programs to request OS services
System calls provide the fundamental interface between user applications and the operating system kernel, allowing programs to request services that require privileged hardware access or kernel functionality. When a user program makes a system call, it transitions from user mode to kernel mode through a carefully controlled mechanism that ensures security and stability. Common system call categories include process control (fork, exec, exit), file management (open, read, write, close), device management (ioctl, read, write), information maintenance (getpid, time, system info), and communication (pipe, shmget, msgget). The system call interface typically uses software interrupts or special processor instructions to trigger the mode switch. Parameters are passed through registers, stack, or memory blocks, and the kernel validates all requests before execution. After processing, results are returned to the user program, which resumes execution in user mode. Modern operating systems provide wrapper functions in standard libraries that hide the assembly-level details of making system calls. Understanding system calls is crucial for system programming, as they represent the boundary between application logic and operating system services, and their efficient use is key to application performance and proper resource management.