0% found this document useful (0 votes)
13 views

Lecture - 1 OS Ch#1

introduction to operating system

Uploaded by

Majid Saleem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lecture - 1 OS Ch#1

introduction to operating system

Uploaded by

Majid Saleem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 49

CC3011 - OPERATING

SYSTEMS

Ayesha Asmat
[email protected]
TEXT BOOK
Operating
Systems
Concepts, 10th
edition,
Abraham
Silberschatz,
Peter Baer
Galvin, Greg
Gagne; Wiley.
GRADING SCHEME
(TENTATIVE)
Total 100 marks

Assignmen
t, Quizzes
&
30 marks
Class
Participatio
n

Mid term 30 marks


TOPICS
 Introduction to Operating-System
 Operating-System Structures
 Processes
 Threads and Concurrency
 CPU scheduling
 Synchronization Tools
 Deadlocks
 Main Memory
 Virtual Memory
 File System
WHAT DOES
THE TERM
OPERATING
SYSTEM
MEAN?
WHAT IS OPERATING SYSTEM
A program that acts as an intermediary between a
user of a computer and the computer hardware

User

OS

Hardware
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
WHAT IS OPERATING SYSTEM
An operating system (OS) is:
A software acts as an intermediary
between the user of a computer and
the computer hardware.

The purpose of an operating system


is to provide an environment in which
a user can execute programs in a
convenient and efficient manner.
COMPUTER SYSTEM
STRUCTURE
A computer system can be divided roughly
into four components: the hardware, the
operating system, the application
programs, and a user
COMPUTER SYSTEM
STRUCTURE
Computer system can be divided into four
components:
Hardware – provides basic computing resources
 CPU, memory, I/O devices
Operating system
 Controls and coordinates use of hardware among various applications
and users
Application programs – define the ways in which the
system resources are used to solve the computing
problems of the users
 Word processors, compilers, web browsers, database systems, video
games
Users
 People, machines, other computers
WHAT OPERATING SYSTEMS DO
User View

System View
USER VIEW
The user’s view of the computer varies
according to the interface being used.
General Purpose PC
Users want convenience, ease of use and good
performance
 Don’t care about resource utilization
USER VIEW
Mobile devices like
smartphones and tables
OS helps devices to
run applications and
programs.
A mobile OS typically starts up
when a device powers on,
presenting a screen with icons
or tiles that present information
and provide application access.
Embedded OS in
devices and automobiles
DEFINING OPERATING
SYSTEMS
Term OS covers many roles
Present in toasters, Oven, smart home appliances,
ships, spacecraft, game machines, TVs and
industrial control systems
Special Purpose for military, automobile industry,
Etc.
SYSTEM VIEW
From the computer’s point of view, the
operating system is the program involved
with the hardware.
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 programs to prevent errors and
improper use of the computer
OPERATING SYSTEM
Core Part of OS
 “The one program running at all times on
the computer” is the kernel, part of the
operating system

Two types of software/program


 A system program or
 An application program, all programs
not associated with the operating system
Overview of Computer
System Structure
COMPUTER SYSTEM
ORGANIZATION
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
COMPUTER SYSTEM
ORGANIZATION
COMPUTER-SYSTEM
OPERATION
I/O devices and the CPU can execute
concurrently
Each device controller is in charge of a
particular device type
Each device controller has a local buffer
Each device controller type has an operating
system device driver to manage it
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
INTERRUPT TIMELINE
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
COMPUTER-SYSTEM
OPERATION
Device controller informs CPU that it has finished
its operation by causing an interrupt
The trap is a signal raised by a user program
instructing the operating system to perform some
functionality immediately. In contrast, the
interrupt is a signal to the CPU emitted by
hardware that indicates an event that requires
immediate attention.
A trap is generated by a user program
instruction. In contrast, the hardware devices
generate an interrupt.
A trap is also known as a software interrupt. In
contrast, an interrupt is known as a hardware
interrupt
INTERRUPT-DRIVE I/O CYCLE
TRANSFER OF CONTROL VIA
INTERRUPTS
I/O OPERATIONS
 In Programmed I/O the CPU is involved in a
constant loop & constant status checking.
CPU cannot do any thing else. However the
I/O transfer speed is quite fast
 In Interrupt driven I/O some other
functions are being done by the CPU & I/O
interpretation takes place only when an
interrupt is initiated. However in the entire
duration of data transfer active participation
of CPU is involved
 This brings us to a third transfer mode and
that is Direct Memory Access (DMA)
2
DIRECT MEMORY ACCESS
(DMA)
Direct memory access (DMA) is a method
that allows an input/output (I/O) device to
send or receive data directly to or from
the main memory, bypassing the CPU to
speed up memory operations.

3
HOW A MODERN COMPUTER
WORKS

A von Neumann architecture


Storage
Structure
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
STORAGE STRUCTURE (CONT.)
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
MEMORY
HIERARCHY
• Major constraints in memory
– Amount
– Speed
– Expense
• Faster access time, greater cost
per bit
• Greater capacity, smaller cost per
bit
• Greater capacity, slower access
speed
STORAGE-DEVICE HIERARCHY
CACHE AND MAIN
MEMORY

• Caches Contains copy of a portion of main


memory
• Processor first checks cache
– If not found, block of memory read into cache
• Because of locality of reference, likely future
MIGRATION OF
DATA
FROM DISK TO
REGISTER
Computer-System
Architecture
SINGLE PROCESSOR SYSTEMS
SYMMETRIC MULTIPROCESSING
ARCHITECTURE
MULTIPROCESSOR SYSTEMS
DUAL-CORE DESIGN
The definition of multiprocessor has evolved over
time and now includes multicore systems, in which
multiple computing cores reside on a single chip.
Multicore systems can be more efficient than
multiple chips with single cores
MULTICORE SYSTEMS
NON-UNIFORM MEMORY
ACCESS SYSTEM
NUMA, is a method of configuring a cluster of
microprocessors in a
multiprocessing system so they can share
memory locally.
CLUSTERED SYSTEMS
Clustered systems are created by two or more
individual computer systems merged together.
Basically, they have independent computer
systems with a common storage and the
systems work together.
PC MOTHERBOARD
OPERATING-SYSTEM
OPERATIONS
OPERATING-SYSTEM
OPERATIONS
OS: Provides an environment to execute
programs.
Bootstrap Program: Initializes system and loads
OS kernel.
Daemons: Background processes that provide
essential services.
Example: "systemd" on Linux starts and
manages other daemons.
Run continuously to handle tasks like logging,
scheduling, or networking.
OS waits for interrupts or events to activate
daemons or processes.
MULTIPROGRAMMED SYSTEMS

Several jobs are


kept in main
memory at the
same time, and
the CPU is
multiplexed
among them.

One job selected


and run via job
MULTITASKING
(TIMESHARING)
A logical extension of Batch systems– the
CPU switches jobs so frequently that users
can interact with each job while it is
running, creating interactive computing
If several jobs ready to run at the same
time  CPU scheduling
DUAL-MODE OPERATION
Dual-mode operation allows OS to protect
itself and other system components
User mode and kernel mode
User Mode: Limited privileges (for user
programs).
Kernel Mode: Full control (for OS tasks).
Transition: Occurs through interrupts, traps,
or system calls.
TIMER
Purpose: Ensures OS control over CPU; prevents
infinite loops.
Mechanism:
Clock & Counter: Counter decrements with
each tick.
Interrupt: Triggered when counter reaches 0.
Types:
Fixed: Constant intervals (e.g., 1/60 second).
Variable: Adjustable from 1ms to 1024ms.

You might also like