Ch-1 OS Intro
Ch-1 OS Intro
CS3500
PROF. SUKHENDU DAS
DEPTT. OF COMPUTER SCIENCE AND ENGG.,
IIT MADRAS, CHENNAI – 600036.
Email: sdas@cse.iitm.ac.in
URL: //www.cse.iitm.ac.in/~vplab/os.html
https://sites.google.com/smail.iitm.ac.in/3500-os/
Better follow: //
Office – SSB302; Ph – 4367 / 5389
July-Nov. – 2022.
INTRODUCTION
Contents to be covered
Part 1: Overview
1. Introduction
2. Operating-System Services
- Avi Silberschatz
- Peter Baer Galvin
- Greg Gagne
- William Stallings
TENTATIVE GRADING POLICY
(SUBJECT TO APPROVAL OF CSE-CC)
.drv
.sys
.cab
.reg
.vga
Each device controller type has an operating system device driver to manage it
Device controller informs CPU that it has finished its operation by causing an interrupt
Common Functions of Interrupts
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 the interrupted instruction
A trap or exception is a software-generated interrupt caused either by an error or a user request
An operating system is interrupt driven
Interrupt
Timeline
Interrupt Handling
The operating system preserves the
state of the CPU by storing the
registers and the program counter
After I/O starts, control returns to user program only upon I/O completion
Wait instruction idles the CPU until the next interrupt
Wait loop (contention for memory access)
At most one I/O request is outstanding at a time, no simultaneous I/O processing
After I/O starts, control returns to user program without waiting for I/O completion
System call – request to the OS to allow user to wait for I/O completion
Device-status table contains entry for each I/O device indicating its type, address,
and state
OS indexes into I/O device table to determine device status and to modify table
entry to include interrupt
Computer Startup
Bootstrap program is loaded at power-up or reboot
Typically stored in ROM or EPROM, generally known as firmware
Initializes all aspects of system
Loads operating system kernel and starts execution
Storage Structure
Main memory – only large storage media that the CPU can access directly
Random access
Typically volatile
Typically random-access memory in the form of Dynamic Random-access Memory
(DRAM)
Secondary storage – extension of main memory that provides large nonvolatile storage
capacity
Hard Disk Drives (HDD) – rigid metal or glass platters covered with magnetic recording
material
Disk surface is logically divided into tracks, which are subdivided into sectors
The disk controller determines the logical interaction between the device and the
computer
Non-volatile memory (NVM) devices– faster than hard disks, nonvolatile
Various technologies
Becoming more popular as capacity and performance increases, price drops
Storage Hierarchy
Storage systems organized in
hierarchy
Speed
Cost
Volatility
Caching – copying
information into faster storage
system; main memory can be
viewed as a cache for
secondary storage
Device Driver for each
device controller to manage
I/O
Provides uniform interface
between controller and
Storage-Device Hierarchy
kernel
How a Modern Computer Works
Only one interrupt is generated per block, rather than the one
interrupt per byte
Operating-System Operations
program – simple code to initialize the system, load the kernel
Kernel loads
• Single user cannot always keep CPU and I/O devices busy
• Multiprogramming organizes jobs (code and data) so CPU always
has one to execute
• A subset of total jobs in system is kept in memory
• One job selected and run via job scheduling
• When job has to wait (for I/O for example), OS switches to
another job
MULTITASKING (TIMESHARING)
• How do we guarantee that user does not explicitly set the mode bit to
“kernel”?
• System call changes mode to kernel, return from call resets it to user
• Some instructions designated as privileged, only executable in kernel mode
TRANSITION FROM USER TO KERNEL MODE
TIMER
Mobile: Handheld smartphones, tablets, etc. Leaders are Apple iOS and Google Android
Client Server: Client requests resource/service and server provides that respective resource/service. A
server can provide service to multiple clients at a time and here mainly communication happens through
computer network.
Peer-to-Peer: All nodes are considered peers. May each act as client, server or both. Examples include
Napster and Gnutella, Voice over IP (VoIP) such as Skype
Cloud computing: On demand availability of computer system resources like processing and storage are
availed. Here computing is not done in individual technology or computer rather it is computed in cloud
of computers where all required resources are provided by cloud vendor.
Real-time Embedded: Real-time OS has well-defined fixed time constraints. Processing must be done
within constraint.