The Structure of the UNIX Operating System


To understand how UNIX works, you need to understand its structure. The UNIX operating system is made up of several major components. These components include the kernel, the shell, the file system, and the commands (or user programs). The relationship among the user, the shell, the kernel, and the underlying hardware is displayed in Figure 1–1.

image from book
Figure 1–1: The structure of the UNIX System

The Kernel

The kernel is the part of the operating system that interacts directly with the hardware of a computer, through device drivers that are built into the kernel. It provides sets of services that can be used by programs, insulating these programs from the underlying hardware. The major functions of the kernel are to manage computer memory, to control access to the computer, to maintain the file system, to handle interrupts (signals to terminate execution), to handle errors, to perform input and output services (which allow computers to interact with terminals, storage devices, and printers), and to allocate the resources of the computer (such as the CPU or input/output devices) among users.

Programs interact with the kernel through system calls. System calls tell the kernel to carry out various tasks for the program, such as opening a file, writing to a file, obtaining information about a file, executing a program, terminating a process, changing the priority of a process, and getting the time of day Different implementations of a variant of the UNIX system may have compatible system calls, with each call having the same functionality However, the internals, programs that perform the functions of system calls (usually written in the C language), and the system architecture in two different UNIX variants or even two different implementations of a particular UNIX variant may bear little resemblance to one another.

Utilities

The UNIX System contains several hundred utilities or user programs. Commands are also known as tools, because they can be used separately or put together in various ways to carry out useful tasks. You execute these utilities by invoking them by name through the shell; this is why they are called commands.

A critical difference between UNIX and earlier operating systems is the ease with which new programs can be installed-the shell need only be told where to look for commands, and this is user-definable.

You can perform many tasks using the standard utilities supplied with UNIX. There are utilities for text editing and processing, for managing information, for electronic communications and networking, for performing calculations, for developing computer programs, for system administration, and for many other purposes. Much of this book is devoted to a discussion of utilities. In particular, Chapters 3, 4, and 19 cover a variety of tools of interest to users. Specialized tools, including both those included with UNIX and others available as add-ons, and are introduced throughout the book. One of the nice, but not unique, features of UNIX is the availability of a wide variety of add-on utilities, either free of charge or by purchase from software vendors.

The File System

The basic unit used to organize information in UNIX is called a file. The UNIX file system provides a logical method for organizing, storing, retrieving, manipulating, and managing information. Files are organized into a hierarchical file system, with files grouped together into directories. An important simplifying feature of UNIX is the general way it treats files. For example, physical devices are treated as files; this permits the same commands to work for ordinary files and for physical devices; for instance, printing a file (on a printer) is treated similarly to displaying it on the terminal screen.

The Shell

The shell reads your commands and interprets them as requests to execute a program or programs, which it then arranges to have carried out. Because the shell plays this role, it is called a command interpreter. Besides being a command interpreter, the shell is also a programming language. As a programming language, it permits you to control how and when commands are carried out. The shell (and its major variants) is discussed in Chapters 4 and 20.




UNIX. The Complete Reference
UNIX: The Complete Reference, Second Edition (Complete Reference Series)
ISBN: 0072263369
EAN: 2147483647
Year: 2006
Pages: 316

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net