Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Department of AI-ML

OPERATING SYSTEM (SOC-302)

UNIT-1

LEC-1

This chapter gives a basic idea about Operating System starting with definition of operating
system, and its functions.

An operating System (OS) is an intermediary between users and computer hardware. It


provides users an environment in which a user can execute programs conveniently and
efficiently.

In technical terms, it is software which manages hardware. An operating System controls the
allocation of resources and services such as memory, processors, devices and information.

Definition

An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.

History of the
Operating
System
Operating System
The operating system is a
system program that serves as
an interface between the
computing system and the end-user. Operating systems create an environment where the
user can run any programs or communicate with software or applications in a comfortable
and well-organized way.
Furthermore, an operating is a software program that manages and controls the execution
of application programs, software resources and computer hardware. It also helps manage
the software/hardware resource, such as file management, memory management, input/
output and many peripheral devices like a disk drive, printers, etc. These are the popular
operating system: Linux OS, Windows OS, Mac OS, VMS, and OS/400 etc.

LEC -02

Functions of Operating System

o Processor management
o Act as a Resource Manager
o Memory Management
o File Management
o Security
o Device Management
o Input devices / Output devices
o Deadlock Prevention
o Time Management
o Coordinate with system software or hardware

Following are some of important functions of an operating System.


 Memory Management

 Processor Management

 Device Management

 File Management

 Security

 Control over system performance

 Job accounting

 Error detecting aids

 Coordination between other software and users


Memory Management:

Memory management refers to management of Primary Memory or Main Memory. Main

Memory is a large array of words or bytes where each word or byte has its own address.

Main memory provides a fast storage that can be access directly by the CPU. So for a
program to be executed, it must in the main memory. Operating System does the following
activities for memory management.

Keeps tracks of primary memory i.e. what part of it are in use by whom, what part are
not in use.

In multiprogramming, OS decides which process will get memory when and how much.

Allocates the memory when the process requests it to do so.

De-allocates the memory when the process no longer needs it or has been terminated.

Processor Management:

In multiprogramming environment, OS decides which process gets the processor when and
how much time. This function is called process scheduling. Operating System does the
following activities for processor management.

Keeps tracks of processor and status of process. Program responsible for this task is known as traffic
controller.Allocates the processor (CPU) to a process. De-allocates processor when
processor is no longer required.

Device Management
OS manages device communication via their respective drivers. Operating System does the following activities for device
management.

Keeps tracks of all devices. Program responsible for this task is known as the I/O controller.

Decides which process gets the device when and for how much time.

Allocates the device in the efficient way.

File Management
A file system is normally organized into directories for easy navigation and usage. These directories may contain files and
other directions. Operating System does the following activities for file management.Keeps track of information, location, uses,
status etc. The collective facilities are often known as file system.Decides who gets the resources.Allocates the resources.De-
allocates the resources.

Other Important Activities


Following are some of the important activities that Operating System does.

Security -- By means of password and similar other techniques, preventing unauthorized access to programs and data.

Control over system performance -- Recording delays between request for a service and response from the system.

Job accounting -- Keeping track of time and resources used by various jobs and users.

Error detecting aids -- Production of dumps, traces, error messages and other debugging and error detecting aids.

Coordination between other software and users -- Coordination and assignment of compilers, interpreters, assemblers and other

Software to the various users of the computer systems.


LEC-03

Types of Operating System:


Time-sharing operating systems
Time sharing is a technique which enables many people, located at various terminals, to use a
particular computer system at the same time. Time-sharing or multitasking is a logical
extension of multiprogramming. Processor's time which is shared among multiple users
simultaneously is termed as time-sharing. The main difference between Multiprogrammed
Batch Systems and Time-Sharing Systems is that in case of multiprogrammed batch systems,
objective is to maximize processor use, whereas in Time-Sharing Systems objective is to
minimize response time.

Multiple jobs are executed by the CPU by switching between them, but the switches occur so
frequently. Thus, the user can receive an immediate response. For example, in a transaction
processing, processor execute each user program in a short burst or quantum of computation.
That is if n users are present, each user can get time quantum. When the user submits the
command, the response time is in few seconds at most.

Operating system uses CPU scheduling and multiprogramming to provide each user with a
small portion of a time. Compute systems that were designed primarily as batch systems have
been modified to time-sharing systems.

Advantages of Timesharing operating systems are following

Provide advantage of quick response.

 Avoids duplication of software.

 Reduces CPU idle time.

Disadvantages of Timesharing operating systems are following.

 Problem of reliability.

 Question of security and integrity of user programs and data.

 Problem of data communication.


Distributed operating System

Distributed systems use multiple central processors to serve multiple real time application and
multiple users. Data processing jobs are distributed among the processors accordingly to
which one can perform each job most efficiently.

The processors communicate with one another through various communication lines
(such as high-speed buses or telephone lines). These are referred as loosely coupled systems
or distributed systems. Processors in a distributed system may vary in size and function. These
processors are referred as sites, nodes, and computers and so on.

The advantages of distributed systems are following.

With resource sharing facility user at one site may be able to use the resources
available at another.

Speedup the exchange of data with one another via electronic mail.

If one site fails in a distributed system, the remaining sites can potentially continue
operating.

Better service to the customers.

Reduction of the load on the host computer.

Reduction of delays in data processing.


Network operating System

Network Operating System runs on a server and and provides server


the capability to manage data, users, groups, security, applications, and
other networking functions. The primary purpose of the network operating
system is to allow shared file and printer access among multiple computers
in a network, typically a local area network (LAN), a private network or to
other networks. Examples of network operating systems are Microsoft
Windows Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac
OS X, Novell NetWare, and BSD.

The advantages of network operating systems are following.

 Centralized servers are highly stable.

 Security is server managed.

 Upgrades to new technologies and hardware can be easily


integrated into the system.

 Remote access to servers is possible from different


locations and types of systems.

The disadvantages of network operating systems are following.

 High cost of buying and running a server.

 Dependency on a central location for most operations.

 Regular maintenance and updates are required.


Real Time operating System

Real time system is defines as a data processing system in which the time interval
required to process and respond to inputs is so small that it controls the
environment. Real time processing is always on line whereas on line system need
not be real time. The time taken by the system to respond to an input and display of
required updated information is termed as response time. So in this method
response time is very less as compared to the online processing.

Real-time systems are used when there are rigid time requirements on the operation
of a processor or the flow of data and real-time systems can be used as a control
device in a dedicated application. Real-time operating system has well-defined,
fixed time constraints otherwise system will fail. For example Scientific experiments,
medical imaging systems, industrial control systems, weapon systems, robots, and
home-appliance controllers, Air traffic control system etc.

There are two types of real-time operating systems.

Hard real-time systems

Hard real-time systems guarantee that critical tasks complete on time. In hard real-
time systems secondary storage is limited or missing with data stored in ROM. In
these systems virtual memory is almost never found.

Soft real-time systems


Soft real time systems are less restrictive. Critical real-time task gets priority over
other tasks and retains the priority until it completes. Soft real-time systems have
limited utility than hard real- time systems. For example, Multimedia, virtual reality,
Advanced Scientific Projects like undersea exploration and planetary rovers etc.
LEC-04

Embedded Operating System


The Embedded operating system is the specific purpose operating system used
in the computer system's embedded hardware configuration. These operating
systems are designed to work on dedicated devices like automated teller
machines (ATMs), airplane systems, digital home assistants, and the internet of
things (IoT) devices.

Multiprogramming Operating System

Due to the CPU's underutilization and the waiting for I/O resource till that CPU
remains idle. It shows the improper use of system resources. Hence, the
operating system introduces a new concept that is known as multiprogramming.
A multiprogramming operating system refers to the concepts wherein two or
more processes or programs activate simultaneously to execute the processes
one after another by the same computer system. When a program is in run mode
and uses CPU, another program or file uses I/O resources at the same time or
waiting for another system resources to become available. It improves the use of
system resources, thereby increasing system throughput. Such a system is
known as a multiprogramming operating system.

Network Operating System


A network operating system is an important category of the operating system that
operates on a server using network devices like a switch, router, or firewall to
handle data, applications and other network resources. It provides connectivity
among the autonomous operating system, called as a network operating system.
The network operating system is also useful to share data, files, hardware
devices and printer resources among multiple computers to communicate with
each other.
Types of network operating system

o Peer-to-peer network operating system: The type of network operating


system allows users to share files, resources between two or more
computer machines using a LAN.
Client-Server network operating system: It is the type of network operating
system that allows the users to access resources, functions, and applications
through a common server or center hub of the resources. The client workstation
can access all resources that exist in the central hub of the network. Multiple
clients can access and share different types of the resource over the network
from different locations.
Distributed Operating system
A distributed operating system provides an environment in which multiple
independent CPU or processor communicates with each other through physically
separate computational nodes. Each node contains specific software that
communicates with the global aggregate operating system. With the ease of a
distributed system, the programmer or developer can easily access any
operating system and resource to execute the computational tasks and achieve a
common goal. It is the extension of a network operating system that facilitates a
high degree of connectivity to communicate with other users over the network.

LEC-05
Multiprocessing Operating System
It is the type of operating system that refers to using two or more central
processing units (CPU) in a single computer system. However, these
multiprocessor systems or parallel operating systems are used to increase the
computer system's efficiency. With the use of a multiprocessor system, they
share computer bus, clock, memory and input or output device for concurrent
execution of process or program and resource management in the CPU.

Real-Time Operating System


A real-time operating system is an important type of operating system used to
provide services and data processing resources for applications in which the time
interval required to process & respond to input/output should be so small without
any delay real-time system. For example, real-life situations governing an
automatic car, traffic signal, nuclear reactor or an aircraft require an immediate
response to complete tasks within a specified time delay. Hence, a real-time
operating system must be fast and responsive for an embedded system, weapon
system, robots, scientific research & experiments and various real-time objects.
Types of the real-time operating system:

o Hard Real-Time System


These types of OS are used with those required to complete critical tasks
within the defined time limit. If the response time is high, it is not accepted
by the system or may face serious issues like a system failure. In a hard
real-time system, the secondary storage is either limited or missing, so
these system stored data in the ROM.
o Soft Real-Time System
A soft real-time system is a less restrictive system that can accept software
and hardware resources delays by the operating system. In a soft real-time
system, a critical task prioritizes less important tasks, and that priority
retains active until completion of the task. Also, a time limit is set for a
specific job, which enables short time delays for further tasks that are
acceptable. For example, computer audio or video, virtual reality,
reservation system, projects like undersea, etc.

LEC-06
Components of Operating System
An operating system is a large and complex system that can only be
created by partitioning into small parts. These pieces should be a well-
defined part of the system, carefully defining inputs, outputs, and functions.

Although Windows, Mac, UNIX, Linux, and other OS do not have the same
structure, most operating systems share similar OS system components,
such as file, memory, process, I/O device management.
The components of an operating system play a key role to make a variety of computer system parts work
together. There are the following components of an operating system, such as:

1. Process Management
2. File Management
3. Network Management
4. Main Memory Management
5. Secondary Storage Management
6. I/O Device Management
7. Security Management
8. Command Interpreter System

Operating system components help you get the correct computing by detecting CPU and memory hardware
errors.

Components of Operating System


An operating system is a large and complex system that can only be created by
partitioning into small parts. These pieces should be a well-defined part of the
system, carefully defining inputs, outputs, and functions.

Although Windows, Mac, UNIX, Linux, and other OS do not have the same
structure, most operating systems share similar OS system components, such as
file, memory, process, I/O device management.

The components of an operating system play a key role to make a variety of


computer system parts work together. There are the following components of an
operating system, such as:

1. Process Management
2. File Management
3. Network Management
4. Main Memory Management
5. Secondary Storage Management
6. I/O Device Management
7. Security Management
8. Command Interpreter System

Operating system components help you get the correct computing by detecting
CPU and memory hardware errors.

Process Management
The process management component is a procedure for managing many
processes running simultaneously on the operating system. Every running
software application program has one or more processes associated with them.

For example, when you use a search engine like Chrome, there is a process
running for that browser program.

Process management keeps processes running efficiently. It also uses memory


allocated to them and shutting them down when needed.

The execution of a process must be sequential so, at least one instruction should
be executed on behalf of the process.
Functions of process management
LEC-07
Operating System Structure
Overview
An operating system is a design that enables user application programs to
communicate with the hardware of the machine. The operating system should be
built with the utmost care because it is such a complicated structure and should
be simple to use and modify. Partially developing the operating system is a
simple approach to accomplish this. Each of these components needs to have
distinct inputs, outputs, and functionalities.

This article discusses many sorts of structures that implement operating systems,
as listed below, as well as how and why they work. It also defines the operating
system structure.

o Simple Structure
o Monolithic Structure
o Layered Approach Structure
o Micro-Kernel Structure
o Exo-Kernel Structure
o Virtual Machines

What is an operating System Structure?


We want a clear structure to let us apply an operating system to our particular
needs because operating systems have complex structures. It is easier to
create an operating system in pieces, much as we break down larger issues
into smaller, more manageable sub problems. Every segment is also a part of
the operating system. Operating system structure can be thought of as the
strategy for connecting and incorporating various operating system
components within the kernel. Operating systems are implemented using
many types of structures, as will be discussed below:
SIMPLE STRUCTURE
It is the most straightforward operating system structure, but it lacks definition
and is only appropriate for usage with tiny and restricted systems. Since the
interfaces and degrees of functionality in this structure are clearly defined,
programs are able to access I/O routines, which may result in unauthorized
access to I/O procedures.

This organizational structure is used by the MS-DOS operating system:

o There are four layers that make up the MS-DOS operating system, and
each has its own set of features.
o These layers include ROM BIOS device drivers, MS-DOS device drivers,
application programs, and system programs.
o The MS-DOS operating system benefits from layering because each level
can be defined independently and, when necessary, can interact with one
another.
o If the system is built in layers, it will be simpler to design, manage, and
update. Because of this, simple structures can be used to build
constrained systems that are less complex.
o When a user program fails, the operating system as whole crashes.
o Because MS-DOS systems have a low level of abstraction, programs and
I/O procedures are visible to end users, giving them the potential for
unwanted access.

The following figure illustrates layering in simple structure:


Advantages of Simple Structure:

o Because there are only a few interfaces and levels, it is simple to develop.
o Because there are fewer layers between the hardware and the
applications, it offers superior performance.

Disadvantages of Simple Structure:

o The entire operating system breaks if just one user program malfunctions.
o Since the layers are interconnected, and in communication with one
another, there is no abstraction or data hiding.
o The operating system's operations are accessible to layers, which can
result in data tampering and system failure.

MONOLITHIC STRUCTURE
The monolithic operating system controls all aspects of the operating system's
operation, including file management, memory management, device
management, and operational operations.

The core of an operating system for computers is called the kernel (OS). All other
System components are provided with fundamental services by the kernel. The
operating system and the hardware use it as their main interface. When an
operating system is built into a single piece of hardware, such as a keyboard or
mouse, the kernel can directly access all of its resources.

The monolithic operating system is often referred to as the monolithic kernel.


Multiple programming techniques such as batch processing and time-sharing
increase a processor's usability. Working on top of the operating system and
under complete command of all hardware, the monolithic kernel performs the role
of a virtual computer. This is an old operating system that was used in banks to
carry out simple tasks like batch processing and time-sharing, which allows
numerous users at different terminals to access the Operating System.

The following diagram represents the monolithic structure:


Advantages of Monolithic Structure:

o Because layering is unnecessary and the kernel alone is responsible for


managing all operations, it is easy to design and execute.
o Due to the fact that functions like memory management, file management,
process scheduling, etc., are implemented in the same address area, the
monolithic kernel runs rather quickly when compared to other systems.
Utilizing the same address speeds up and reduces the time required for
address allocation for new processes.
Disadvantages of Monolithic Structure:

o The monolithic kernel's services are interconnected in address space and


have an impact on one another, so if any of them malfunctions, the entire
system does as well.
o It is not adaptable. Therefore, launching a new service is difficult.

LAYERED STRUCTURE
The OS is separated into layers or levels in this kind of arrangement. Layer 0 (the
lowest layer) contains the hardware, and layer 1 (the highest layer) contains the
user interface (layer N). These layers are organized hierarchically, with the top-
level layers making use of the capabilities of the lower-level ones.

The functionalities of each layer are separated in this method, and abstraction is
also an option. Because layered structures are hierarchical, debugging is
simpler; therefore all lower-level layers are debugged before the upper layer is
examined. As a result, the present layer alone has to be reviewed since all the
lower layers have already been examined.

The image below shows how OS is organized into layers:


Advantages of Layered Structure:

o Work duties are separated since each layer has its own functionality, and
there is some amount of abstraction.
o Debugging is simpler because the lower layers are examined first, followed
by the top layers.

Disadvantages of Layered Structure:

o Performance is compromised in layered structures due to layering.


o Construction of the layers requires careful design because upper layers
only make use of lower layers' capabilities.

MICRO-KERNEL STRUCTURE
The operating system is created using a micro-kernel framework that strips the
kernel of any unnecessary parts. Systems and user applications are used to
implement these optional kernel components. So, Micro-Kernels is the name
given to these systems that have been developed.

Each Micro-Kernel is created separately and is kept apart from the others. As a
result, the system is now more trustworthy and secure. If one Micro-Kernel
malfunctions, the remaining operating system is unaffected and continues to
function normally.

The image below shows Micro-Kernel Operating System Structure:

Advantages of Micro-Kernel Structure:

o It enables portability of the operating system across platforms.


o Due to the isolation of each Micro-Kernel, it is reliable and secure.
o The reduced size of Micro-Kernels allows for successful testing.
o The remaining operating system remains unaffected and keeps running
properly even if a component or Micro-Kernel fails.
Disadvantages of Micro-Kernel Structure:

o The performance of the system is decreased by increased inter-module


communication.
o The construction of a system is complicated.

EXOKERNEL
An operating system called Exokernel was created at MIT with the goal of
offering application-level management of hardware resources. The exokernel
architecture's goal is to enable application-specific customization by separating
resource management from protection. Exokernel size tends to be minimal due
to its limited operability.

Because the OS sits between the programs and the actual hardware, it will
always have an effect on the functionality, performance, and breadth of the apps
that are developed on it. By rejecting the idea that an operating system must
offer abstractions upon which to base applications, the exokernel operating
system makes an effort to solve this issue. The goal is to give developers as few
restriction on the use of abstractions as possible while yet allowing them the
freedom to do so when necessary. Because of the way the exokernel
architecture is designed, a single tiny kernel is responsible for moving all
hardware abstractions into unreliable libraries known as library operating
systems. Exokernels differ from micro- and monolithic kernels in that their
primary objective is to prevent forced abstraction.

Exokernel operating systems have a number of features, including:

o Enhanced application control support.


o Splits management and security apart.
o A secure transfer of abstractions is made to an unreliable library operating
system.
o Brings up a low-level interface.
o Operating systems for libraries provide compatibility and portability.

Advantages of Exokernel Structure:


o Application performance is enhanced by it.
o Accurate resource allocation and revocation enable more effective
utilisation of hardware resources.
o New operating systems can be tested and developed more easily.
o Every user-space program is permitted to utilize its own customized
memory management.

Disadvantages of Exokernel Structure:

o A decline in consistency
o Exokernel interfaces have a complex architecture.

LEC-08
VIRTUAL MACHINES (VMs)
The hardware of our personal computer, including the CPU, disc drives, RAM,
and NIC (Network Interface Card), is abstracted by a virtual machine into a
variety of various execution contexts based on our needs, giving us the
impression that each execution environment is a separate computer. A virtual
box is an example of it.

Using CPU scheduling and virtual memory techniques, an operating system


allows us to execute multiple processes simultaneously while giving the
impression that each one is using a separate processor and virtual memory.
System calls and a file system are examples of extra functionalities that a
process can have that the hardware is unable to give. Instead of offering these
extra features, the virtual machine method just offers an interface that is similar
to that of the most fundamental hardware. A virtual duplicate of the computer
system underneath is made available to each process.

We can develop a virtual machine for a variety of reasons, all of which are
fundamentally connected to the capacity to share the same underlying hardware
while concurrently supporting various execution environments, i.e., various
operating systems.

Disk systems are the fundamental problem with the virtual machine technique. If
the actual machine only has three-disc drives but needs to host seven virtual
machines, let's imagine that. It is obvious that it is impossible to assign a disc
drive to every virtual machine because the program that creates virtual machines
would require a sizable amount of disc space in order to offer virtual memory and
spooling. The provision of virtual discs is the solution.

The result is that users get their own virtual machines. They can then use any of
the operating systems or software programs that are installed on the machine
below. Virtual machine software is concerned with programming numerous virtual
machines simultaneously into a physical machine; it is not required to take into
account any user-support software. With this configuration, it may be possible to
break the challenge of building an interactive system for several users into two
manageable chunks.

Advantages of Virtual Machines:

o Due to total isolation between each virtual machine and every other virtual
machine, there are no issues with security.
o A virtual machine may offer an architecture for the instruction set that is
different from that of actual computers.
o Simple availability, accessibility, and recovery convenience.
Disadvantages of Virtual Machines:

o Depending on the workload, operating numerous virtual machines


simultaneously on a host computer may have an adverse effect on one of
them.
o When it comes to hardware access, virtual computers are less effective
than physical ones.

CONCLUSION
o The operating system makes it possible for the user to communicate with
the hardware of the computer. The operating system is used as the
foundation for installing and using system software.
o The interconnections between the various operating system components
can be defined as the operating system structure.
o The operating system is divided into various different structural types:
simple structure, monolithic approach, layered approach, micro-kernels,
exo kernels, and virtual machines.
o Each time one of these methods or structures changed, the OS became
progressively better.

NPTEL COURSE:
https://archive.nptel.ac.in/courses/106/105/106105214/

https://www.cse.iitb.ac.in/~mythili/os/

You might also like