OPERATING SYSTEMS (CS F372)
Introduction
Barsha Mitra
BITS Pilani CSIS Dept., BITS Pilani, Hyderabad Campus
Hyderabad Campus
Topics to be covered
• Introduction • Mass Storage
• OS Structures • File System Interface
• Processes • File System Implementation
• Threads • I/O Systems
• CPU Scheduling
• Process Synchronization
• Deadlocks
• Main Memory Management
• Virtual Memory
BITS Pilani, Hyderabad Campus
Handout Overview
Text Book:
T1. Silberschatz, Galvin, and Gagne, “Operating System Concepts”, 9th
edition, John Wiley & Sons, 2012.
Reference Books:
R1. W. Stallings, “Operating Systems: Internals and Design Principles”, 6th
edition, Pearson, 2009.
R2. Tanenbaum, Woodhull, “Operating Systems Design & Implementation”,
3rd edition, Pearson, 2006.
R3. Dhamdhere, “Operating Systems: A Concept based Approach”, 2nd
edition, McGrawHill, 2009.
R4. Robert Love, “Linux Kernel Development”, 3rd edition, Pearson, 2010.
BITS Pilani, Hyderabad Campus
Handout Overview
Reference Books:
R5. Russ Cox, Frans Kaashoek, Robert Morris, “xv6 a simple, Unix-like
teaching operating system”. Online Draft, 2021.
[Link]
R6. Daniel P. Bovet, Marco Cesati “Understanding the Linux Kernel”, 3rd
Edition.
R7. Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman “Linux Device
Drivers”, 3rd Edition.
BITS Pilani, Hyderabad Campus
Evaluation
Component Duration Weightage (%) Date & Time Nature of Component
Mid Semester 90 minutes 35% As per Time Table Closed Book
Examination
Assignment (2 Nos.) Take Home 25% TBA Open Book
Comprehensive 180 minutes 40% As per Time Table Closed Book
Examination
BITS Pilani, Hyderabad Campus
Handout Overview
• Chamber Consultation – Mondays 3 pm to 3:50 pm
• Notices
• Make-up Policy
BITS Pilani, Hyderabad Campus
What is an Operating System
BITS Pilani, Hyderabad Campus
Introduction
• program that manages computer’s hardware
• acts as an intermediary between computer user and computer h/w
• Types
• mainframe operating systems
• personal computer (PC) operating systems
• operating systems for mobiles
BITS Pilani, Hyderabad Campus
Computer System Architecture
Hardware – provides basic computing resources
CPU, memory, storage, I/O devices
Operating system
Controls and coordinates use of hardware among various applications and users
Application programs – solve computing problems of users
word processors, email, web browsers, database systems, video games, media player
Users
People, machines, other computers
BITS Pilani, Hyderabad Campus
Computer System Architecture
BITS Pilani, Hyderabad Campus
What OS Does? : User View
Users want convenience, ease of use and good performance
Don’t care about resource utilization
Shared computer such as mainframe/minicomputer must keep all users happy
Dedicated systems like workstations have dedicated resources, also use shared
resources from servers
Handheld computers are resource poor, optimized for individual usability and
battery life
Some computers have little or no user interface, such as embedded computers
in devices and automobiles
BITS Pilani, Hyderabad Campus
What OS Does? : System View
OS is a resource allocator
Manages all resources
Decides between conflicting requests for efficient and fair resource use
OS is a control program
Controls execution of user programs
Prevent errors and improper use of computer
BITS Pilani, Hyderabad Campus
How do we define OS?
Everything a vendor ships when you order an operating system
“The one program running at all times on the computer”
BITS Pilani, Hyderabad Campus
OS vs. Kernel
KERNEL Memory Disk
Manage Manag
ment ement
DEVICE
DRIVERS Process Task
Manag Manage
ement ment
OS UTILITIES
• [Link]
SYSTEM n-operating-system-and-kernel/
• [Link]
LIBRARIES ext=Linux%20is%20the%20kernel%3A%20the,of%2
0a%20complete%20operating%20system
USER .
• [Link]
INTERFACE n-operating-system-and-kernel
BITS Pilani, Hyderabad Campus
Computer System Operation
Computer-system operation
One or more CPUs, device controllers connect through common bus
providing access to shared memory
Concurrent execution of CPUs and devices competing for memory cycles
device controller is
a hardware
component that
works as a bridge
between the
hardware device
and the operating
system or an
application
program
BITS Pilani, Hyderabad Campus
Computer-System Operation
device controller
maintains some local buffer storage and a set of special-purpose
registers
moves dataand
I/O devices between
the CPU the devicesconcurrently
can execute that it controls and its local buffer
storage
Device controller informs CPU that it has finished its operation by causing an
operating systems have a device driver for each device controller
interrupt
device driver
understands the device controller
provides the rest of the OS with a uniform interface to the device
BITS Pilani, Hyderabad Campus
Interrupt Handling
Sequential program IVT - table of
execution by CPU pointers containing Control
addresses of all transfer Execute ISR
service routines to ISR
Examine
Interrupt
Vector Table
(IVT)
Interrupt
received
Save contents of Control returns to
CPU registers & PC interrupted
on system stack program
BITS Pilani, Hyderabad Campus
Storage Structure
BITS Pilani, Hyderabad Campus
Operating System Operations
Dual-mode operation allows OS to protect itself and protect users from one
another
User mode and Kernel/Supervisor/System/Privileged mode
Mode bit provided by hardware
Provides ability to distinguish when system is running user code or kernel code
Some instructions designated as privileged, only executable in kernel mode
System call changes mode to kernel, return from call resets it to user
locate ISR via interrupt
vector and execute
BITS Pilani, Hyderabad Campus
Operating System Operations
Boot time hardware starts in kernel mode
After loading OS, user applications are started in user mode
When trap/interrupt occurs, hardware switches from user mode to
kernel mode
examples of privileged instructions – I/O control, timer management,
interrupt management
BITS Pilani, Hyderabad Campus
Computing Environments
Multiprocessor Systems
BITS Pilani, Hyderabad Campus
Computing Environments
Multicore Systems
Benefits??
dual-core design with both cores on same chip
BITS Pilani, Hyderabad Campus
Multiprogramming (Batch system)
Main Memory
OS
P1 performs Job P1
I/O
Job pool Job P2
(Secondary
Storage) Job P3
P2 Executed
Waiting
for Job P4
processor
allocation
BITS Pilani, Hyderabad Campus
Multitasking
Document Web
Antivirus Image
Editor Browser
Software Editor
Processes/Applications
BITS Pilani, Hyderabad Campus
Thank You
BITS Pilani, Hyderabad Campus