Before anyone can write software for a particular operating system, they must
first understand the programming interfaces the system provides. Many of Linux’s APIs are defined by
the POSIX standard; other APIs which Linux provides were originally introduced by groups like the X
Consortium or by other operating systems. At the core of all of these APIs is Linux’s system call
interface, which every other system API is built around.
Before anyone can write software for a particular operating system, they must first understand the programming interfaces the system provides. Many of Linux’s APIs are defined by the POSIX standard; other APIs which Linux provides were originally introduced by groups like the X Consortium or by other operating systems. At the core of all of these APIs is Linux’s system call interface, which every other system API is built around.
Below, I’ll introduce you to some of the basic concepts involved with system calls. This article is intended for users with minimal familiarity with the C programming language, and little to no experience programming on any POSIX system. As C is (by far) the most popular programming language used on Linux systems, it’s the only language we’re going to mention here.
In any modern operating system, there is a basic dichotomy between code which runs in privileged mode (which UNIX folks normally call kernel space) and code which executes in user space. Kernel code has complete control over the machine; it can access any of the machine’s resources, such as memory, network adapters, and disk drives. User space code has limited access to system resources. In order to read from a disk drive or write to the network, for example, user code has to ask the kernel to perform the work on the user code’s behalf. If user code tries to carry out an operation which it doesn’t have permission to do, the microprocessor notifies the kernel,…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: