Unit I
Unit I
Unit I
Chapter 1 Marks 10
1.0 INTRODUCTION
Computer software can be divided into two main categories: application software and system software.
Application software consists of the programs for performing tasks particular to the machine’s utilization.
This software is designed to solve a particular problem for users. Examples of application software include
spreadsheets, database systems, desktop publishing systems, program development software, and games.
On the other hand, system software is more transparent and less noticed by the typical computer user. This
software provides a general programming environment in which programmers can create specific
applications to suit their needs. This environment provides new functions that are not available at the
hardware level and performs tasks related to executing the application program. System software acts as an
interface between the hardware of the computer and the application software that users need to run on the
computer. The most important type of system software is the operating system.
An Operating System (OS) is a collection of programs that acts as an interface between a user of a computer
and the computer hardware. The purpose of an operating system is to provide an environment in which a user
may execute the programs.
Operating Systems are viewed as resource managers. The main resource is the computer hardware in the
form of processors, storage, input/output devices, communication devices, and data. Some of the operating
system functions are: implementing the user interface, sharing hardware among users, allowing users to share
data among themselves, preventing users from interfering with one another, scheduling resources among
users, facilitating input/output, recovering from errors, accounting for resource usage, facilitating parallel
operations, organizing data for secure and rapid access, and handling network communications.
[Type text]
[Type text]
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.
[Type text]
[Type text]
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.
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 within
the computer hardware in read-only memory (ROM) or electrically erasable programmable read-only
memory (EEPROM), known by the general term firmware. It initializes all aspects of the system, from CPU
registers to device controllers to memory contents. The bootstrap program must know how to load the
operating system and how to start executing that system. To accomplish this goal, the bootstrap program
must locate the operating-system kernel and load it into memory.
Once the kernel is loaded and executing, it can start providing services to the system and its users. Some
services are provided outside of the kernel, by system programs that are loaded into memory at boot time to
become system processes, or system daemons that run the entire time the kernel is running.
[Type text]
[Type text]
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).
Computers use other forms of memory as well. We have already mentioned read-only memory, ROM) and
electrically erasable programmable read-only memory, EEPROM). Because ROM cannot be changed, only
static programs, such as the bootstrap program described earlier, are stored there. The immutability of ROM
is of use in game cartridges. EEPROM can be changed but cannot be changed frequently and so contains
mostly static programs. For example, smartphones have EEPROM to store their factory-installed programs.
Ideally, we want the programs and data to reside in main memory permanently. Thisarrangement 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 offor otherwise
lost.
[Type text]
[Type text]
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 ofdata 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,
1.8 FUNCTIONS OF OS
The main functions of an operating system are as follows:
1. Process Management
2. Memory Management
3. Secondary Storage Management
4. I/O Management
5. File Management
6. Protection
7. Networking Management
8. Command Interpretation.
[Type text]
[Type text]
processes. A process is a program in execution. Typically, a batch job is a process. A time- shared user
program is a process. A system task, such as spooling, is also a process. For now, a process may be
considered as a job or a time- shared program, but the concept is actually more general.
The operating system is responsible for the following activities in connection with processes management:
1. The creation and deletion of both user and system processes
2. The suspension and resumption of processes.
3. The provision of mechanisms for process synchronization
4. The provision of mechanisms for deadlock handling.More
details can be studied in the Unit-2 of this course.
[Type text]
[Type text]
For convenient use of the computer system, the operating system provides a uniform logical view of
information storage. The operating system abstracts from the physical properties of its storage devices to
define a logical storage unit, the file. Files are mapped, by the operating system, onto physical devices.
A file is a collection of related information defined by its creator. Commonly, files represent programs (both
source and object forms) and data. Data files may be numeric, alphabetic or alphanumeric. Files may be free-
form, such as text files, or may be rigidly formatted. In general a file is a sequence of bits, bytes, lines or
records whose meaning is defined by its creator and user. It is a very general concept.
The operating system implements the abstract concept of the file by managing mass storage device, such as
types and disks. Also files are normally organized into directories to ease their use. Finally, when multiple
users have access to files, it may be desirable to control by whom and in what ways files may be accessed.
The operating system is responsible for the following activities in connection to the file management:
1. The creation and deletion of files.
2. The creation and deletion of directory.
3. The support of primitives for manipulating files and directories.
4. The mapping of files onto disk storage.
5. Backup of files on stable (non volatile) storage.
[Type text]
[Type text]
1.8.6 Protection
The various processes in an operating system must be protected from each other’s activities. For that
purpose, various mechanisms which can be used to ensure that the files, memory segment, CPU and other
resources can be operated on only by those processes that have gained proper authorization from the
operating system.
For example, memory addressing hardware ensures that a process can only execute within its own address
space. The timer ensures that no process can gain control of the CPU without relinquishing it. Finally, no
process is allowed to do its own I/O, to protect the integrity of the various peripheral devices. Protection
refers to a mechanism for controlling the access of programs, processes, or users to the resources defined by
a computer controls to be imposed, together with some means of enforcement.
Protection can improve reliability by detecting latent errors at the interfaces between component subsystems.
Early detection of interface errors can often prevent contamination of a healthy subsystem by a subsystem
that is malfunctioning. An unprotected resource cannot defend against use (or misuse) by an unauthorized or
incompetent user.
1.8.7 Networking
A distributed system is a collection of processors that do not share memory or a clock. Instead, each processor
has its own local memory, and the processors communicate witheach other through various
communication lines, such as high speed buses or telephonelines. Distributed systems vary in size and
function. They may involve microprocessors,workstations, minicomputers, and large general purpose
computer systems.
The processors in the system are connected through a communication network, which can be configured in
the number of different ways. The network may be fully or partially connected. The communication network
design must consider routing and connection strategies and the problems of connection and security.
A distributed system provides the user with access to the various resources the system maintains. Access to a
shared resource allows computation speed-up, data availability, and reliability.
[Type text]
[Type text]
The command statements themselves deal with process management, I/O handling, secondary storage
management, main memory management, file system access, protection,and networking.
Figure depicts the role of the operating system in coordinating all the functions.
An Operating System performs all the basic tasks like managing file, process, and memory.Thus operating
system acts as manager of all the resources, i.e. resource manager. Thus operating system becomes an
interface between user and machine.
Types of Operating Systems: Some of the widely used operating systems are as follows-
1. Batch OS –
This type of operating system does not interact with the computer directly. The user has to submit a job
(written on cards or tape) to a computer operator. There is an operator which takes similar jobs having same
requirement and group them into batches. It is the responsibility of operator to sort the jobs with similar
needs. Then computer operator places a batch of several jobs on an input device. Jobs are batched together
by type of languages and requirement. Then a special program, the monitor, manages the execution of each
program in the batch. The monitor is always in the main memory and available for execution.
[Type text]
[Type text]
2. Multi programming –
In a modern computing system, there are usually several concurrent application processes which want to
execute. Now it is the responsibility of the Operating System to manage allthe processes
effectively and efficiently. One of the most
important aspects of an Operating System is to multi program. In a computer system, there are
multiple processes waiting to be executed, i.e. they are waiting when the CPU will be allocated to them and
they begin their execution. These processes are also known as jobs. Now the main memory is too small to
accommodate all ofthese processes or jobs into it. Thus, these processes are initially kept in an area called job
pool. This job pool consists of all those processes awaiting allocation of main memory and CPU.
CPU selects one job out of all these waiting jobs, brings it from the job pool to main memory and starts
executing it. The processor executes one job until it is interrupted by some external factor or it goes for an
I/O task.
[Type text]
[Type text]
3. Multitasking –
As the name itself suggests, multi tasking refers to execution of multiple tasks (say processes, programs,
threads etc.) at a time. In the modern operating systems, we are able to play MP3 music, edit documents in
Microsoft Word, surf the Google Chrome all simultaneously, this is accomplished by means of multi tasking.
Multitasking is a logical extension of multi programming. The major way in which multitasking differs from
multi programming is that multi programming works solely on the concept of context switching whereas
multitasking is based on time sharing alongside the concept of context switching.
[Type text]
[Type text]
As depicted in the above image, At any time the CPU is executing only one task whileother tasks
are waiting for their turn. The illusion of parallelism is achieved when theCPU is reassigned to
another task. i.e all the three tasks A, B and C are appearing to occur simultaneously because of
time sharing.
So for multitasking to take place, firstly there should be multiprogramming i.e. presence of multiple
programs ready for execution. And secondly the concept of timesharing.
4. Multiprocessing –
In a uni-processor system, only one process executes at a time.
Multiprocessing is the use of two or more CPUs (processors) within a single Computer system. The term
also refers to the ability of a system to support more than one processor
[Type text]
[Type text]
within a single computer system. Now since there are multiple processors available, multiple processes
can be executed at a time. These multi processors share the computerbus, sometimes the clock, memory
and peripheral devices also.
Multiprocessing refers to the hardware (i.e., the CPU units) rather than the software (i.e., running
processes). If the underlying hardware provides more than one processor then thatis multiprocessing. It is
the ability of the system to leverage multiple processors’ computingpower.
[Type text]
[Type text]
basically executing multiple processes at the same time on multiple processors,whereas multi
programming is keeping several programs in main memory and executing them concurrently
using a single CPU only.
Multiprocessing occurs by means of parallel processing whereas Multi programmingoccurs by
switching from one process to other (phenomenon called as context switching).
[Type text]