Operating Systems (CS-220) Spring 2021, FAST NUCES: Google Classroom Code: Dpjhurs
Operating Systems (CS-220) Spring 2021, FAST NUCES: Google Classroom Code: Dpjhurs
anaum.hamid@nu.edu.pk
Spring 2021 1
Course Outline
Hardware
Before mid 1
Deadlock/ Process/
Disk scheduling
Scheduling Before and
After mid2 after mid 1
Linux Scripting
C/C# programming
Memory Multithreading/
Synchronization
Before and
after mid 2 mid 2
Spring 2021 2
COURSE SUPERVISOR: ANAUM HAMID
Evaluation Instruments and Marks Distributions
• Assignments = 20 marks
• Project = 10 marks
• Midterm = 30 marks (15 for each)
• Final Term = 50 marks
• Total = 100 Marks
Spring 2021 3
COURSE SUPERVISOR: ANAUM HAMID
Course Recourses
TEXTBOOK:
• Operating Systems Concepts, 10th edition, by Abraham
Silberschatz, Peter Baer Galvin, and Greg Gagne.
REFERENCE BOOKS:
• Operating Systems – Internals and Design Principles, 8th
edition, by William Stallings.
Spring 2021 4
COURSE SUPERVISOR: ANAUM HAMID
Introduction
Road Map.
1. What is an Operating System?
2. CS structures.
3. Interrupt
4. I/O
5. Memory
6. CS Architecture
7. Clustered Systems
8. OS Structure + Operations
9. Computing Environments
FALL 2020 5
COURSE SUPERVISOR: ANAUM HAMID
Operating System: Overview
• Operating system (OS): a system software that exploits the
hardware resources to provide a set of services to system users.
• The OS manages the processor(s), memory and input/output
(I/O) devices on behalf of its users.
• Note: it is important to have some fundamental understanding of
basic data structures, computer organization and a high-level
programming language, such as C or Java, before examining
topics related to operating systems.
Spring 2021 6
COURSE SUPERVISOR: ANAUM HAMID
Operating System: Overview (Cont.)
2. Operating system
3. Application programs
4. Users
Spring 2021 8
COURSE SUPERVISOR: ANAUM HAMID
Spring 2021
Four Components
of a Computer
System
9
COURSE SUPERVISOR: ANAUM HAMID
Operating System Definition
• 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
Spring 2021 10
COURSE SUPERVISOR: ANAUM HAMID
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
Spring 2021 11
COURSE SUPERVISOR: ANAUM HAMID
• 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
Spring 2021 12
COURSE SUPERVISOR: ANAUM HAMID
Spring 2021
FALL 2020 17
COURSE SUPERVISOR: ANAUM HAMID
I/O Structure
1. After I/O starts, control returns to user program only
upon I/O completion
◦ Wait instruction idles the CPU until the next interrupt
➢ Only one interrupt is generated per block, rather than the one interrupt per
byte
Spring 2021 19
COURSE SUPERVISOR: ANAUM HAMID
Memory
Spring 2021 20
Storage Structure
1. Main memory – only large storage media that the
CPU can access directly
Spring 2021 21
COURSE SUPERVISOR: ANAUM HAMID
Storage Hierarchy
Storage systems organized in hierarchy
◦ Speed
◦ Cost
◦ Volatility
Spring 2021 22
COURSE SUPERVISOR: ANAUM HAMID
Storage-Device Hierarchy
Spring 2021 23
COURSE SUPERVISOR: ANAUM HAMID
FALL 2020 24
COURSE SUPERVISOR: ANAUM HAMID
Caching
1. Important principle, performed at many
levels in a computer (in hardware,
operating system, software).
Spring 2021 25
COURSE SUPERVISOR: ANAUM HAMID
Computing Architectures
Spring 2021 26
Computer-System Architecture
Spring 2021 27
COURSE SUPERVISOR: ANAUM HAMID
Symmetric vs. Asymmetric Multiprocessing Architecture
Spring 2021 28
COURSE SUPERVISOR: ANAUM HAMID
A Dual-Core Design
• UMA and NUMA architecture variations
• Multi-chip and multicore
Spring 2021 29
COURSE SUPERVISOR: ANAUM HAMID
Clustered Systems
Spring 2021 30
COURSE SUPERVISOR: ANAUM HAMID
Clustered Systems
Spring 2021 31
COURSE SUPERVISOR: ANAUM HAMID
Operating System
Structures + Operations
Spring 2021 32
Operating System Structure
• Multiprogramming needed for efficiency
❖ 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 it must wait (for I/O for example), OS switches to another job
• Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact
with each job while it is running, creating interactive computing
❖ Response time should be < 1 second
❖ Each user has at least one program executing in memory process
❖ If several jobs ready to run at the same time CPU scheduling
❖ If processes don’t fit in memory, swapping moves them in and out to run
Spring 2021 33
COURSE SUPERVISOR: ANAUM HAMID
Memory Layout for Multiprogram System
Spring 2021 34
COURSE SUPERVISOR: ANAUM HAMID
• Dual-mode operation allows OS to protect itself and
other system components
• User mode and kernel mode
• Mode bit provided by hardware
• Provides ability to distinguish when system is
Spring 2021 35
COURSE SUPERVISOR: ANAUM HAMID
• Timer to prevent infinite loop / process hogging
resources
• Set interrupt after specific period
• Operating system decrements counter
• When counter zero generate an interrupt
Transition • Set up before scheduling process to regain
control or terminate program that exceeds
from User to allotted time
Kernel
Mode
Spring 2021 36
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.
Spring 2021 37
COURSE SUPERVISOR: ANAUM HAMID
Process Management Activities
The operating system is responsible for the following activities in
connection with process management:
• process synchronization
• process communication
• deadlock handling
Spring 2021 38
COURSE SUPERVISOR: ANAUM HAMID
Memory Management
Spring 2021 39
COURSE SUPERVISOR: ANAUM HAMID
Storage Management
• File-System management
– Files usually organized into directories
– Access control on most systems to determine
who can access what
– OS activities include
– Free-space management
– Storage allocation
– Disk scheduling
Spring 2021 41
COURSE SUPERVISOR: ANAUM HAMID
I/O Subsystem
• I/O subsystem responsible for
– Memory management of I/O
Spring 2021 42
COURSE SUPERVISOR: ANAUM HAMID
Protection and Security
Spring 2021 43
COURSE SUPERVISOR: ANAUM HAMID
Computing Environments
Spring 2021 44
Spring 2021
• Distributed
• Collection of separate, possibly heterogeneous,
systems networked together
Computing • Network is a communications path,
Environments • Local Area Network (LAN)
-Distributed
• Wide Area Network (WAN)
45
COURSE SUPERVISOR: ANAUM HAMID
Spring 2021
Computing • Client-Server
Environments Computing
• Dumb terminals
– Client- supplanted by
smart PCs
Server • Many systems now
servers, responding
to requests
generated by clients
46
COURSE SUPERVISOR: ANAUM HAMID
Spring 2021
47
COURSE SUPERVISOR: ANAUM HAMID
Computing
Environments
– Cloud
Computing
Spring 2021 48
COURSE SUPERVISOR: ANAUM HAMID
Spring 2021
49
COURSE SUPERVISOR: ANAUM HAMID
Thank You!
Chapter 1 Completed
Spring 2021 50
COURSE SUPERVISOR: ANAUM HAMID