The Definitive Guide to Linux System Calls | Search for a title, author or keyword | ||||||||
The Definitive Guide to Linux System Calls This blog post explains how Linux programs call functions in the Linux kernel. When you run a program which calls open, fork, read, write (and many others) you are making a system call. System calls are how a program enters the kernel to perform some task. Programs use system calls to perform a variety of operations such as: creating processes, doing network and file IO, and much more. There are several different ways for user programs to make system calls and the low-level instructions for making a system call vary among CPU architectures. What prevents user programs from performing these actions themselves? It turns out that the x86-64 CPUs have a concept called privilege levels. Privilege levels are a complex topic suitable for their own blog post. For the purposes of this post, we can (greatly) simplify the concept of privilege levels by saying: Privilege levels are a means of access control. The current privilege level determines which CPU instructions and IO may be performed. The kernel runs at the most privileged level, called “Ring 0”. User programs run at a lesser level, typically “Ring 3”. In order for a user program to perform some privileged operation, it must cause a privilege level change (from “Ring 3” to “Ring 0”) so that the kernel can execute.
|
|||||||||
The Definitive Guide to Linux System Calls | Disclaimer: this link points to content provided by other sites. |