Topics
System Calls
System calls are an API provided by the OS to applications that run in user space. They are used to preform privileged operations that can only occur in kernel space.
Most programming languages access system calls through a high-level API rather than the syscall interface. This decreases coupling between the kernel and application, and increases portability.
Common APIs:
- Win32/64 for Windows
- POSIX for Unix-like systems
Most implementations for syscalls use software traps. There may also be a syscall
instruction for faster transfer of control to the kernel.
Parameter Passing
To pass argument to system calls three different methods may be used:
- Parameters in registers
- Block storage on the stack
- Pushed on stack and popped off stack
The pure register method is rarely used due to the number/size of parameters that may be passed to the call. Although its the fastest, it is not the most practical.
On the other hand the block and stack methods do not limit the number or length of parameters being passed.
Types of Calls
System calls fall under these categories:
- Process control
- File management
- Device management (I/0 and System)
- Information maintenance
- Communications
- Protection
System Programs
These are user-level programs that are shipped with the OS. They ease the job of program development and execution.
System programs are not part of the OS kernel
System programs fall into these categories:
- File management -
mkdir cp rm ls ln
- File modification -
find grep nano
- Status information -
date time du df top ps
- Programming language support -
gcc gdb perl
- Program loading/execution -
ld
- Communications -
ssh mail write ftp
- Application programs -
vim emacs fzf
Reference
- Kulkarni, Prasad Various Lectures The University of Kansas 2024