Operating Systems
UNIT - 1 INTRODUCTION TO
OPERATING SYSTEMS
STRUCTURE
1.0 Learning Objectives
1.1 Introduction
1.2 Evolution of Operating Systems
1.3 Types of Operating Systems
1.3.1 Batch Operating System
1.3.2 Multiprogramming Operating System
1.3.3 Distributed Operating System
1.3.4 Time-Sharing Operating System
1.3.5 Multiprocessor Operating System
1.3.6 Network Operating System
1.3.7 Real-Time Operating System
1.3.8 Mobile Operating System
1.4 Different Views of the Operating Systems
1.4.1 The Command Language User’s View
1.4.2 The System Call User’s View
1.5 Principles of Design and Implementation
1.5.1 Functional Requirements
1.5.2 Implementation
1.6 The Process Concept
1.6.1 System Programmer’s View of Processes
1.6.2 Operating System’s View of Processes
1.7 Operating System Services for Process Management
1.8 Let us sum up
1.9 Keywords
Operating Systems
1.10 Some useful books
1.11 Answer to check your progress
1.12 Terminal Questions
1.0 LEARNING OBJECTIVES
After studying this unit, you will be able to:
● Explain the operating system and its evolution.
● Describe the functions of an operating system.
● Identify and explain the different types of operating systems.
● Outline the design principles used in operating systems.
● Explain the process of operating system and its management.
1.1 INTRODUCTION
An Operating System (OS) is system software that manages the resources
of a computer, such as a computer’s hardware (including memory and
processes) and its software. It also offers frequent services for computer
programs. Along with providing the basis for application programs, the
OS also connects the computer user with the computer hardware. ATM
machines, mobile phones and many modern-day automobiles are some
which make use of operating systems. The OS has a set of programs that
is loaded on to the memory. The processor will then execute these
programs. Once the computer is switched off, it will be present only as a
set of files on a disk drive. Basic tasks, such as sending output to the
display screen, identifying input from the keyboard, tacking directories
and files on the disk, and controlling other devices such as printers and
disk drivers, are also done by operating systems. Operating systems such
OS X from Apple and Windows from Microsoft are well-known along
with the less popular Linux/GNU (Ubuntu, Fedora, and so on).
Operating Systems
A computer’s OS manages all of the software and hardware on the
computer. Operating systems vary in accomplishing the various tasks in a
wide variety of computing environments. A fundamental responsibility of
an OS is to allocate computer hardware resources to programs.
The operating system, as shown in Figure 1.1, controls the operation of the
computer. This includes determining which programs may use the
processor at any given time, managing system resources such as secondary
storage and working memory, and controlling access to input and output
devices. In addition to these, an OS provides an interface between the user
and the system. This enables user-interaction with the system to be carried
out in an optimal manner.
Figure 1.1: Basic task of an operating system
For any program to be run on any computer system, at least one OS is
mandatory. Any application, say, for example, MS Word or Chrome,
needs an environment to run and finish its tasks. With the use of an OS,
one can communicate easily with the computer even without having any
knowledge of computer languages. Without the operating system, it is not
possible to use any computer or mobile device.
During operations, the focus of an OS is on program execution, usage of
resources and to prevent any interference with resources and programs.
Operating Systems
Accordingly, its three principal functions are: Program management,
resource management and Security and protection.
An operating system’s functions of program management and resource
management help to ensure efficient use of resources and user
convenience, and the functions of security and protection prevent
interference with programs and resources.
The primary goals of an operating system are:
● Ensuring efficient use of a computer’s resources.
● Providing easy methods of using a computer system.
● Preventing interference in the activities of its users.
● Offering a convenient interface while using the computer system.
● Hiding from the users, information pertaining to hardware
resources.
● Efficient resource sharing between programs and users.
● Managing the resources of the computer system.
● Ensuring uniform resource sharing between programs and users.
Principal functions of an OS, as shown in figure 1.2 are:
● Process management
● Memory management
● File management
● Device management
● Secondary storage management
● Security
● Coordination between users and various other software
● Networking
● Job accounting
● Error-detecting aids
Operating Systems
Figure 1.2: Functions of an operating system
In modern times, an OS provides complex networking functionality and
also has compatibility with peripherals and multiple communication
devices. Nowadays, a number of operating systems have implement
Application Programming Interface (API). This has eased up the process
of writing programs for these operating systems and also brought about a
standardized application environment.
1. Process management: Process Management offers support for an OS
in the creation and deletion processes. It also provides a mechanism to
synchronize and communicate among different processes. An OS
performs the following activities for process management:
● Tracks the processor and the status of a process. Any software that
does this task is called a traffic controller.
● Assigns the processor to the process.
● Performs the task of the de-allocated processor if a process is not
required for the processor.
2. Memory management: Under memory management, both primary and
secondary memories are managed. The memory management module
carries out the job of allocating and deallocating memory to the program.
Operating Systems
Some of the activities performed by the OS under memory management
are as follows:
● Keeping track of memory, that is, the parts that are in use, and those
that are not.
● Helping allocate the memory at the time when the process request
for memory.
● De-allocating memory, if a process no longer needs it.
● Allocating memory to the processes in multiple programming.
3. File management: To bring about ease in usage, the file system is
organized into various directories. These directories consist of directories
and other files. They handle tasks that are file-related, such as retrieval,
naming, sharing, organization storage, and file protection. They also
preserve information, status, users, location, and so on.
4. Device management: Along with keeping track of devices and
effective device management, an OS also carries out the task of allocating
and de-allocating devices. Device communication takes place through
their respective drivers, with the help of an OS.
5. Secondary storage management: An OS has multiple storage levels
which include primary, secondary, and cache storage. The primary or
cache memory stores a set of instructions and data. This helps the program
that is currently running in reference.
6. Security: An OS offers security by protecting information and data
from unauthorized access and threats.
7. Coordination between the user and other software: An OS
coordinates between a user and other software. In addition to direction, it
also allocates interpreters, assemblers, compilers, and software to multiple
computer system users.
8. Networking: A distributed system is a collection of processors that do
not share clock and memory hardware devices. Using the network,
communication takes place between multiple processors.
9. Job accounting: Tracking time and resources that are utilized by
various jobs and users are part of an OS’s job accounting function.
Operating Systems
10. Error detecting aids: Another principal function of an OS is error
detection. It continuously checks the system to find errors and prevents the
system from error.
Basic Elements of the Operating System
The basic elements of the Operating System, as shown in Figure 1.3, are:
● Main memory
● Processor
● System bus
● I/O modules
Figure 1.3: Basic Elements of the operating system
Main Memory: The main memory, where the programs and data are
stored, is also known as volatile or primary memory. This is so because
when the user switches off the system, memory content is immediately
erased and is therefore lost.
Processor: A processor is defined as an integrated electronic circuit which
performs the job of calculations in the computer. It completes arithmetical
logical operations, I/O functions and key instructions that are given by the
OS.
Operating Systems
In addition to performing data processing functions, the processor also
controls the processes in the computer. In the case of only one processor
being present, then it is called the Central Processing Unit (CPU).
A processor may also include a control unit and an arithmetical logical
unit, using which the capability is measured in terms of the following:
● Maximum number of bits or instructions
● Relative clock speed
● Capability of processing instructions at a given time
System Bus: The system bus controls the communication between the
main memory, the processors and the I/O modules.
I/O Modules: The I/O modules carry the data from inside the computer to
the peripheral external environment. The external environment includes
different types of devices such as communications equipment such as
LAN cables, secondary memory (pen drives, CDs, and so on), and
terminals and so on.
1.2 EVOLUTION OF OPERATING SYSTEMS
From being costly and slow, operating systems have evolved to current
technology with increased speed and reduced cost. Earlier, program codes
were loaded manually to control various computer functions and process
codes that were related to business logic. However, this brought about
problems with set up time and program scheduling. With an increase in
the volume of users, there comes a need for improved efficiency, growth
and convenience. The result of this need was the development of an OS
that processed jobs in batches. Then multitasking and time sharing were
created that allowed running multiple jobs and also allowed user
interaction.
The First Generation (1940s - Early 1950s)
In the 1940s, the earliest computers did not have any OS. Punch cards and
magnetic tapes were used to load programs, with the output going to a
printer, in case the program did not abort due to errors.
Operating Systems
If an error occurred, the indicator lights would alert the programmer. Users
requiring computer time would need to sign a sheet citing the time they
needed. Sometimes, they would also need to reschedule jobs due to time
constraints. The basic functions were controlled by wiring up plug-boards
and absolute machine language was used for programming. Jobs were
scheduled for execution and computer resources were supervised by
human operators. However, this scheduling type had problems if a
program was error-prone or had failures. The computers of this generation
were customarily used to do simple math calculations.
The Second Generation (1955-1965)
General Motors created the GMOS for IBM's machine, the 701. This was
the first operating system to be introduced in the early 1950s. As the data
was uploaded in groups, the OSs of the 1950s were known as single-stream
batch processing systems. The operator loaded user jobs in a sequence in
batches that were accessed by monitor software. Because of this reason,
set up time and the efficiency of scheduling greatly improved. Each job
was processed by the monitor in the same order in which it was loaded.
The sequence was followed until all jobs were finished. However, in spite
of the improvement over serial processing, simple batch processing was
still slow and time-consuming. Professional operators used these new
machines (called mainframes) in large computer rooms. Due to their
exorbitant prices, these mainframes were used only by large corporations
or government agencies.
The Third Generation (1965-1980)
By the later part of the 1960s, the system of multi programming was
developed by operating systems designers. Under this system, a computer
program could carry out multiple jobs simultaneously. Multiprogramming
was introduced in this generation. Under this, a CPU could be busy almost
100 percent of the time it was operating.
Another significant development was the extraordinary growth of
minicomputers, which started with the DEC PDP-1 in 1961. The PDP-1
contained only 4K of 18-bit words. However, priced at $120,000 per
machine, it was still in high demand. The price was less than five per cent
compared to that of a 7094.
Operating Systems
These microcomputers were instrumental in creating a totally new industry
and in developing more PDPs, which in turn helped in the creation of
personal computers in the next generation.
The Fourth Generation (1980 – To Present Day)
Personal computing came into effect in the fourth generation. Personal
computers were much cheaper than computers, that even individuals could
own them. Microsoft and the Windows OS were instrumental in creating
personal computers. Paul Allen and Bill Gates first created the Windows
OS in 1975. Though complex due to its cryptic commands, the MS-DOS,
introduced in 1981, was still effective. The Windows OS has become the
leading operating system used in today’s technology. In the 1980s, another
major creation was the Apple Macintosh by Steve Jobs. This became
extremely successful due to its user friendliness. Today, starting from our
smartphones to motor vehicles, all electronic devices run on OS. The OS
also advances with advancements in technology.
Check Your Progress-1
1. What defines the first generation of computers?
__________________________________________________________
__________________________________________________________
_________________________________________________________
2. Name a significant development in the second generation of computers.
__________________________________________________________
__________________________________________________________
_________________________________________________________
3. What was the impact of third-generation computers on software?
__________________________________________________________
__________________________________________________________
__________________________________________________________
Operating Systems
1.3 TYPES OF OPERATING SYSTEMS
There are different kinds of operating systems based on the hardware,
application requirements and functionality of the OS.
There are various types of operating systems:
● Batch operating system
● Multiprogramming operating system
● Distributed operating system
● Time-sharing operating system
● Multiprocessor operating system
● Network operating system
● Real-time operating system
● Mobile operating system
1.3.1 Batch Operating System
In the batch operating system, as shown in Figure 1.4, there is no direct
communication between the user and the computer. A user submits a job
to the computer operator, who in turn creates a batch of jobs on a particular
input device. The number of jobs created depends on the type of language
and the requirements. Once the batch of jobs has been created, each
program in a batch will be monitored and managed by a special program.
A few examples of this are bank statements, payroll systems, and so on.
Figure 1.4: Batch operating system
Operating Systems
Advantages of Batch Operating System
● There is no mechanism to prioritize the processes.
● There is no communication between the user and the computer.
● The ideal time is very less for a batch operating system.
Disadvantages of Batch Operating System
● It is hard to debug.
● The batch operating systems are costly.
1.3.2 Multiprogramming Operating System
In the Multiprogramming Operating System, as shown in Figure 1.5, the
operating system first selects the job, and after selecting the job, it begins
to execute one of the jobs from memory. When an I/O operation operating
system is required, the job switches to a different job. In this, the jobs that
are there in the memory are always less than the jobs that are there in the
job pool.
If multiple jobs are ready to execute simultaneously, then the job is
selected for CPU scheduling. In a batch operating system, the CPU is idle
at times without performing any task. However, in the multi-programming
operating system, the CPU is busy with continuous processing.
Figure 1.5: Multiprogramming operating system
Operating Systems
1.3.3 Distributed Operating System
Distributed operating systems, as shown in Figure 1.6, is also known as
loosely-coupled systems. Here, multiple central processors are utilised to
serve multiple users and a number of real-time applications. Accordingly,
the jobs of data processing are shared in the processors, which may be
different in both size and function. In these processors, interaction happens
through communication lines such as high-speed buses, telephone lines
and so on.
Figure 1.6: Distributed operating system
Types of Distributed Operating System
There are two types of distributed operating system:
● Client-server systems
● Peer-to-peer system
Advantages of Distributed Operating System
● Electronic mail helps increase the speed of information exchange.
● Improved services are offered to customers.
● Delays in data processing are reduced.
● Due to the resource-sharing ability, a user can access resources at
multiple sites.
Operating Systems
● Due to its reliability, other sites work properly despite a failure in
one site.
● Load on the host computer is greatly reduced.
Disadvantages of Distributed Operating System
● These systems are costly.
● In case any failure occurs in the central network, whole
communication is stopped.
1.3.4 Time-Sharing Operating System
The time-sharing system, shown in Figure 1.7, is also called multitasking
systems. In this OS, each job is assigned some time to ensure that all the
jobs work smoothly and efficiently. The task may range from a single user
to multiple users. The time taken by every job for job-execution is called
quantum. After this time-interval is over, the OS moves on to the
subsequent task. By using time-sharing OS, multiple users can be placed
at multiple terminals. This allows them to simultaneously make use of a
specific system. Time-sharing allows sharing the processor’s time with
various users at the same time.
The main difference between multiprogramming batch OS and time-
sharing OS is that the time-sharing OS allows minimizing the response
time. On the other hand, multiprogramming batch OS increases the use of
the processor.
Figure 1.7: Time-sharing operating system
Operating Systems
Advantages of Time-Sharing Operating System
● The CPU remains active for more time.
● There is uniformity among the jobs.
● It quickly responds.
Disadvantages of Time-Sharing Operating System
● There is the problem of data communication.
● It is not reliable.
● It is more complex than the multiprogrammed operating system.
● There is a need for protection and management of memory, as
several jobs are there in the memory simultaneously.
● In order to maintain a file system, there is a need for disk
management.
● Concurrent execution is possible. However, this needs
sophisticated CPU scheduling schemes.
1.3.5 Multiprocessor Operating System
A multiprocessor operating system, as shown in Figure 1.8, utilises two or
more than two processors inside a single computer system. These multiple
processors closely communicate and share the computer bus, memory and
other devices that are peripheral. These systems are called tightly-coupled
systems. They offer computing power and high speed. In a multiprocessor
operating system, a single OS is used by all the processors.
Figure 1.8: Multiprocessor operating system
Operating Systems
Advantages of Multiprocessor
● Improved performance is possible.
● Maximisation of the number of processors allows more work to be
done in less time, thereby increasing throughput.
● Increased reliability is also possible in this system.
1.3.6 Network Operating System
The network operating systems or tightly-coupled systems help
workstations and personal computers. Refer to Figure 1.9. These OS
operate on a server. They also provide the facility of applications, users,
security, data management and various other networking-related
functions. The intention is to allow printer access and file sharing across
various computers in a particular network, such as Local Area Network
(LAN), private network and so on. Some examples of networking OS are
Linux, Novell NetWare, Unix, BSD and Microsoft Windows Server 2008.
Figure 1.9: Network operating system
Advantages of Networking Operating System
● Servers can be accessed remotely from different locations.
● It allows easy up gradation of new technologies.
● It improves scalability.
Operating Systems
● The servers are also responsible for managing security.
Disadvantages of Networking Operating System
● It needs regular maintenance and updates.
● It is costly.
● Many operations are dependent on a centralised location.
1.3.7 Real-Time Operating System
Real-time operating systems, as shown in Figure 1.10, which have quick
and fast responses, are utilised in real-time applications wherein the data
processing is to be completed in a fixed time-interval. This OS is used in
instances where a large number of events need to be processed within a
short time span.
Figure 1.10: Real-time operating systems
This OS, which is based on clock interrupts, differs from all other
operating systems, as the time concept is of the utmost importance here.
This OS executes processes on the basis of priority, wherein the highly
prioritised process is first executed. Whenever a high priority process is
entered into the system, there is an attempt by a low priority process to
pre-empt in order to serve the high priority process.
Operating Systems
In order to facilitate smooth and efficient interaction between the different
processes, the real-time OS synchronises the entire process. This ensures
effective use of resources without any time wastage. A few examples of
real-time operating systems are industrial systems, medical imaging
systems, networked multimedia systems, nuclear reactors, traffic-
controlling signals, software used in the military, airline resolution system,
Internet telephony and so on.
Types of Real-Time Operating System
Following are the three types of real-time operating system:
● Hard real-time
● Soft real-time
● Firm real-time
Hard-real time: In a hard-real time system, there is a deadline for task
execution. Here, the execution of a task should start at a particular
scheduled time and be completed within the assigned time duration. Few
examples of this are found in aircraft systems and medical critical care
systems.
Soft-real time: This is the same as hard-real time OS, but here some delay
in time is permissible. Therefore, in soft-real time OS, deadlines are
handled in a delicate manner. Live display of stock prices and any online
transaction systems are examples of this.
Firm-real time: In the firm-real time system, there is a deadline set for
each task execution. Though there may be less impact in case of missed
deadlines, problems may arise in product quality. One example of this is
multimedia applications.
Advantages of Real-Time Operating System
● They are not prone to errors and facilitate management of memory
allocation.
● Devices and systems can be better utilised and increased output is
produced from all the resources.
Operating Systems
● The main focus is on running the applications with reduced priority
given to those applications that are in the queue.
Disadvantages of a Real-Time Operating System
● Creating an algorithm is difficult.
● Due to its use of heavy system resources, it is costly.
● For a real time system to function accurately, it has to return the
correct result within the given time limits.
● Generally, data is stored in short term memory or ROM. This is
due to a lack or minimum amount of secondary storage.
● This system also lacks advanced OS features.
1.3.8 Mobile Operating System
Mobile operating system is another type of operating system, primarily
designed to power smartphones, wearable devices and tablets such as
Android, BlackBerry, WatchOS and so on.
As far as personal computers are concerned, Microsoft Windows, macOS,
and Linux are the three most prominent operating systems. Starting from
the mid-1980s, the Windows OS by Microsoft has had many versions over
the years, with Windows 7 being released in 2009, Windows 8 in 2012 and
the latest Windows 10 released in 2015. Apple created the macOS (earlier
called OS X), which comes pre-loaded on all Mac computers. The Linux
OS is open-source and can therefore be modified and distributed by
anyone across the globe.
Classes of Operating Systems
As computer systems and the expectations of users have gradually
developed, classes of operating systems have also evolved accordingly.
Refer to Table 1.1.
OS class Period Prime Key concepts
concern
Batch 1960s CPU idle Automate transition
processing time between jobs
Operating Systems
Multi 1960s Resource Program priorities, pre-
programming utilization emption
Time-sharing 1970s Good Time slice, round-robin
response scheduling
time
Real time 1980s Meeting Real-time scheduling
time
constraints
Distributed 1990s Resource Distributed control,
sharing transparency
Table 1.1: Key features of classes of operating systems
Every OS is unique and designed to meet specific goals. All OS can be
generally classified into the following categories:
● A mainframe operating system such as IBM’s OS/390, runs on
mainframes and gives immense I/O and availability. As they have a
batch environment, jobs can be segregated into different batches with
the same type of requirements, where the computer runs each batch.
Batching together jobs with the same type of system requirements help
streamline the processing. On the other hand, the system may allow
transaction processing, where thousands or hundreds of small requests
need to be executed every second. Generally, user interaction is not
required in these systems, as the main focus is on the computer’s
utilisation.
● A server operating system is run on servers. The goal is to offer
services to multiple users simultaneously. File storage, applications,
print and various networking operations are a few services offered. The
main focus is on the response time of the user as well as computer
utilisation. Server systems are used more for general purposes than the
various types of operating systems. A few examples of this type of OS
are Linux, Solaris and Windows 2K.
Operating Systems
● A personal computer operating system is gives a rich
environment to a single user at a time. User interface elements such
as GUIs and desktops are of prime importance here. User
experience and the response time take precedence over efficient
computer utilisation. Windows 7 and Mac OS Xare good examples
of this. Though it can handle multiple users simultaneously, Linux
can also be considered a good example.
● A real-time system, such as the QNX operating system, is
designed to respond to input within certain time constraints. This
input is generally obtained not from humans, but from external
sensors. As a result, there is generally minimal or no user
interaction. Many embedded systems are examples of real-time
systems.
● An embedded operating system such as Symbian, has very little
or no application software. Here, the OS is built into the computer
and exerts control over external hardware. Computers that are built
into Digital Versatile Discs (DVD) and the Personal Digital
Assistant (PDA), microwaves and some cars are a few examples.
1.4 DIFFERENT VIEWS OF THE OPERATING
SYSTEMS
An operating system is designed to allow interactions between the user
application programs and the system hardware, by creating an
environment wherein various programs and applications can be useful.
The OS can be seen from either the user’s point of view, called the user
view or the system’s, called the system view.
1.4.1 The Command Language User’s View
The command language user’s view depends on the system interface that
is used by the users, as shown in Figure 1.11.
Operating Systems
Figure 1.11: Abstract view of the components of a computer system
Following are few of the various types of user view experiences:
● If the user is using a personal computer, the operating system is largely
designed to make the interaction easy. As personal computers use all
available resources and do not share any, the OS has no need to focus
on resource utilization.
● If the user is using a system that is connected to a minicomputer or a
mainframe, the OS mainly focuses on resource utilization. This is
because there might be multiple terminals that have connection to the
mainframe. The OS has to ensure that all of the resources such as
memory, CPU, and the I/O devices are divided equally between them.
● Various networks connect the user working on one workstation to other
workstations. Therefore, the OS has to focus on the sharing of resources
through the network and also the individual usage of resources. This
occurs because on one hand, the workstation has to share files with
various workstations across the network and on the other hand,
exclusively use its own resources.
● In case a user is utilising a handheld computer such as a mobile, then
the OS also takes care of the usability of the device. This also includes
some remote operations along with monitoring the device’s battery
level.
Some devices such as automobiles and embedded computers that are
present in home devices have less to no user view as there is nil interaction
with the users.
Operating Systems
1.4.2 The System Call User’s View
The operating system bridges the gap between hardware and the
applications. It is more closely connected with the hardware and is made
use of to control it when required.
Following are the various types of system view for operating system:
● The system looks at the OS as a resource allocator. Various
resources such as memory space, CPU time, file storage space, I/O
devices and so on are needed by processes for execution. The OS
allocates all such resources judiciously allocated to the processes
to ensure smooth running of the computer.
● To ensure smooth and error-free computer operations, the
operating system can also work as a control program by managing
all the processes and the I/O devices.
● As computers are expected to solve user problems with ease, OS is
needed to make the use of computer hardware easy.
● An operating system is also seen as a program that runs at all times
in the computer system’s background which, is known as the
kernel and handles all the application programs.
Check Your Progress-2
1. How does CLUV contribute to user productivity?
__________________________________________________________
__________________________________________________________
________________________________________________________
2. How do user-level programs invoke system calls?
__________________________________________________________
__________________________________________________________
________________________________________________________
1.5 PRINCIPLES OF DESIGN AND IMPLEMENTATION
The services offered by an operating system are dependent on the concepts
based on which the operating system was created.
Operating Systems
As a result, every programmer’s interface, that is, the services provided by
the API, is unique. Despite this, most OS share a few common concepts.
Design and Structure of OS: Monolithic, Layered and Modular
1.5.1 Functional Requirements
Increased system functionality brought about increased maintenance
issues. As a result, operating systems started becoming modular, wherein
some pieces of the OS can be replaced or installed as required. For
example, a process scheduler can be replaced with its alternate versions.
Specific device drivers such as USB or iSCSI can be created as individual
modules and then plugged in to the kernel, that is, linked to the kernel after
loading the base part. A fine example of this structure is the Linux
modules.
Subsequently, the core operating system was kept small in order to migrate
to individual programs that had the proper security privileges to do just the
required. Separate processes would be invoked by the kernel to handle
operations such as file system parsing, network interfacing and taking a
process scheduling decision. This approach is called a microkernel.
However, the monolithic model and the client-server model are the two
most common operating system designs.
Monolithic Structure
● In the monolithic model, the OS is written as a set of routines. Each
of these can call any of the other routines as needed. At the time of
build, after each routine compilation, they are linked together and a
single program called the operating system kernel is created.
● When the OS is started, this kernel is loaded into the computer's
memory. This is next run in the kernel mode. The monolithic design
model is used by many versions of Unix. This also includes Linux.
● In this design model, each part of the OS can view all other parts.
As a result, a bug present in one part has the potential to destroy
the data that is in use in another part. It will be slow and difficult
to recompile the operating system.
Operating Systems
● To overcome this issue, many designers have in place few
overriding structures on their operating system design, wherein
most of the data structures and routines are only visible to other
routines that require them.
● The kernel functionality has various sections, with each providing
a number of interface routines. These routines can be further used
by other sections.
● As Unix is monolithic, one particular section of the OS can call
another with function calls, or make use of another section's data.
Every box is a collection of C source files.
Layered Structure
Despite containing multiple pieces, an OS can retain more control on a
system. In the layered structure, the OS has a number of layers or levels.
The topmost layer (layer N) is the user interface and the bottom most layer
(layer 0) is the hardware. These layers are designed in such a way that each
layer makes use of the functions of only the lower-level layers. As a result,
the debugging process is simplified. In this model, if an error takes place
in the lower-level layer during debugging, then the error is contained only
to that layer as those layers have already been debugged.
However, at each layer, the data needs to be modified and passed on. This
adds overhead to the system and this is the main disadvantage of the
layered structure. In addition, layers need to be carefully planned as a layer
can use only lower-level layers. UNIX is an example of this structure.
Micro-kernel
Under the micro-kernel structure, such as Mac OS, all unnecessary
components are removed from the kernel and implemented as system and
user programs. This creates a smaller kernel known as micro-kernel.
Here, all new services can be added to user space without any
modifications to the kernel. Therefore, it has more security and reliability.
Even if there is failure of one service, the rest of the operating system is
not affected.
Operating Systems
Modular Structure or Approach
The modular structure where a modular kernel is designed is considered
the most excellent approach for an OS. The kernel consists of core
components only. All other services are added to the kernel in the form of
dynamically loadable modules. This is done either during boot time or run
time. As every kernel contains protected and defined interfaces, it is
similar to the layered structure. However, it is more flexible than the
layered structure because a module is enabled to call any other module.
Client-Server Model
● The client-server model is another method of operating system design.
Here, the OS attempts to minimise the possibility of a bug in a
particular part of the operating system from corrupting all the other
parts.
● Here, multiple operating system services are implemented in the
pattern of privileged processes called servers. Note that each process
has protection against interference by other processes. These servers
are capable of accessing the computer's hardware, while ordinary
processes normally cannot.
● Ordinary processes are called clients. Requests are sent to the servers
in the form of messages. On their behalf, the servers execute the task
and return a reply.
● The set of services provided to the user processes by the servers forms
the operating system's API.
● The messages that are sent between the servers and the clients are
well-defined lumps of data, which must be copied between the server
and the client. This process of copying (along with the servers needing
to intercommunicate) which slows down the overall system is not
required in the monolithic system.
● This model should contain a layer in the OS that carries out message
passing. It is possible to implement this model on top of a single
machine. Here, the messages are copied into the server’s memory area
from the client’s memory.
Operating Systems
The client-server model can be customized to work over a distributed
system or network where the processes run on multiple machines.
● The client-server model is used in Windows 2K.
To determine how an OS perform its functions, an OS designer needs to
take into account policy and mechanism:
● Policy: A policy is the guiding principle under which the operating
system will perform the function.
● Mechanism: A mechanism is a specific action needed to
implement a policy.
While a policy decides the action to be done, a mechanism determines the
method of doing it and actually does it. A policy, when implemented as a
module that makes decisions, decides the conditions under which each of
the mechanism modules is to be called. A mechanism is implemented as a
module that performs a particular action.
1.5.2 Implementation
To leverage the huge financial investments made on operating systems,
the system designs should have a long lifespan. The OS designed should
have the ability to adapt to continuous changes in computer architecture,
especially with respect to portability and extensibility.
Porting is the ability to adapt software for use in a new computer system.
It indicates the ease with which a software program can be ported. Porting
of an operating system, which is inversely proportional to the porting
effort, involves altering parts of its code that are architecture dependent so
that the operating system can work with new hardware.
Extensibility refers to how easily a designer can add new functionalities to
a software system.
Earlier operating systems were mostly monolithic wherein each system-
related function was carried out by one block of code that was part of the
operating system.
Structure of OS
The operating system is intricate software containing a large number of
functionalities. It may also contain millions of instructions, as shown in
Operating Systems
Figure 1.12: Structure of a typical operating system
An OS is designed to have a set of software modules, with each module
having a well-defined interface that can be used to access any of its data
or functions. Under this design, a module cannot view the minute details
of other module’s functioning. As a result of this property, it is easy to
design, code and test an OS.
In old operating systems with a monolithic structure, the OS had a single
software layer between the computer system’s hardware and the user, with
a command interpreter providing the user interface. The creation of user
processes was organized by the command interpreter. Using system calls,
the user processes and the command interpreter invoked OS services and
functionalities.
However, there arose the problem of poor portability as architecture-
dependent code was spread across the OS. Testing and debugging were
also made difficult, thereby leading to high maintenance and enhancement
costs. To tackle these issues, three methods of structuring an OS were
implemented:
● Layered structure: By structuring the OS into multiple layers, the
layered structure (such as the multiprogramming system implemented
in the 1960s) reduces the complexity and costs that are a part of the
development and maintenance of OS.
Operating Systems
● Kernel-based structure: By confining the dependence on
architecture to a small section of the OS code that makes up the kernel,
the kernel-based structure (such as the Unix OS) increases the
portability.
● Microkernel-based structure: By providing a minimal set of
services and facilities to implement an OS, the microkernel provides
portability. As it allows making changes to the OS without needing to
make changes in the microkernel, it also provides extensibility.
1.6 THE PROCESS CONCEPT
A process is the unit of work in modern time-sharing systems. A system
has a collection of processes (user processes as well as system processes).
A process is basically a program in execution, wherein the process
execution of a process progressing in a sequential fashion. A process is
considered an active entity and a program is considered a passive entity.
Along with the program code, a process also includes the data section, text
section, program counter, stack, register contents and so on.
An entity that represents the basic unit of work that is to be implemented
in the system is described as a process. When computer programs are
executed, they become a process which then performs the entire list of
tasks specified in the program. Such processes are divided into four
sections:
● Stack
● Heap
● Data
● Text
Figure 1.13 shows a simplified layout of a process inside the main
memory.
Operating Systems
Figure 1.13: Process of a program
● Stack: This is utilised for local variables. The stack space is allocated
for local variables when they are declared. The stack is used whenever
there is a function call in the program. A layer is pushed into the stack
when a function is called. The arguments to the function and the local
variables used in the function are put into the layer of the stack. Once
the function call returns to the calling program, the layer of the stack is
popped.
● Heap: This is used when there is a need for dynamic memory allocation
and is managed through calls to delete, new, malloc, free and so on.
• Data: This section contains the values of initialized and uninitialized
global variables in the program. It consists of the static and global
variables that are allocated and initialized before the main is executed.
● Text: This section consists of the set of instructions to be executed for
the process. It contains the compiled program code that is read in from
non-volatile storage during program launch.
The text, data and stack sections comprise the address space of the process.
The program counter has the address of the next instruction to be executed
in the process.
Operating Systems
Different Process States
A condition of the process at a particular moment of time is a process state,
where the current position of the process is also defined. As shown in
Figure 1.14, there are seven stages in a process.
Figure 1.14: Process states diagram
New: When a particular program calls from the secondary memory or hard
disk to the RAM or primary memory, a new process is created.
Ready: In this stage, the process that is ready for execution should be
loaded into the primary memory.
Waiting: In this stage, the process is waiting for CPU time and other
resources to be allocated for it to start execution.
Executing: This stage means that the process is being executed.
Blocked: This stage consists of a time interval when a process is in wait
for a specific event such as I/O operations to finish.
Suspended: This stage defines the time when a process is ready for
execution but the OS has still not placed it in the ready queue.
Terminated: This stage gives the time when a process is terminated.
After completing all the steps, the resources are used by a process and
memory becomes free.
1.6.1 System Programmer’s View of a Processes
Programmer’s view of processes refers to the four principal events that
cause processes to be created:
Operating Systems
(i) System initialization.
(ii) Execution of process creation system call by a running process.
(iii)A user request to create new process.
(iv) Initiation of a batch job.
Typically, several processes are created on booting the operating system.
Technically, a new process created by having an existing process execute
this call is known as process creation system call.
1.6.2 Operating System’s View of a Processes
In the operating system’s view, a process is a unit of computational work.
Hence the kernel’s primary task is to control the process operations to
provide effective utilization of the computer system. Accordingly,
resources are allocated by the kernel to a process. Along with protecting
the process and its various resources from being interfered by other
processes, the kernel also makes sure that the process can use the CPU till
it concludes its operation.
An event is a situation that results in either a system call or hardware
interrupt and needs attention from the kernel. When such an event occurs,
the kernel is activated. The kernel carries out four fundamental functions
to control the operation of processes. They are:
1. Context save: This function saves the information about resources of
the process whose operation was interrupted and the CPU state as well.
2. Event handling: This function analyses those conditions that caused
an interrupt, or the request made by a process that caused a system call,
and takes appropriate actions.
3. Scheduling: This function selects the process that is to be executed
subsequently on the CPU.
4. Dispatching: This function facilitates access to scheduled process’s
resources and loads its saved CPU state in the CPU to either start or
continue its operation.
The kernel performs the context save function to save information about
the interrupted process. It is followed by execution of an appropriate event
Operating Systems
handling routine, which may inhibit further operation of the interrupted
process (if this process has made a system call to start an I/O operation) or
may enable operation of some other process (if the interrupt was caused
by completion of its I/O operation). The scheduling function is
subsequently performed by the kernel for selecting a process and the
dispatching function to start or continue its operation.
To perform scheduling, an operating system should know the processes
that require the CPU at any moment. Hence, the key to controlling
operation of processes is to monitor all processes and know what each
process is doing at any given moment of time whether:
● Executing on the CPU.
● Waiting for the CPU to be allocated to it.
● Waiting for an I/O operation to be completed.
● Waiting to be swapped into memory.
The process state is monitored by the operating system monitors to track
the actions of a process at any moment.
1.7 OPERATING-SYSTEM SERVICES FOR PROCESS
MANAGEMENT
An operating system provides an environment for programs to execute. It
also offers specific services to programs and to the users of those
programs, thus making programming easier. Though the specific services
provided are not the same for all operating systems, some common classes
can still be identified. One specific set of operating-system services offers
various functions that aid the user.
● User interface: Most of the OS have a User Interface (UI). This
interface can take three forms, with some systems offering two or all
three of these variants:
• Command-Line Interface (CLI): This makes use of text commands
and a method to enter them (for example, a program that ensures
entering and editing of commands).
Operating Systems
• Batch interface: This makes use of commands and the directives to
control such commands are entered into files. These files are then
executed.
• Graphical User Interface (GUI): This is the most commonly used
one in which case, the interface is a window system. Here, a pointing
device is used to direct I/O, select from menus or make selections.
Additionally, a keyboard is used to enter text.
● Program execution: The system loads a program into memory and
runs that program, which must have the ability to terminate its
execution. This can happen either normally or in case of an error,
abnormally.
● I/O operations. A program which is running might need I/O,
involving either an I/O device or a file. Specific functions (such as
blanking a CRT screen or recording to a CD or a DVD drive) might
be required for specific devices.
● To maintain protection and efficiency, there is no access to users to
directly control I/O devices. Therefore, such a means must be
provided by the operating system.
● File-system manipulation: Apart from reading and writing
directories and files, programs also need to perform other functions.
Some of these are creating or deleting the files and directories by
name, searching for a given file and listing file information. Some
specific programs also contain permissions management which
enables them to either give or refuse permission to access files or
directories, based on file ownership.
● Communications: At times, processes (either those executing on the
same or different computer systems that are bound by a computer
network) need to communicate with each other. Such communication
is implemented through shared memory or message passing. Here, the
OS shifts packets of information between processes.
● Error detection: The operating system needs to always be alert for
any possible errors which may occur:
Operating Systems
(i) In the memory hardware and the CPU (such as memory
error or a power failure)
(ii) In I/O devices (such as a parity error on tape, a failure in
network connections, or lack of paper in the printer)
(iii)In the user program (such as an arithmetic overflow, an
attack to gain control of an illegal memory location, or
overuse of CPU time)
Whatever the nature of error, the OS needs to take appropriate
action such as debugging, which allows both the programmer and
the user to use the system more efficiently. Another function of the
operating system is to ensure smooth functioning of the system
itself. For systems with multiple users, this can be achieved by
sharing computer resources among many users.
● Resource allocation: In case of multiple users or multiple jobs being
run simultaneously, resource allocation needs to be done for each of
them. The OS takes care of different types of resources of which some
(such as main memory, file storage and CPU cycles) might have special
allocation code while others (such I/O devices) might have more
general release and request code. For example, while deciding how best
to make use of the CPU, operating systems take into account routines
that schedule CPU, the number of jobs to be executed, the total number
of registers that are currently available and various other factors. In
addition, there might also be routines that are in charge of allocating
modems, printers, USB storage drives and different peripheral devices.
● Accounting: The amount and type of computer resources used by the
users’ needs to be tracked. This is done to either account for or simply
accumulate usage statistics, which might be of valuable use to
researchers in reconfiguring the system to enhance computing services.
● Protection and security: Information stored in various systems is of
valuable use to such information owners. In order to protect such
information, access to system resources need to be controlled. When
multiple separate processes are being executed simultaneously, one
process should not interfere with others or even within the operating
system itself. Securing the system from external threats is also vital.
Operating Systems
The first step in enforcing this is when users are required to authenticate
themselves using a password, before they can gain access to system
resources. Furthermore, there is a need to protect external I/O devices
such as network adapters and modems from invalid access attempts.
Such malicious connections also need to be recorded in order to detect
break-ins. It is vital that precautions are present throughout the system
to make it secure and more protected.
1.8 LET US SUM UP
• An operating system is system software that manages computer
resources.
• The operating system provides complex networking functionality
and is also suited to work with a range of communication devices
and various other peripheral devices.
• There are different kinds of operating systems based on the
hardware, application requirements and functionality of the
operating system.
• Each operating system is different from another designed with the
aim of meeting a particular set of goals.
• An operating system is a construct that allows the user application
programs to interact with the system hardware.
• The services provided by an operating system are dependent on the
reason why the operating system was created.
• In the micro-kernel OS design, all non-essential components are
removed from the kernel and implemented as user and system
programs.
• In an operating system, a policy decides what should be done, while
a mechanism determines how something should be done and actually
does it.
• A process is basically a program in execution.
• An operating system gives an environment for program execution.
Operating Systems
1.9 KEY WORDS
• File System: A method used by operating systems to organize and
store data on storage devices such as hard drives, SSDs, and flash
drives.
• Device Drivers: Software components that facilitate communication
between the operating system and hardware devices, enabling the OS
to control and interact with peripheral devices.
• User Interface: The means by which users interact with an operating
system, including graphical user interfaces (GUIs), command-line
interfaces (CLIs), and touch interfaces.
• System Calls: Interfaces provided by the operating system that allow
user-level programs to request services from the kernel, such as file
operations, process management, and I/O.
• Multi-tasking: The ability of an operating system to execute multiple
tasks or processes concurrently, allowing users to run several
programs simultaneously.
1.10 SOME USEFUL BOOKS
Reference Books
● Silberschatz, Abraham and Galvin, Peter B., and Gagne, Greg,
2018. Operating System Concepts (10th edition). Hoboken, NJ.
John Wiley & Sons, Inc.
● Stallings, William.2017. Operating systems: Internals and design
principles (Ninth edition). New Jersey. Pearson Education, Inc.
● Dhamdhere, Dhananjay M. 2009. Operating Systems: A Concept-
Based Approach (First Edition). New York. McGraw-Hill.
● Christopher J. Wells (31-01-2019). Operating Systems. Retrieved
from http://www.technologyuk.net
Operating Systems
Textbook References
● Silberschatz, Abraham and Galvin, Peter B., and Gagne, Greg,
2018. Operating System Concepts (10th edition). Hoboken, NJ.
John Wiley & Sons, Inc.
● Stallings, William.2017. Operating systems: Internals and design
principles (Ninth edition). New Jersey. Pearson Education, Inc.
● Dhamdhere, Dhananjay M. 2009. Operating Systems: A Concept-
Based Approach (First Edition). New York. McGraw-Hill.
Website
● https://www.technologyuk.net
● https://harrykar.blogspot.com/2009/09/linux-kernel.html
● https://www.tutorialandexample.com/operating-system-tutorial/
● https://www.geeksforgeeks.org/
● https://www.tutorialspoint.com/User-View-vs-System-View-in-
Operating-System
1.11 ANSWER TO CHECK YOUR PROGRESS
1. Answer to check your progress- 1 Q. 1 …
The first generation of computers, from the late 1940s to the mid-1950s,
used vacuum tubes for circuitry and were huge, expensive, and consumed
a lot of electricity.
2. Answer to check your progress- 1 Q. 2 …
The introduction of high-level programming languages like COBOL and
FORTRAN was a significant development in the second generation.
3. Answer to check your progress- 1 Q. 3 …
Third-generation computers saw advancements in software, including the
development of operating systems and the widespread use of time-sharing
and multiprogramming.
Operating Systems
4. Answer to check your progress- 2 Q. 1 …
CLUV provides users with a powerful and efficient way to interact with
the operating system, allowing them to perform tasks quickly and
automate repetitive tasks through scripting.
5. Answer to check your progress- 2 Q. 2 ….
User-level programs invoke system calls by making a request to the
operating system using a specific syntax or function call provided by the
programming language or the operating system's library.
1.12 TERMINAL QUESTIONS
1. What are the main types of operating systems, and how do they
differ in terms of functionality and application?
2. Explain the concept of processes in operating systems and discuss
their importance for system management.
3. What are the key views of operating systems, and why is it
important to understand them in system design?
4. Discuss the evolution of operating systems and highlight major
milestones in their development.
5. What principles guide the design and implementation of operating
systems, and how do they impact system performance and
reliability?