Title OPERATING SYSTEM
Description and Scope This course covers operating systems concepts in modern
computing environment, and the principles on which those
features are based. It aims to explore the important role of
the operating system and its functions. This includes
different policies and strategies used by an operating
system. Topics include operating systems structures,
process management, storage management, file
management, distributed systems, protection and security
and special-purpose systems.
TOPIC I
OVERVIEW OF OPERATING SYSTEM
Learning Objectives
a To provide a grand tour of the major components of operating systems.
a To describe the basic organization of computer systems.
a Understand what is an operating system and the role it plays
a Interpret the services provided by operating systems
a Experience to some details of major OS concepts
Lesson 1 – Basic concepts on Operating System
Introduction
An operating system is a program that manages the computer hardware. It
also provides a basis for application programs and acts as an intermediary between
the computer user and the computer hardware. An amazing aspect of operating
systems is how varied they are in accomplishing these tasks. Mainframe operating
systems are designed primarily to optimize utilization of hardware. Personal
computer (PC) operating systems support complex games, business applications, and
everything in between. Operating systems for handheld computers are designed to
provide an environment in which a user can easily interface with the computer to
execute programs. Thus, some operating systems are designed to be convenient,
others to be efficient, and others some combination of the two.
Another key ideas, OS is a software that works as an interface between a
user and the computer hardware. The primary objective of an operating system is to
make computer system convenient to use and to utilize computer hardware in an
efficient manner. The operating system performs the basic tasks such as receiving
input from the keyboard, processing instructions and sending output to the screen.
The Software is the Non-Touchable Parts of the Computer , and Software’s
are those which are used for Performing an Operation So that Software’s are just
used for Making an Application but hardware’s are those which are used for
Performing an Operation .
Operating system is software that is required in order to run application
programs and utilities. It works as a bridge to perform better interaction between
application programs and hardware of the computer. Examples of operating system
are UNIX, MS-DOS, MS-Windows - 98/XP/Vista, Windows-NT/2000, OS/2 and Mac
OS.
The image above shows examples of popular operating
systems used over time.
1.1 WHAT OPERATING SYSTEM DO
We begin our discussion by looking at the operating system’s role in the
overall computer system. A computer system can be divided roughly into four
components: the hardware, the operating system, the application programs, and
the users (Figure 1.1). The hardware—the central processing unit (CPU), the
memory, and the input/output (I/O) devices—provides the basic computing
resources for the system. The application programs—such as word processors,
spreadsheets, compilers, and Web browsers—define the ways in which these
resources are used to solve users’ computing problems. The operating system
controls the hardware and coordinates its use among the various application
programs for the various users. We can also view a computer system as consisting of
hardware, software, and data. The operating system provides the means for proper
use of these resources in the operation of the computer system. An operating
system is similar to a government. Like a government, it performs no useful function
by itself. It simply provides an environment within which other programs can do
useful work. To understand more fully the operating system’s role, we next explore
operating systems from two viewpoints: that of the user and that of the system.
Figure 1.1 Abstract view of the components of a computer.
a. User View
The user’s view of the computer varies according to the interface
being used. Most computer users sit in front of a PC, consisting of a monitor,
keyboard, mouse, and system unit. Such a system is designed for one user to
monopolize its resources. The goal is to maximize the work (or play) that the
user is performing. In this case, the operating system is designed mostly for
ease of use, with some attention paid to performance and none paid to
resource utilization—how various hardware and software resources are
shared. Performance is, of course, important to the user; but such systems
are optimized for the single-user experience rather than the requirements of
multiple users. In other cases, a user sits at a terminal connected to a
mainframe or a minicomputer. Other users are accessing the same computer
through other terminals. These users share resources and may exchange
information.
The operating system in such cases is designed to maximize resource
utilization— to assure that all available CPU time, memory, and I/O are used
efficiently and that no individual user takes more than her fair share. In still
other cases, users sit at workstations connected to networks of other
workstations and servers. These users have dedicated resources at their
disposal, but they also share resources such as networking and servers—file,
compute, and print servers. Therefore, their operating system is designed to
compromise between individual usability and resource utilization. Recently,
many varieties of handheld computers have come into fashion. Most of these
devices are standalone units for individual users. Some are connected to
networks, either directly by wire or (more often) through wireless modems
and networking. Because of power, speed, and interface limitations, they
perform relatively few remote operations. Their operating systems are
designed mostly for individual usability, but performance per unit of battery
life is important as well. Some computers have little or no user view. For
example, embedded computers in home devices and automobiles may have
numeric keypads and may turn indicator lights on or off to show status, but
they and their operating systems are designed primarily to run without user
intervention.
b. System View
From the computer’s point of view, the operating system is the
program most intimately involved with the hardware. In this context, we can
view an operating system as a resource allocator. A computer system has
many resources that may be required to solve a problem: CPU time, memory
space, file-storage space, I/O devices, and so on. The operating system acts
as the manager of these resources. Facing numerous and possibly conflicting
requests for resources, the operating system must decide how to allocate
them to specific programs and users so that it can operate the computer
system efficiently and fairly. As we have seen, resource allocation is
especially important where many users access the same mainframe or
minicomputer. A slightly different view of an operating system emphasizes
the need to control the various I/O devices and user programs. An operating
system is a control program. A control program manages the execution of
user programs to prevent errors and improper use of the computer. It is
especially concerned with the operation and control of I/O devices.
DEFINING OPERATING SYSTEMS
We have looked at the operating system’s role from the views of the user and of the
system. How, though, can we define what an operating system is? In general, we
have no completely adequate definition of an operating system. Operating systems
exist because they offer a reasonable way to solve the problem of creating a usable
computing system. The fundamental goal of computer systems is to execute user
programs and to make solving user problems easier. Toward this goal, computer
hardware is constructed. Since bare hardware alone is not particularly easy to use,
application programs are developed. These programs require certain common
operations, such as those controlling the I/O devices. The common functions of
controlling and allocating resources are then brought together into one piece of
software: the operating system. In addition, we have no universally accepted
definition of what is part of the operating system. A simple viewpoint is that it
includes everything a vendor ships when you order “the operating system.” The
features included, however, vary greatly across systems. Some systems take up less
than 1 megabyte of space and lack even a full-screen editor, whereas others require
gigabytes of space and are entirely based on graphical windowing systems. A more
common definition, and the one that we usually follow, is that the operating system
is the one program running at all times on the computer—usually called the kernel.
(Along with the kernel, there are two other types of programs: systems programs,
which are associated with the operating system but are not part of the kernel, and
application programs, which include all programs not associated with the operation
of the system.) The matter of what constitutes an operating system has become
increasingly important. In 1998, the United States Department of Justice filed suit
against Microsoft, in essence claiming that Microsoft included too much
functionalityinitsoperatingsystemsandthuspreventedapplicationvendorsfrom
competing. For example, a Web browser was an integral part of the operating
systems. As a result, Microsoft was found guilty of using its operating-system
monopoly to limit competition.
1.2 COMPUTER-SYSTEM ORGANIZATION
Before we can explore the details of how computer systems operate, we need
general knowledge of the structure of a computer system. In this section, we look at
several parts of this structure. The section is mostly concerned with computer-
system organization, so you can skim or skip it if you already understand the
concepts.
a. Computer-System Operation
A modern general-purpose computer system consists of one or more
CPUs and a number of device controllers connected through a common bus
that provides access to shared memory (Figure 1.2). Each device controller is
in charge of a specific type of device (for example, disk drives, audio devices,
and video displays). The CPU and the device controllers can execute
concurrently, competing for memory cycles. To ensure orderly access to the
shared memory, a memory controller is provided whose function is to
synchronize access to the memory.
For a computer to start running—for instance, when it is powered up
or rebooted—it needs to have an initial program to run. This initial program,
or bootstrap program, tends to be simple. Typically, it is stored in read-only
memory (ROM) or electrically erasable programmable read-only memory
(EEPROM), known by the general term firmware, within the computer
hardware. It initializes all aspects of the system, from CPU registers to device
controllers to memory contents. The boot strap program must know how to
load the operating system and how to start executing that system. To
accomplish this goal, the boot strap program must locate and load into
memory the operating system kernel. The operating system then starts
executing the first process, such as “in it,” and waits for some event to occur.
The occurrence of an event is usually signaled by an interrupt from
either the hardware or the software. Hardware may trigger an interrupt at
any time by sending a signal to the CPU, usually by way of the system bus.
Software may trigger an interrupt by executing a special operation called a
system call (also called a monitor call).
Figure 1.2 A modern computer system
When the CPU is interrupted, it stops what it is doing and
immediately transfers execution to a fixed location. The fixed location usually
contains the starting address where the service routine for the interrupt is
located. The interrupt service routine executes; on completion, the CPU
resumes the interrupted computation.
Interrupts are an important part of a computer architecture. Each
computer design has its own interrupt mechanism, but several functions are
common. The interrupt must transfer control to the appropriate interrupt
service routine. The straightforward method for handling this transfer would
be to invoke a generic routine to examine the interrupt information; the
routine, in turn, would call the interrupt-specific handler. However, interrupts
must be handled quickly. Since only a predefined number of interrupts is
possible, a table of pointers to interrupt routines can be used instead to
provide the necessary speed. The interrupt routine is called indirectly
through the table, with no intermediate routine needed. Generally, the table
of pointers is stored in low memory (the first hundred or so locations). These
locations hold the addresses of the interrupt service routines for the various
devices. This array, or interrupt vector, of addresses is then indexed by a
unique device number, given with the interrupt request, to provide the
address of the interrupt service routine for the interrupting device. Operating
systems as different as Windows and UNIX dispatch interrupts in this manner.
b. Storage Structure
The CPU can load instructions only from memory, so any programs to
run must be stored there. General-purpose computers run most of their
programs from rewriteable memory, called main memory (also called
random-access memory or RAM). Main memory commonly is implemented
in a semiconductor technology called dynamic random-access memory
(DRAM). Computers use other forms of memory as well. Because the read-
only memory (ROM) cannot be changed, only static programs are stored
there. The immutability of ROM is of use in game cartridges. EEPROM cannot
be changed frequently and so contains mostly static programs. For example,
smartphones have EEPROM to store their factory-installed programs.
All forms of memory provide an array of words. Each word has its own
address. Interaction is achieved through a sequence of load or store
instructions to specific memory addresses. The load instruction moves a word
from main memory to an internal register within the CPU, whereas the store
instruction moves the content of a register to main memory. A side from
explicit loads and stores, the CPU automatically loads instructions from main
memory for execution.
A typical instruction–execution cycle, as executed on a system with a
von Neumann architecture, first fetches an instruction from memory and
stores that instruction in the instruction register. The instruction is then
decoded and may cause operands to be fetched from memory and stored in
some internal register. After the instruction on the operands has been
executed, the result may be stored back in memory. Notice that the memory
unit sees only a stream of memory addresses; it does not know how they are
generated (by the instruction counter, indexing, indirection, literal addresses,
or some other means) or what they are for (instructions or data). Accordingly,
we can ignore how a memory address is generated by a program. We are
interested only in the sequence of memory addresses generated by the
running program.
Ideally, we want the programs and data to reside in main memory
permanently. This arrangement usually is not possible for the following two
reasons:
1. Main memory is usually too small to store all needed programs
and data permanently.
2. Main memory is a volatile storage device that loses its contents
when power is turned off or otherwise lost.
Thus, most computer systems provide secondary storage as an
extension of main memory.The main requirement for secondary storage is
that it be able to hold large quantities of data permanently.
The most common secondary-storage device is a magnetic disk, which
provides storage for both programs and data. Most programs (system and
application) are stored on a disk until they are loaded into memory. Many
programs then use the disk as both the source and the destination of their
processing. Hence, the proper management of disk storage is of central
importance to a computer system
Figure 1.3 Storage-device hierarchy.
In a larger sense, however, the storage structure that we have
described— consisting of registers, main memory, and magnetic disks—is
only one of many possible storage systems. Others include cache memory,
CD-ROM, magnetic tapes, and so on. Each storage system provides the basic
functions of storing a datum and holding that datum until it is retrieved at a
later time. The main differences among the various storage systems lie in
speed, cost, size, and volatility.
c. I/O Structure
Storage is only one of many types of I/O devices within a computer. A
large portion of operating-system code is dedicated to managing I/O, both
because of its importance to the reliability and performance of a system and
because of the varying nature of the devices.
A general-purpose computer system consists of CPUs and multiple
device controllers that are connected through a common bus. Each device
controller is in charge of a specific type of device. Depending on the
controller, more than one device may be attached. For instance, seven or
more devices can be attached to the small computer-systems interface (SCSI)
controller. A device controller maintains some local buffer storage and a set
of special-purpose registers. The device controller is responsible for moving
the data between the peripheral devices that it controls and its local buffer
storage. Typically, operating systems have a device driver for each device
controller. This device driver understands the device controller and presents
a uniform interface to the device to the rest of the operating system.
To start an I/O operation, the device driver loads the appropriate
registers within the device controller. The device controller, in turn, examines
the contents of these registers to determine what action to take (such as
“read a character from the keyboard”).The controller starts the transfer of
data from the device to its local buffer. Once the transfer of data is complete,
the device controller informs the device driver via an interrupt that it has
finished its operation. The device driver then returns control to the operating
system, possibly returning the data or apointer to the data if the operation
was a read. For other operations, the device driver returns status
information.
1.1 COMPUTER-SYSTEM ARCHITECTURE
Single-tasking and multi-tasking
A single-tasking system can only run one program at a time, while a multi-
tasking operating system allows more than one program to be running in
concurrency. This is achieved by time-sharing, where the available processor time is
divided between multiple processes. These processes are each interrupted
repeatedly in time slices by a task-scheduling subsystem of the operating system.
Multi-tasking may be characterized in preemptive and co-operative types. In
preemptive multitasking, the operating system slices the CPU time and dedicates a
slot to each of the programs. Unix-like operating systems, such as Solaris and Linux—
as well as non-Unix-like, such as AmigaOS—support preemptive multitasking.
Cooperative multitasking is achieved by relying on each process to provide time to
the other processes in a defined manner. 16-bit versions of Microsoft Windows used
cooperative multi-tasking; 32-bit versions of both Windows NT and Win9x used
preemptive multi-tasking.
Single- and multi-user
Single-user operating systems have no facilities to distinguish users, but may
allow multiple programs to run in tandem. [6] A multi-user operating system extends
the basic concept of multi-tasking with facilities that identify processes and
resources, such as disk space, belonging to multiple users, and the system permits
multiple users to interact with the system at the same time. Time-sharing operating
systems schedule tasks for efficient use of the system and may also include
accounting software for cost allocation of processor time, mass storage, printing, and
other resources to multiple users.
Distributed
A distributed operating system manages a group of distinct, networked
computers and makes them appear to be a single computer, as all computations are
distributed (divided amongst the constituent computers).
Templated
In the distributed and cloud computing context of an OS, templating refers to
creating a single virtual machine image as a guest operating system, then saving it as
a tool for multiple running virtual machines. The technique is used both in
virtualization and cloud computing management, and is common in large server
warehouses.
Embedded
Embedded operating systems are designed to be used in embedded
computer systems. They are designed to operate on small machines with less
autonomy (e.g. PDAs). They are very compact and extremely efficient by design, and
are able to operate with a limited amount of resources. Windows CE and Minix 3 are
some examples of embedded operating systems.
Real-time
A real-time operating system is an operating system that guarantees to
process events or data by a specific moment in time. A real-time operating system
may be single- or multi-tasking, but when multitasking, it uses specialized scheduling
algorithms so that a deterministic nature of behavior is achieved. Such an event-
driven system switches between tasks based on their priorities or external events,
whereas time-sharing operating systems switch tasks based on clock interrupts.
Library
A library operating system is one in which the services that a typical
operating system provides, such as networking, are provided in the form of libraries
and composed with the application and configuration code to construct a unikernel:
a specialized, single address space, machine image that can be deployed to cloud or
embedded environments.
1.2 DISTRIBUTED SYSTEMS
A distributed system is a collection of physically separate, possibly
heterogeneous, computer systems that are networked to provide the users with
access to the various resources that the system maintains.Access to a shared
resource increases computation speed, functionality, data availability, and
reliability. Some operating systems generalize network access as a form of file
access, with the details of networking contained in the network interface’s
device driver. Others make users specifically invoke network functions.
Generally, systems contain a mix of the two modes—for example FTP and NFS.
The protocols that create a distributed system can greatly affect that system’s
utility and popularity.
A network, in the simplest terms, is a communication path between two
or more systems. Distributed systems depend on networking for their
functionality. Networks vary in the protocols used, the distances between nodes,
and the transport media. TCP/IP is the most common network protocol, although
ATM and other protocols are in widespread use. Likewise, operating system
support of protocols varies. Most operating systems support TCP/IP, including
the Windows and UNIX operating systems. Some systems support proprietary
protocols to suit their needs. To an operating system, a network protocol simply
needs an interface device—a network adapter, for example— with a device
driver to manage it, as well as software to handle data. These concepts are
discussed throughout this book.
1.3 SPECIAL-PURPOSE SYSTEMS
a. Real-Time Embedded Systems
Embedded computers are the most prevalent form of computers
in existence. These devices are found everywhere, from car engines and
manufacturing robots to DVDs and microwave ovens. They tend to have
very specific tasks. The systems they run on are usually primitive, and so
the operating systems provide limited features.Usually,they have little or
no user interface,preferring to spend their time monitoring and managing
hardware devices, such as automobile engines and robotic arms.
b. Multimedia Systems
Most operating systems are designed to handle conventional data
such as text files, programs, word-processing documents, and
spreadsheets. However, a recent trend in technology is the incorporation
of multimedia data into computer systems. Multimedia data consist of
audio and video files as well as conventional files. These data differ from
conventional data in that multimedia data—such as frames of video—
must be delivered (streamed) according to certain time restrictions(for
example, 30 frames per second). Multimedia describes a wide range of
applications in popular use today. These include audio files such as MP3,
DVD movies, video conferencing, and short video clips of movie previews
or news stories downloaded over the Internet. Multimedia applications
may also include live web casts (broadcasting over the World Wide Web)
of speeches or sporting events and even live web cams that allow a
viewer in Manhattan to observe customers at a Paris cafe. Multimedia
applications need not be either audio or video; rather, a multimedia
application often includes a combination of both. For example, a movie
may consist of separate audio and video tracks. Nor must multimedia
applications be delivered only to desktop personal computers.
Increasingly, they are being directed toward smaller devices, including
PDAs and cellular telephones.
CHARACTERISTICS OF OPERATING SYSTEM
1. Operating System is a Collection of Programs those are Responsible for the
Execution of other Programs.
2. Operating System is that which Responsible is for Controlling all the Input and
Output Devices those are connected to the System.
3. Operating System is that which Responsible is for Running all the Application
Software’s.
4. Operating System is that which Provides Scheduling to the Various Processes
Means Allocates the Memory to various Process those Wants to Execute.
5. Operating System is that which provides the Communication between the
user and the System.
6. Operating System is Stored into the BIOS Means in the Basic Input and
Output System means when a user Starts his System then this will Read all
the instructions those are Necessary for Executing the System Means for
Running the Operating System, Operating System Must be Loaded into the
Computer For this, this will use the Floppy or Hard Disks Which Stores the
Operating System.