Operating Systems 24CSEN2011
Module 1
Dr D Ramakrishna
Assistant Professor
Department of Computer Science and Engineering
GITAM School of Computer Science and Engineering(GSCSE)
Visakhapatnam – 530045
Email: rdamodar@[Link]
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 1
Course Objectives
• To introduce basic concepts of the operating system, its functions and services.
• To elaborate on the concepts of process management and synchronization.
• To expose issues with deadlocks.
• To familiarize with memory management schemes
• To discuss mass storage structures and system protection.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 2
Course Outcomes
1. Use the appropriate concepts of operating system for resource utilization(L3)
2. Implement and analyze the performance of process scheduling algorithms.(L4)
3. Identify the mechanism to deal with deadlock and concurrency issues.(L4)
4. Experiment the performance of different algorithms used in management of
memory, file and I/O and select the appropriate. (L3)
5. Demonstrate different device and resource management techniques for memory
utilization with security mechanisms(L4)
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 3
Syllabus
Module - I
OVERVIEW OF OPERATING SYSTEMS: 10L
Introduction: Basic organization of hardware components, Role of OS relative to hardware functionality,
Operating-System Operations, Generations of OS, Types of OS Process Management, Memory Management,
Storage Management, Kernel Data Structures, Computing Environments.
Operating System Structures: Types, Layered structure, System Components, Operating System services,
Reentrant Kernels, Monolithic and Microkernel Systems, Interrupt handling and System Calls, System Boot.
#Exemplar/Case Studies: Case Study Study of Debugging tools like GDB , Study the concepts of Class loading in
Java. Study and install VM VirtualBox to run other FOSS, Usage of tools.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 4
Syllabus
Module - II
PROCESS MANAGEMENT AND SCHEDULING 10L
Process Management: Process concepts, process scheduling, Operations on processes, inter- process communication
CPU Scheduling: Scheduling-criteria, scheduling algorithms, Thread scheduling, Multiple processor scheduling,
algorithm evaluation, Multithreaded programming, Multi-core Programming, Multi-threading Models, Thread Libraries.
#Exemplar/Case Studies: Process management in Linux /Windows/Android
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 5
Syllabus
Module - III
PROCESS SYNCHRONIZATION AND DEADLOCK 9L
Process Synchronization: Race condition, The Critical-Section Problem, Peterson’s Solution, Synchronisation
Hardware, Mutex Locks, Semaphores, Classic Problems of Synchronization, Monitors, Synchronization Examples.
Deadlocks: System model, Characterization, Methods for handling deadlocks, Deadlock
Prevention, Avoidance, Detection and Recovery from deadlock.
#Exemplar/Case Studies: Concurrency Mechanism: Linux/Windows/ Android
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 6
Syllabus
Module - IV
MEMORY MANAGEMENT 8L
Memory Management Strategies: Background, Swapping, Contiguous Memory Allocation, Segmentation, Paging,
Structure of the Page Table
Virtual Memory Management: Demand Paging; Copy-on-Write, Page Replacement; Allocation of Frames; Thrashing,
Memory-Mapped Files, Allocating Kernel Memory.
File System: File Concept, Access Methods, Directory and Disk Structure, Protection. File-System Implementation:
Structure
#Exemplar/Case Studies: Memory management and basic file system in Linux /Windows/Android, Implementation of
file utilities using the system call API in Linux /Windows/Android
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 7
Syllabus
Module - V
I/O SYSTEM, MASS STORAGE STRUCTURE AND VIRTUALIZATION 8L
I/O systems: Application interface, kernel I/O subsystem, transforming I/O to hardware operation.
Mass-storage structure: Disk management, disk scheduling, Swap space management
System Protection: Goals of protection, principles of protection, Domain of protection, Access matrix.
Virtualization: Introduction to Virtual Machines, Virtualization, introduction to Security-Problems
#Exemplar/Case Studies: Comparative Study of Operating Systems: Case of Windows, Linux, Mac, Android and iOS
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 8
Text Book
Text Book(s) :
1. Silberschatz, Galvin and Gagne, “Operating Systems Concepts”, 10th Edition, Wiley, 2019.
2. William Stallings, “Operating Systems: Internals and Design Principles ”, 11 th Edition, Pearson Education, 2022.
References :
1. Andrew S. Tannenbaum and Herbert Bos, Modern Operating Systems, 4th edition,
2. Avi Silberschatz, Peter Baer Galvin, Greg Gagne, Operating System Concepts, 9th, edition,
3. Allen B. Downey, Think OS, A Brief Introduction to Operating Systems,
4. [Link]
5. Robert Love, Linux Kernel Development, 3rd edition,
6. Thomas Anderson, Michael Dahlin, Operating Systems: Principles and Practice,
7. [Link]
8. Randall E. Bryant, David R.O’ Hallaron,, Computer Systems: A Programmer's Perspective, 3rd edition,
9. Brian Kernighan, Dennis Ritchie, The C Programming Language, 2nd.
.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 9
WHAT IS AN OPERATING SYSTEM?
• A program that acts as an intermediary between a
computer user and computer hardware.
• It provides an environment to the user so that, the user
can perform its task in a convenient and efficient way.
• Operating system goals:
– Execute user programs and make solving user problems easier
– Make the computer system convenient to use
– Use the computer hardware in an efficient manner
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 10
Definition of Operating System
• An Operating System can be defined as an interface
between user and hardware. It is responsible for the
execution of all the processes, Resource
Allocation, CPU management, File Management and
many other tasks.
• The purpose of an operating system is to provide an
environment in which an user can execute programs in
convenient and efficient manner.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 11
Examples of OS
The 5 most popular operating systems.
1. Microsoft Windows.-
2. Apple macOS.
3. Google's Android OS.
4. Apple iOS.
5. Linux Operating System.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 12
Functions of OS
• Processor Management
• Memory Management
• Device Management
• File management
• Storage Management
• Protection and Security
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 13
Features of Operating System (OS)
Here is a list important features of OS:
• Protected and supervisor mode
• Allows disk access and file systems Device drivers Networking Security
• Program Execution
• Memory management Virtual Memory Multitasking
• Handling I/O operations
• Manipulation of the file system
• Error Detection and handling
• Resource allocation
• Information and Resource Protection
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 14
Abstract View of the components of a computer System
Computer system consisting of hardware, software and data
The OS Provides the means for proper use of the resources in the operation of the computer system
Humans
Program Interface
User Programs
O.S. Interface
O.S.
Hardware Interface/
Privileged Instructions
Disk/Tape/Memory
30 November 2025
Department of CSE, GSCSE 24CSEN2011 : 15
OPERATING SYSTEMS
How operating system is different from other system software
1. Operating system directly interact with network, it is also a part of system software.
2. It manages peripheral devices
3. It looks after the memory management
4. It allocates resources
5. It looks the CPU not to sit idle.
Operating system can be viewed in two ways
a) User view
b) System view
a) User view
Most of the user sit in front of a pc and performs some task. Some users sit at a terminals connected to a
mainframe or minicomputer and other user’s access through other terminals, these users can share
resources and information. The operating system is designed to maximize resource utilization other users sit
at workstations connected to network of other workstations and servers.
b) System view
The operating system is the program that is most intimate with the hardware. We can view it as a resource
allocator.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 16
Computer system Organization
The Three components are:-
[Link]-System Operation
[Link] Structure
3.I/O Structure
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 17
Computer system Organization
[Link]-System Operation
A Modern computer system
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 18
Computer system Organization
• One or more CPUs, device controllers connect through common bus providing
access to shared memory
• Depends on the point of view – Users want convenience, ease of use – System
managers and owners want efficiency use of resources such as CPU use of
resources such as CPU time, memory, and storage; ultimately saving money
and serving business
• Bootstrap program is loaded at power-up or reboot – Typically stored in ROM
or EPROM, generally known as known as firmware.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 19
Computer system Organization
• I/O devices and the CPU can execute in parallel
• Each device controller is in charge of a particular device type
• Each device controller has a local buffer .
• CPU moves data from/to main memory to/from local buffers.
• I/O is from the device to local buffer of controller .
• Device controller informs CPU that it has finished its operation by causing an
interrupt (e.g., by setting the interrupt bit in a register)
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 20
Computer system Organization
• Interrupt transfers control to the interrupt service routine generally, through the
interrupt vector, which contains the addresses of all the service routines
• Interrupt architecture must save the address of Interrupt architecture must save the
address of the interrupted instruction
• An operating system is interrupt driven.
• The operating system preserves the state of the CPU by storing registers and the
program counter .
• Determines which type of interrupt has occurred (e.g., check interrupt register)
• Separate segments of code determine what action should be taken for each type of
interrupt.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 21
Computer system Organization
An interrupt time line for a single process doing output
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 22
Computer system Organization
2. Storage Structure
Storage-Device hierarchy
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 23
Computer system Organization
• General Purpose computers run most of their programs from rewritable
memory, called main memory(also called RAM or Random access memory).
• Main Memory commonly is implemented in a semi conductor technology
called Dynamic RAM(DRAM).
• Computers use other forms of memory as well. Because the read-only
memory(ROM) cannot be changed ,only static programs are stored there.
• Generally we want to store the programs and data in main memory but this is
not possible because:-
[Link] memory is usually too small to store all needed programs and
data permanently.
2. Main Memory is a volatile storage device that loses its contents where
power is turned off or otherwise lost.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 24
Computer system Organization
• Most computers systems provide secondary storage as an extension of main memory.
The main requirement for secondary storage is that it will be able to hold large
quantities of data permanently.
• The most common secondary- storage device is a Magnetic disk.
• Volatile storage loses it contents when the power to the device removed so data must
be written to non-volatile storage
• An Electronic disk can be volatile or non-volatile. Another form of electronic disk is
Flash memory, which is popular in cameras and Personal digital assistants(PDA’s) in
robots.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 25
Computer system Organization
3.I/O Structure
After I/O starts, control returns to user program only upon I/O completion (e.g., keyboard
input, or reading file from disk) .
The user program is taken off the CPU – When the I/O is complete, the device
(keyboard, or disk controller) sends an interrupt to the OS – The OS saves the current
process, handles the interrupt, the system continues …
Direct Memory Access (DMA)
Device controller transfers blocks of data from buffer storage directly to main memory
without CPU intervention, once a request is received request is received.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 26
Types of Operating Systems
[Link] system
2. Multi-programmed system
3. Time sharing system
4. Multi-processor system
5. Distributed system
6. Real time system
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 27
Batch Systems
Batch Operating System
• In the era of 1970s, the Batch processing was very popular.
The Jobs were executed in batches. People were used to have a
single computer which was called mainframe.
• In Batch operating system, access is given to more than one
person; they submit their respective jobs to the system for the
execution.
• The system put all of the jobs in a queue on the basis of first
come first serve and then executes the jobs one by one. The
users collect their respective output when all the jobs get
executed.
Department of CSE, GSCSE 24CSEN2011 :
30 November 2025 28
OPERATING SYSTEMS
Multi Programmed Systems
• Multiprogramming is an extension to the batch processing
where the CPU is kept always busy. Each process needs
two types of system time: CPU time and IO time.
• In multiprogramming environment, for the time a process
does its I/O, The CPU can start the execution of other
processes. Therefore, multiprogramming improves the
efficiency of the system.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 29
Time Sharing Systems
• A Time shared operating system uses CPU scheduling and
multi-programming to provide each with a small portion of a
shared computer at once.
• Each user has at least one separate program in memory.
• A program loaded into memory and executes, it performs a
short period of time either before completion or to complete
I/O.
• This short period of time during which user gets attention of
CPU is known as time slice, time slot or quantum.
In above figure the user 5 is active state but user
1, user 2, user 3, and user 4 are in waiting
state whereas user 6 is in ready state.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 30
Multiprocessor Systems
• A Multiprocessing operating system (OS) is one in which
two or more central processing units (CPUs) control the
functions of the computer.
• Each CPU contains a copy of the OS, and these copies
communicate with one another to coordinate operations.
• The use of multiple processors allows the computer to
perform calculations faster, since tasks can be divided up
between processors.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 31
Distributed Systems
• It is a modern computer to interconnect groups of
PC, batch systems time sharing and real time
system.
• This has an influence on operating system strategies
because of the need for strategy to handle resources
and information sharing across the machines
interconnected with a network.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 32
Real Time Systems
• A Real-time system is defined 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.
• The time taken by the system to respond to an input and display of
required updated information is termed as the response time.
• 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.
• A real-time operating system must have well-defined, fixed time
constraints, otherwise the system will fail.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 33
Computer System Architecture
The Architecture consists of 3 components
1 Single –Processor Systems
2. Multiprocessor Systems
[Link] systems
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 34
Single –Processor Systems
• Most systems use a single processor. a single-processor system, there is one
main CPU capable of executing a general-purpose instruction set, including
instructions from user processes.
• Almost all systems have other special-purpose processors as well. They may
come in the form of device-specific processors, such as disk, keyboard, and
graphics controllers or on mainframes, they may come in the form of more
general-purpose processors, such as I/O processors that move data rapidly
among the components of the system.
• All of these special-purpose processors run a limited instruction set and do not
run user processes.
• Sometimes they are managed by the operating system, in that the operating
system sends them information about their next task and monitors their status
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 35
Multiprocessor Systems
• Multiprocessor systems (also known as parallel systems or tightly coupled
systems) are growing in importance. Such systems have two or more processors in
close communication, sharing the computer bus and sometimes the clock, memory,
and peripheral devices.
• Multiprocessor systems have three advantages:
1. Increased throughput.
2. Economy of scale. Multiprocessor systems can cost less than equivalent multiple
single-processor systems, because they can share peripherals, mass storage, and
power supplies.
[Link] reliability. If functions can be distributed properly among several
processors, then the failure of one processor will not halt the system, only slow it
down.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 36
Multiprocessor Systems
The multiple-processor systems in use today are of two types.
1. Asymmetric multiprocessing, which each processor is assigned a specific
task.
2. Symmetric multiprocessing (SMP), The most common systems use in which
each processor performs all tasks within the operating system.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 37
Clustered systems
• Clustered system is an another type of multiple-
CPU system. Clustered systems differ from
multiprocessor systems, however, in that they are
composed of two or more individual systems coupled
together.
• Clustering is usually used to provide high-
availability service; that is, service will continue
even if one or more systems in the cluster fail.
Clustering can be structured asymmetrically or
symmetrically. Cluster technology is changing
rapidly.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 38
Operating System Structure
• An operating system provides the environment
within which programs are executed. One of the
most important aspects of operating systems is the
ability to multiprogram.
• A single user cannot, in general, keep either the
CPU or the I/O devices busy at all times.
Multiprogramming increases CPU utilization by
organizing jobs (code and data) so that the CPU
always has one to execute.
• The operating system keeps several jobs in
memory simultaneously
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 39
Operating System Structure
• Time sharing (or multitasking) is a logical extension of multiprogramming.
In time-sharing systems, the CPU executes multiple jobs by switching among
them, but the switches occur so frequently that the users can interact with each
program while it is running.
Time sharing requires an interactive (or hands-on) computer system, which
provides direct communication between the user and the system.
A time-shared operating system allows many users to share the computer
simultaneously.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 40
Operating System Operations
• Interrupt driven is modern operating systems.
Trap (or an exception) is a software-generated interrupt caused either by an error (for
example, division by zero or invalid memory access) or by a specific request from a
user program that an operating-system service be performed.
• The interrupt-driven nature of an operating system defines that system's general
structure.
• For each type of interrupt, separate segments of code in the operating system
determine what action should be taken.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 41
Operating system operations
1 .Dual-Mode Operation
Two separate modes of operation: user mode and kernel mode (also
called supervisor mode, system mode, or privileged mode). A bit, called
the mode bit, is added to the hardware of the computer to indicate the
current mode: kernel (0) or user (1).
The dual mode of operation provides us with the means for protecting
the operating system from errant users—and errant users from one
another.
The hardware allows privileged instructions to be executed only in kernel
mode.
If an attempt is made to execute a privileged instruction in user mode, the
hardware does not execute the instruction but rather treats it as illegal and
traps it to the operating system.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 42
Operating System Operations
2 Timer
• A timer can be set to interrupt the computer after a specified period. The period may
be fixed (for example, 1/60 second) or variable (for example, from 1 millisecond to 1
second).
Variable timer is generally implemented by a fixed-rate clock and a counter.
The operating system sets the counter.
• Every time the clock ticks, the counter is decremented.
• We can use the timer to prevent a user program from running too long.
• A simple technique is to initialize a counter with the amount of time that a program is
allowed to run.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 43
Introduction to Operating System Generation
• Operating system generation refers to the evolution and development of operating
systems over time.
• Each generation represents a significant advancement in technology and features.
• Different generations of operating systems have distinct characteristics and
capabilities.
First Generation Operating Systems
• First-generation operating systems were developed in the 1950s and 1960s.
• These operating systems were primarily used on mainframe computers.
• They were simple and had limited functionality, mainly focused on batch processing.
Second Generation Operating Systems
• Second-generation operating systems were
developed in the 1960s and 1970s.
• These operating systems introduced the
concept of time-sharing, allowing multiple
users to access the system simultaneously.
• They also introduced the use of high-level
programming languages and improved
memory management.
Third Generation Operating Systems
• Third-generation operating systems were
developed in the 1970s and 1980s.
• These operating systems were designed for
personal computers and introduced graphical
user interfaces (GUIs).
• They also provided multitasking capabilities,
allowing users to run multiple applications
simultaneously.
Fourth Generation Operating Systems
• Fourth-generation operating systems emerged in the late 1980s and early 1990s.
• These operating systems focused on improving performance and efficiency.
• They introduced features like virtual memory, file systems, and networking
capabilities.
Fifth Generation Operating Systems
• Fifth-generation operating systems are currently being developed and refined.
• These operating systems aim to provide seamless integration between different
devices and platforms.
• They focus on artificial intelligence, machine learning, and advanced security
features.
Process Management
• A process is a program in execution. It is a unit of work within the system.
Program is a passive entity, process is an active entity.
• Process needs resources to accomplish its task
– CPU, memory, I/O, files
– Initialization data
• Process termination requires reclaim of any reusable resources
• Single-threaded process has one program counter specifying location of next
instruction to execute
– Process executes instructions sequentially, one at a time, until completion
• Multi-threaded process has one program counter per thread
• Typically system has many processes, some user, some operating system
running concurrently on one or more CPUs
– Concurrency by multiplexing the CPUs among the processes / threads
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 50
Process Management
• The operating system is responsible for the following activities in connection
with Process Management
1. Scheduling processes and threads on the CPUs.
2. Creating and deleting both user and system processes.
3. Suspending and resuming processes.
4. Providing mechanisms for process synchronization.
5. Providing mechanisms for process communication.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 51
Memory Management
• Memory Management is an essential function of the Operating System. This
comes under one of the two main functions of an Operating System, resource
management. Main memory (RAM) is where most of the applications run
• The jobs of memory management include:-
❑ keeping track of which parts of memory is in use.
❑ Allocate memory to processes.
❑ Free up the memory after the processes have used it.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 52
Storage Management
• OS provides uniform, logical view of information storage
– Abstracts physical properties to logical storage unit - file
– Each medium is controlled by device (i.e., disk drive, tape drive)
– Varying properties include access speed, capacity, data-transfer rate, access
method (sequential or random)
The main components of storage management are:-
1. File-System Management
[Link]-Storage Management
3. Caching
4.I/O Systems
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 53
Storage Management
1. File-System Management
– Files usually organized into directories
– Access control on most systems to determine who can access what
– OS activities include
• Creating and deleting files and directories
• Primitives to manipulate files and directories
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media
[Link]-Storage Management
• Usually disks used to store data that does not fit in main memory or data that must be
kept for a “long” period of time
• Proper management is of central importance
• Entire speed of computer operation hinges on disk subsystem and its algorithms
• OS activities
– Free-space management
– Storage allocation
– Disk scheduling
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 54
Storage Management
• Some storage need not be fast
– Tertiary storage includes optical storage, magnetic tape
– Still must be managed – by OS or applications
– Varies between WORM (write-once, read-many-times) and RW (read-write)
3. Caching:-
• Multitasking environments must be careful to use most recent value, no matter
where it is stored in the storage hierarchy
Multiprocessor environment must provide cache coherency in hardware such
that all CPUs have the most recent value in their cache
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 55
Storage Management
4.I/O Systems:-
• I/O subsystem responsible for
– Memory management of I/O including buffering (storing data temporarily
while it is being transferred), caching (storing parts of data in faster storage
for performance), spooling (the overlapping of output of one job with input
of other jobs)
– General device-driver interface
– Drivers for specific hardware devices
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 56
Protection and Security
✔ Protection, is any mechanism for controlling the access of processes or users to the resources defined by a
computer system.
✔ Protection can improve reliability by detecting latent errors at the interfaces between component subsystems.
✔ Early detection of interface errors can often prevent contamination of a healthy subsystem by another
subsystem that is malfunctioning.
✔ The job of security is to defend a system from external and internal attacks.
✔ Such attacks spread across a huge range and include viruses and worms, denial-of service attacks (which use
all of a system’s resources and so keep leGSTimate users out of the system), identity theft, and theft of service.
✔ Most operating systems maintain a list of user names and associated user identifiers (user IDs).
✔ In Windows parlance, this is a security ID (SID). These numerical IDs are unique, one per user.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 57
Kernel Data Structures
Lists, Stacks, and Queues
✔ An array is a simple data structure in which each element can be accessed directly. For example, main memory
is constructed as an array.
✔ A list represents a collection of data values as a sequence.
✔ The most common method for implementing this structure is a linked list, in which items are linked to one
another.
✔ Linked lists are of several types:
▪ In a singly linked list, each item points to its successor.
▪ In a doubly linked list, a given item can refer either to its predecessor or to its successor.
▪ In a circularly linked list, the last element in the list refers to the first element, rather than to null.
Singly linked list
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 58
Kernel Data Structures
Lists, Stacks, and Queues
Doubly linked list
Circularly linked list
✔ Linked lists accommodate items of varying sizes and allow easy insertion and deletion of items.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 59
Kernel Data Structures
Lists, Stacks, and Queues
✔ A stack is a sequentially ordered data structure that uses the last in, first out (LIFO) principle for adding
and removing items, meaning that the last item placed onto a stack is the first item removed.
✔ The operations for inserting and removing items from a stack are known as push and pop, respectively.
✔ An operating system often uses a stack when invoking function calls.
✔ A queue, in contrast, is a sequentially ordered data structure that uses the first in, first out (FIFO) principle:
items are removed from a queue in the order in which they were inserted.
✔ Example of queues in OS is jobs that are sent to a printer are typically printed in the order in which they
were submitted.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 60
Kernel Data Structures
Trees
✔ A tree is a data structure that can be used to represent data hierarchically. Data values in a tree structure are
linked through parent–child relationships.
✔ General Tree
✔ Binary Tree
✔ Binary search Tree
✔ Balanced binary search tree
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 61
Kernel Data Structures
Hash Functions and Maps
✔ A hash function takes data as its input, performs a numeric operation on this data, and returns a numeric
value.
✔ This numeric value can then be used as an index into a table (typically an array) to quickly retrieve the data.
✔ One potential difficulty with hash functions is that two inputs can result in the same output value—that is,
they can link to the same table location.
✔ We can accommodate this hash collision by having a linked list at that table location that contains all of
the items with the same hash value.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 62
Kernel Data Structures
Hash Functions and Maps
✔ One use of a hash function is to implement a hash map, which associates (or maps) [key:value] pairs using
a hash function.
✔ Once the mapping is established, we can apply the hash function to the key to obtain the value from the
hash map.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 63
Kernel Data Structures
Bitmaps
✔ A bitmap is a string of n binary diGSTs that can be used to represent the status of n items.
✔ For example, suppose we have several resources, and the availability of each resource is indicated by the
value of a binary diGST: 0 means that the resource is available, while 1 indicates that it is unavailable (or
vice-versa).
✔ The value of the ith position in the bitmap is associated with the ith resource.
✔ As an example, consider the bitmap shown below:
001011101
Resources 2, 4, 5, 6, and 8 are unavailable; resources 0, 1, 3, and 7 are available.
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 64
Computing Environments
• Computing environments describe the different contexts in which computing systems are used, from desktops
and offices to mobile devices and large distributed systems.
• Each environment has distinct characteristics, resource constraints, and usage patterns that influence how
operating systems are designed and utilized.
• As technology evolves, the boundaries between these environments often blur, introducing hybrid or
interconnected models.
• Types of Computing Environments
– Traditional
– Mobile
– Client Server
– Peer-to-Peer
– Cloud computing
– Real-time Embedded
30-11-2025 Department of CSE, GST Operating Systems 65
Traditional Computing
• Traditional computing refers to the classic model of using personal computers, workstations, and office systems
that rely on stable hardware setups and local networks.
• This environment originally centered around desktop PCs working individually or in small networks, with servers
providing centralized services like file storage and printing.
Evolution of Traditional Computing
• As networking technology improved:
– Web portals were introduced, allowing users to access internal company systems through browsers.
– Faster WAN connections enabled organizations to interconnect remote locations more efficiently.
– Lightweight “network computers” or thin clients emerged.
• Homes began using firewalls, Wi-Fi routers, and shared resources like printers and storage devices.
30-11-2025 Department of CSE, GST Operating Systems 66
Mobile Computing
• Mobile computing refers to the use of portable, lightweight devices such as smartphones and tablets to perform
computing tasks while on the move.
• These devices are designed for mobility, enabling users to access services, applications, and information anytime
and anywhere.
• Mobile systems combine computing power with features like touch input, wireless communication, and built-in
sensors.
Specialized Hardware Features
• Mobile computing devices include several built-in sensors and components:
• GPS (Global Positioning System): Determines geographic location using satellites; used for navigation and
location-based services.
• Accelerometer: Detects the device’s orientation, tilt, movement, and vibration.
Common in motion-controlled games and screen-rotation detection.
• Gyroscope: Enhances rotation sensitivity, enabling more precise motion detection.
• High-definition displays and cameras: Support photography, video recording, reading, and media consumption.
30-11-2025 Department of CSE, GST Operating Systems 67
Client–Server Computing
• Client–server computing is a model in which clients request services and servers provide them.
• It structures computing into two main roles:
– Client: Initiates requests
– Server: Responds to client requests by performing operations or returning data
• This model supports a wide range of network-based applications and services.
General Structure
• Clients and servers communicate over a network, where:
– Clients may be desktops, laptops, tablets, or smartphones
– Servers are usually more powerful systems designed to process requests efficiently
• This communication model separates user interaction (client side) from data processing and resource
management (server side).
30-11-2025 Department of CSE, GST Operating Systems 68
Peer-to-Peer Computing
• Peer-to-peer (P2P) computing is a distributed model where all nodes act as equals—each node can function as
both a client and a server.
• Unlike the client–server model, there is no strict division between requesters and providers.
• Any node can request a service, provide a service, or do both simultaneously.
• Peer-to-peer systems discover services or resources in two main ways:
– Centralized Lookup Service
– Decentralized Discovery
Centralized Lookup Service
• A central directory maintains information about services provided by peers.
• When a peer needs a service, it queries this central lookup service.
• After locating the target peer, communication occurs directly between peers.
• Example: Early Napster — a centralized server maintained a database of shared files.
30-11-2025 Department of CSE, GST Operating Systems 69
Cloud Computing
• Cloud computing refers to delivering computing resources, storage, and
applications as services over a network—most commonly the Internet.
• It represents a shift from owning physical hardware to using shared, on-
demand resources managed by cloud providers.
• Cloud systems rely heavily on virtualization, allowing many virtual machines
and applications to run on shared physical infrastructure.
Characteristics
• On-Demand Access: Users can access computing power, storage, and
applications whenever needed.
• Scalability: Resources such as CPU time, memory, and storage can scale up or
down automatically based on demand.
• Elasticity: The environment adjusts dynamically to usage patterns—expanding
when workloads increase and contracting when workloads decrease.
• Pay-as-You-Go Model: Users pay only for the resources they consume, similar
to utilities like electricity.
30-11-2025 Department of CSE, GST Operating Systems 70
Real-Time Embedded Systems
• Real-time embedded systems are specialized computing systems designed to perform
specific, dedicated tasks within strict timing constraints.
• These systems are found in a wide variety of everyday devices such as car engines, medical
instruments, household appliances, and industrial machinery.
• Their primary goal is not general-purpose computing but fast, predictable, and reliable
responses to external events.
30-11-2025 Department of CSE, GST Operating Systems 71
Real-Time Systems: Core Idea
• A real-time system must complete its operations within well-defined time limits.
• If the system fails to meet these timing requirements, the entire operation may become
incorrect or unsafe.
• Timing is as important as functional correctness.
• Example scenario: A delay of even a fraction of a second in a robotic arm or brake controller
could cause failure or danger.
• Types of Real-Time Behavior : Real-time systems often interact with:
– Sensors — to collect data
– Actuators/Controllers — to adjust or control external devices
– Feedback loops — where sensor data influences subsequent control actions
• The cycle of: Input → Processing → Output
• must be completed within precise time bounds.
30-11-2025 Department of CSE, GST Operating Systems 72
THANK YOU
30 November 2025 Department of CSE, GSCSE 24CSEN2011 : OPERATING SYSTEMS 73