Datasheet

lights indicated the results of a system request. Unix started as a command-line interface (CLI) system
there was no graphical user interface (GUI) to make the system easier to use or more aesthetically pleas-
ing. Now Unix has some of the most customizable user interfaces available, in the forms of the Mac OS X
Aqua and Linux’s KDE and GNOME interfaces among others, making the Unix system truly ready for
the average user’s desktop.
Let’s take a brief look at the components that make up the Unix operating system: the kernel, the shell,
the file system, and the utilities (applications).
Unix Kernel
The kernel is the lowest layer of the Unix system. It provides the core capabilities of the system and
allows processes (programs) to access the hardware in an orderly manner. Basically, the kernel controls
processes, input/output devices, file system operations, and any other critical functions required by the
operating system. It also manages memory. These are all called autonomous functions, in that they are
run without instructions by a user process. It is the kernel that allows the system to run in multiuser
(more than one user accessing the system at the same time), multitasking (more than one program run-
ning at a time) mode.
A kernel is built for the specific hardware on which it is operating, so a kernel built for a Sun Sparc
machine can’t be run on an Intel processor machine without modifications. Because the kernel deals
with very low-level tasks, such as accessing the hard drive or managing multitasking, and is not user
friendly, it is generally not accessed by the user.
One of the most important functions of the kernel is to facilitate the creation and management of pro-
cesses. Processes are executed programs (called jobs or tasks in some operating systems) that have owners —
human or systems who initiate their calling or execution. The management of these can be very com-
plicated because one process often calls another (referred to as forking in Unix). Frequently processes also
need to communicate with one another, sending and receiving information that allows other actions to
be performed. The kernel manages all of this outside of the user’s awareness.
The kernel also manages memory, a key element of any system. It must provide all processes with ade-
quate amounts of memory, and some processes require a lot of it. Sometimes a process requires more
memory than is available (too many other processes running, for example). This is where virtual mem-
ory comes in. When there isn’t enough physical memory, the system tries to accommodate the process
by moving portions of it to the hard disk. When the portion of the process that was moved to hard disk
is needed again, it is returned to physical memory. This procedure, called paging, allows the system to
provide multitasking capabilities, even with limited physical memory.
Another aspect of virtual memory is called swap, whereby the kernel identifies the least-busy process or a
process that does not require immediate execution. The kernel then moves the entire process out of RAM
to the hard drive until it is needed again, at which point it can be run from the hard drive or from physical
RAM. The difference between the two is that paging moves only part of the process to the hard drive,
while swapping moves the entire process to hard drive space. The segment of the hard drive used for vir-
tual memory is called the swap space in Unix, a term you will want to remember as you move through this
book. Running out of swap space can cause significant problems, up to and including system failure, so
always be sure you have sufficient swap space. Whenever swapping occurs, you pay a heavy price in sig-
nificantly decreased performance, because disks are appreciably slower than physical RAM. You can
avoid swapping by ensuring that you have an adequate amount of physical RAM for the system.
4
Chapter 1
04_579940 ch01.qxd 3/21/05 5:55 PM Page 4