Understanding the Linux Kernel
12
1.4 Basic Operating System Concepts
Any computer system includes a basic set of programs called the operating system. The most
important program in the set is called the kernel. It is loaded into RAM when the system boots
and contains many critical procedures that are needed for the system to operate. The other
programs are less crucial utilities; they can provide a wide variety of interactive experiences
for the user—as well as doing all the jobs the user bought the computer for—but the essential
shape and capabilities of the system are determined by the kernel. The kernel, then, is where
we fix our attention in this book. Hence, we'll often use the term "operating system" as
a synonym for "kernel."
The operating system must fulfill two main objectives:
• Interact with the hardware components servicing all low-level programmable elements
included in the hardware platform.
• Provide an execution environment to the applications that run on the computer system
(the so-called user programs).
Some operating systems allow all user programs to directly play with the hardware
components (a typical example is MS-DOS). In contrast, a Unix-like operating system hides
all low-level details concerning the physical organization of the computer from applications
run by the user. When a program wants to make use of a hardware resource, it must issue
a request to the operating system. The kernel evaluates the request and, if it chooses to grant
the resource, interacts with the relative hardware components on behalf of the user program.
In order to enforce this mechanism, modern operating systems rely on the availability of
specific hardware features that forbid user programs to directly interact with low-level
hardware components or to access arbitrary memory locations. In particular, the hardware
introduces at least two different execution modes for the CPU: a nonprivileged mode for user
programs and a privileged mode for the kernel. Unix calls these User Mode and Kernel Mode,
respectively.
In the rest of this chapter, we introduce the basic concepts that have motivated the design of
Unix over the past two decades, as well as Linux and other operating systems. While the
concepts are probably familiar to you as a Linux user, these sections try to delve into them
a bit more deeply than usual to explain the requirements they place on an operating system
kernel. These broad considerations refer to Unix-like systems, thus also to Linux. The other
chapters of this book will hopefully help you to understand the Linux kernel internals.
1.4.1 Multiuser Systems
A multiuser system is a computer that is able to concurrently and independently execute
several applications belonging to two or more users. "Concurrently" means that applications
can be active at the same time and contend for the various resources such as CPU, memory,
hard disks, and so on. "Independently" means that each application can perform its task with
no concern for what the applications of the other users are doing. Switching from one
application to another, of course, slows down each of them and affects the response time seen
by the users. Many of the complexities of modern operating system kernels, which we will
examine in this book, are present to minimize the delays enforced on each program and to
provide the user with responses that are as fast as possible.
www.linuxidc.com
Linux公社(LinuxIDC.com) 是包括Ubuntu,Fedora,SUSE技术,最新IT资讯等Linux专业类网站。