Unit I
Unit I
21BTCS501-OPERATING SYSTEM
Class - T.Y.
PLD(SEM-V)
Unit - I
INTRODUCTION
AY 2024-2025 SEM-I
1
MIT School of Computing
Department of Computer Science & Engineering
Unit-I INTRODUCTION
2
MIT School of Computing
Department of Computer Science & Engineering
3
MIT School of Computing
Department of Computer Science & Engineering
Unit-III
PROCESS SYNCHRONIZATION
AND DEADLOCKS
• Background, The Critical-Section Problem, Peterson's
Solution, Synchronization
PLD Hardware, Semaphores,
Classic Problems of Synchronization, Monitors,
Synchronization Example, Atomic Transactions,
Deadlocks, System Model, Deadlock Characterization,
Methods for Handling Deadlocks, Deadlock Prevention,
Deadlock Avoidance, Deadlock Detection, Recovery from
Deadlock
4
MIT School of Computing
Department of Computer Science & Engineering
5
MIT School of Computing
Department of Computer Science & Engineering
OS Introduction
• Dr. Pankaj PLD
Chandre
7
MIT School of Computing
Department of Computer Science & Engineering
UNIT 1- Introduction to OS
●
What Operating Systems, Computer-System Organization, Computer-System
Architecture, Operating-System Structure, Operating-System Operations, Process
Management, Memory Management, Storage Management, Protection and Security,
Operating-System Service, User Operating-System Interface, System Calls, Types of
PLD
System Calls, System Programs, Operating-System Design and Implementation,
Operating-System Structure, Virtual Machines
8
MIT School of Computing
Department of Computer Science & Engineering
Text Books:
1. Systems Programming and Operating Systems, Dhamdhere D.M, TMGH
2. Modern Operating System – Andrew S. Tanenbaum, Pearson Education
India
3. Operating System Concepts - Abraham Silberschatz, Peter B. Galvin &
Grege Gagne, Wiley
References:
4. Operating System : Concepts andPLDDesign - Milan Milenkovic, TMGH
5. Understanding the Linux kernel - Daniel P Bovet and Marco Cesati, O’Reilly
6. Linux System Programming - Robert Love, Publisher - SPD, O’ Reilly
7. Systems programming - John J. Donovan, TMGH
9
MIT School of Computing
Department of Computer Science & Engineering
What is System?
-System is the collection of various components
-Ex: College is a system, because it consist of various
components like various departments, classroom, faculties
and students.
What is Programming?
PLD
-Art of designing and implementing the programs
In a college system, what is program?
A LECTURE can be a program, because it has input and
output.
Input: The information that teacher is delivering.
Output: The knowledge student has been received.
10
MIT School of Computing
Department of Computer Science & Engineering
Introduction to OS
11
MIT School of Computing
Department of Computer Science & Engineering
PLD
12
MIT School of Computing
Department of Computer Science & Engineering
WHAT IS SOFTWARE
• It is collection of many programs
• Two types of software
PLD
-System Software: These program assist general user
application program.
-Ex: Operating System, Assembler.
-Application Software: These are the software
developed for the specific tasks.
-Ex: Adobe Reader, Media Player.
13
Components of System Software
• Text Editors
• Loaders
• Assembler
• Macro Processor
• Compiler
• Debugger
21
MIT School of Computing
Department of Computer Science & Engineering
PLD
23
MIT School of Computing
Department of Computer Science & Engineering
Services
• Resource Management: The operating system
manages and allocates memory, CPU time, and other
hardware resources among the various programs and
processes running on the computer.
• Process Management: The operating system is
responsible for starting, PLD stopping, and managing
processes and programs. It also controls the scheduling of
processes and allocates resources to them.
• Memory Management: The operating system manages
the computer’s primary memory and provides
mechanisms for optimizing memory usage.
• Security: The operating system provides a secure
environment for the user, applications, and data by
implementing security policies and mechanisms such as
access controls and encryption.
• Job Accounting: It keeps track of time and resources 24
MIT School of Computing
Department of Computer Science & Engineering
Services
• File Management: The operating system is responsible for organizing
and managing the file system, including the creation, deletion, and
manipulation of files and directories.
• Device Management: The operating system manages input/output
devices such as printers, keyboards, mice, and displays. It provides the
necessary drivers and interfaces to enable communication between the
devices and the computer.
• Networking: The operating system PLD provides networking capabilities such
as establishing and managing network connections, handling network
protocols, and sharing resources such as printers and files over a network.
• User Interface: The operating system provides a user interface that
enables users to interact with the computer system. This can be a
Graphical User Interface (GUI), a Command-Line Interface (CLI), or a
combination of both.
• Backup and Recovery: The operating system provides mechanisms for
backing up data and recovering it in case of system failures, errors, or
disasters.
• Virtualization: The operating system provides virtualization capabilities
that allow multiple operating systems or applications to run on a single
physical machine. This can enable efficient use of resources and flexibility
25
in managing workloads.
MIT School of Computing
Department of Computer Science & Engineering
Goals of OS
• Convenience (user friendly)
• Efficiency
PLD
• Portability
• Reliability
• Scalability
• Robustness
26
MIT School of Computing
Department of Computer Science & Engineering
28
29
Batch Operating System
32
Multiprogramming Operating System
• Multiprogramming is an extension to
batch processing where the CPU is
always kept busy. Each process needs
two types of system time: CPU time and
IO time.
• In a multiprogramming environment,
when a process does its I/O, The CPU
can start the execution of other
processes. Therefore,
multiprogramming improves the
efficiency of the system.
33
34
• Advantages of Multiprogramming OS
• Throughout the system, it increased as
the CPU always had one program to
execute.
• Response time can also be reduced.
• Disadvantages of Multiprogramming OS
• Multiprogramming systems provide an
environment in which various systems
resources are used efficiently, but they
do not provide any user interaction with
the computer system. 35
Multiprocessing Operating System
36
37
• Advantages of Multiprocessing operating
system:
• Increased reliability: Due to the
multiprocessing system, processing tasks can
be distributed among several processors. This
increases reliability as if one processor fails,
the task can be given to another processor for
completion.
• Increased throughout: As several processors
increase, more work can be done in less.
• Disadvantages of Multiprocessing
operating System
• Multiprocessing operating system is more
complex and sophisticated as it takes care of
multiple CPUs simultaneously.
38
Multitasking Operating
System
• The multitasking operating system is a
logical extension of a multiprogramming
system that enables multiple programs
simultaneously. It allows a user to
perform more than one computer task
at the same time
39
40
• Advantages of Multitasking operating
system
• This operating system is more suited to
supporting multiple users
simultaneously.
• The multitasking operating systems
have well-defined memory
management.
• Disadvantages of Multitasking operating
system
• The multiple processors are busier at
the same time to complete any task in a
multitasking environment, so the CPU
generates more heat.
41
Network Operating System
42
43
• Advantages of Network Operating System
• In this type of operating system, network
traffic reduces due to the division between
clients and the server.
• This type of system is less expensive to set up
and maintain.
• Disadvantages of Network Operating System
• In this type of operating system, the failure of
any node in a system affects the whole
system.
• Security and performance are important
issues. So trained network administrators are
required for network administration.
44
Real Time Operating
System
• In Real-Time Systems, each job carries a
certain deadline within which the job is
supposed to be completed, otherwise,
the huge loss will be there, or even if
the result is produced, it will be
completely useless.
• The Application of a Real-Time system
exists in the case of military
applications, if you want to drop a
missile, then the missile is supposed to
be dropped with a certain precision.
45
46
• Advantages of Real-time operating system:
• Easy to layout, develop and execute real-time
applications under the real-time operating
system.
• In a Real-time operating system, the
maximum utilization of devices and systems.
• Disadvantages of Real-time operating system:
• Real-time operating systems are very costly
to develop.
• Real-time operating systems are very
complex and can consume critical CPU cycles.
47
Time-Sharing Operating
System
• In the Time Sharing operating system, computer
resources are allocated in a time-dependent fashion
to several programs simultaneously. Thus it helps to
provide a large number of user's direct access to the
main computer. It is a logical extension of
multiprogramming. In time-sharing, the CPU is
switched among multiple programs given by
different users on a scheduled basis.
• A time-sharing operating system allows many users
to be served simultaneously, so sophisticated CPU
scheduling schemes and Input/output management
are required.
• Time-sharing operating systems are very difficult
and expensive to build.
48
49
• Advantages of Time Sharing Operating System
• The time-sharing operating system provides
effective utilization and sharing of resources.
• This system reduces CPU idle and response time.
• Disadvantages of Time Sharing Operating System
• Data transmission rates are very high in
comparison to other methods.
• Security and integrity of user programs loaded in
memory and data need to be maintained as many
users access the system at the same time.
50
Distributed Operating
System
• The Distributed Operating system is not
installed on a single machine, it is
divided into parts, and these parts are
loaded on different machines. A part of
the distributed Operating system is
installed on each machine to make their
communication possible. Distributed
Operating systems are much more
complex, large, and sophisticated than
Network operating systems because
they also have to take care of varying
networking protocols.
51
52
• Advantages of Distributed Operating
System
• The distributed operating system
provides sharing of resources.
• This type of system is fault-tolerant.
• Disadvantages of Distributed Operating
System
• Protocol overhead can dominate
computation cost
53
MIT School of Computing
Department of Computer Science & Engineering
Operating-System Structure
1. SIMPLE STRUCTURE
2. MONOLITHIC STRUCTURE
PLD
3. LAYERED STRUCTURE
4. MICROKERNEL STRUCTURE
54
MIT School of Computing
Department of Computer Science & Engineering
Simple structure
Such operating systems do not have well-
defined structures and are small, simple, and
limited.
The interfaces and levels of functionality are
PLD
not well separated. MS-DOS is an example of
such an operating system.
In MS-DOS, application programs are able to
access the basic I/O routines.
These types of operating systems cause the
entire system to crash if one of the user
programs fails.
56
57
MIT School of Computing
Department of Computer Science & Engineering
Layered structure
An OS can be broken into pieces and retain much more control over
the system. In this structure, the OS is broken into a number of layers
(levels).
The bottom layer (layer 0) is the hardware, and the topmost layer
(layer N) is the user interface.
These layers are so designed that each layer uses the functions of the
PLD
lower-level layers.
This simplifies the debugging process, if lower-level layers are
debugged and an error occurs during debugging, then the error must
be on that layer only, as the lower-level layers have already been
debugged.
The main disadvantage of this structure is that at each layer, the data
needs to be modified and passed on which adds overhead to the
system.
Moreover, careful planning of the layers is necessary, as a layer can
use only lower level layers. UNIX is an example of this structure.
58
59
MIT School of Computing
Department of Computer Science & Engineering
Micro-kernel
This structure designs the operating system by
removing all non-essential components from the
kernel and implementing them as system and user
programs.
This resultsfails, in a smaller kernel called the
micro-kernel. Advantages PLD
of this structure are that
all new services need to be added to user space and
does not require the kernel to be modified.
Thus it is more secure and reliable as if a service
fails, then rest of the operating system remains
untouched. Mac OS is an example of this type of OS.
60
61
MIT School of Computing
Department of Computer Science & Engineering
Monolithic
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
PLD
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
62
command of all hardware, the monolithic kernel performs the
63
MIT School of Computing
Department of Computer Science & Engineering
Operating-System Operations
• PROCESS MANAGEMENT
• MEMORY MANAGEMENT
• SYSTEM MANAGEMENT
• PROTECTION AND SECURITY
PLD
64
MIT School of Computing
Department of Computer Science & Engineering
PROCESS MANAGEMENT
Process Management refers to
aligning processes with an
organization's strategic goals,
designing and implementing
process architectures,
establishing
PLD
process
measurement systems that align
with organizational goals, and
educating and organizing
managers so that they will
manage processes effectively.
SUMMARY
65
MIT School of Computing
Department of Computer Science & Engineering
Memory Management
Memory :
Memory is a device that is used to store data or programs on a
temporary or permanent basis for use
PLD in an electronic digital
computer.
66
MIT School of Computing
Department of Computer Science & Engineering
PLD
67
MIT School of Computing
Department of Computer Science & Engineering
68
MIT School of Computing
Department of Computer Science & Engineering
1. Performance
2. Reliability
3. Recoverability
4. Capacity
PLD
69
MIT School of Computing
Department of Computer Science & Engineering
PLD
70
MIT School of Computing
Department of Computer Science & Engineering
71
MIT School of Computing
Department of Computer Science & Engineering
OS SECURITY ISSUES
PLD
72
MIT School of Computing
Department of Computer Science & Engineering
Operating-System Service
An operating system executes programs and makes the process of solving
them easier. It also makes the computer system easier to use and helps
the user use the computer hardware efficiently. Apart from these, it also
provides an array of services both to the users and the programs.
1. User Interface
PLD
An interface is required to communicate with the user. Then it can either be a
Command Line Interface or a Graphical User Interface.
As for the first two, Command Line Interface commonly uses text commands input by
the users to interact with the system. These commands can also be given using a
terminal emulator, or remote shell client.
A Graphical User Interface (GUI) allows users to interact with the computer system or
any other computer-controlled device.
73
MIT School of Computing
Department of Computer Science & Engineering
A user interface
User Operating-System Interface (UI) refers to the part
of an operating
system, program, or
device that allows a
user to enter and
receive information. A
text-based user
interface (see the
PLD image to the left)
displays text, and its
commands are usually
typed on a command
line using a keyboard.
1. A system call function may create and use kernel processes to execute
the asynchronous processing.
2. A system call has greater authority than a standard subroutine. A
system call with kernel-mode privilege executes in the kernel
protection domain.
3. System calls are not permitted to use shared libraries or any symbols
that are not present in the kernel protection domain.
4. The code and data for system calls are stored in global kernel memory.
76
MIT School of Computing
Department of Computer Science & Engineering
PLD
77
MIT School of Computing
Department of Computer Science & Engineering
Process Control
Process control is the system call that is used to direct the processes. Some process
control examples include creating, load, abort, end, execute, process, terminate the
process, etc.
File Management
File management is a system call that is used to handle the files. Some file
management examples include creating files, delete files, open, close, read, write, etc.
Information Maintenance
Information maintenance is a system call that is used to maintain information. There are
some examples of information maintenance, including getting system data, set time or
date, get time or date, set system data, etc.
Communication
Communication is a system call that is used for communication. There are
some examples of communication, including create, delete communication
connections, send, receive messages, etc.
78
MIT School of Computing
Department of Computer Science & Engineering
System Programs
System Programming can be defined as the
act of building Systems Software using System
Programming Languages. According to
Computer Hierarchy, one which comes at last is
Hardware. Then it is Operating System, System
Programs, and finally Application Programs.
Program Development and Execution can be
done conveniently in System Programs. Some of
the System Programs are simply user interfaces,PLD
others are complex. It traditionally lies between
the user interface and system calls.
79
MIT School of Computing
Department of Computer Science & Engineering
SYSTEM PROGRAMS
System programs communicate and coordinate the activities and
functions of hardware and software of a system and also
controls the operations of the hardware.
80
MIT School of Computing
Department of Computer Science & Engineering
Efficiency
Robustness PLD
Flexibility
Portability
Security
Compatibility
82
MIT School of Computing
Department of Computer Science & Engineering
VIRTUAL MACHINE
PLD
83
MIT School of Computing
Department of Computer Science & Engineering
VIRTUAL MACHINE
Virtual Machine can be defined
as an emulation of the computer
systems in computing.
Virtual Machines
A Virtual Machine (VM) is a compute resource that uses
software instead of a physical computer to run programs and
deploy apps. One or more virtual “guest” machines run on a
physical “host” machine.
PLD
85
MIT School of Computing
Department of Computer Science & Engineering
ASSIGNMENT 1
1. Explain Computer-System Organization with suitable diagram.
2. Enlist and explain different types of system software
3. Enlist and explain different types of Application software
4. Define OS and Explain Functions of Operating Systems.
5. What is virtual Machine and Explain it.
6. What is System Call? What are its different [Link]
7. Elaborate Operating System layered Architecture.
8. List and Explain different operation performed by operating system.
9. Differentiate between system software and Application Software
10. Draw neat diagram and explain in detail computer system Architecture
11. Explain operating system structures?
[Link] is Operating System? Describe operating system architecture with suitable example
13. Explain operating system Design issues.
14. Write difference between Monolithic kernel and Micro kernel.
15. Brief User and Operating System Interface in detail.
86