You are on page 1of 44

Operating System

Lecture 2

Dr. Abdalla Mostafa Abdalla


abdalla.mosta75@gmail.com

Operating System Concepts – 9th Edition 1.1 Silberschatz, Galvin and Gagne ©2013
Computer System
Management

Operating System
Structure

Operating System Concepts – 9th Edition 1.2 Silberschatz, Galvin and Gagne ©2013
Computer System
Management

Operating System
Structure

Operating System Concepts – 9th Edition 1.3 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture

Single Processor Systems

Multiprocessors systems

Clustered systems

Operating System Concepts – 9th Edition 1.4 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture
Single Processor Systems
General-purpose processor
• Most systems use a single general-purpose processor
(one process at a time)
Special-purpose processors
• Most systems have special-purpose processors as
device-specific processors
• For example, a disk-controller microprocessor
receives a sequence of requests from the main CPU and
implements its own disk queue and scheduling
algorithm.
• Also, Digital Signal Processors (DSP), Graphic
Processing Unit (GPU)
Operating System Concepts – 9th Edition 1.5 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture

Multiprocessors systems

• Also known as parallel systems, tightly-


coupled systems
• Multiprocessors advantages include:
• Increased throughput (productivity)
• Economy of usage
• Increased reliability – graceful degradation
or fault tolerance

Operating System Concepts – 9th Edition 1.6 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture

 Types of multiprocessors

Symmetric ‫متماثل‬ • each processor


Multiprocessing performs all tasks
Asymmetric • each processor is
Multiprocessing assigned a task.

Operating System Concepts – 9th Edition 1.7 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture

Multiprocessors systems

• Dual core
• Multi-core
• Blade system

Operating System Concepts – 9th Edition 1.8 Silberschatz, Galvin and Gagne ©2013
A Dual-Core Design
 A dual-core processor is a CPU with
two processors or "execution cores" in
the same integrated circuit.
Each processor has its own cache and
controller, which enables it to function
as efficiently as a single processor

Operating System Concepts – 9th Edition 1.9 Silberschatz, Galvin and Gagne ©2013
A Multi-Core Design
 A multicore processor is a single
computing component comprised
of two or more CPUs that read and
execute the actual program
instructions.
 The cores can
execute multiple instructions in
parallel, increasing the
performance of software

Operating System Concepts – 9th Edition 1.10 Silberschatz, Galvin and Gagne ©2013
Blade Servers
 Blade servers are a relatively recent development
 in which multiple processor boards, I/O boards,
and networking boards are placed in the same
chassis.
 The difference between these and traditional
multiprocessor systems is that each blade-
processor board boots independently and runs its
own operating system.
 Some blade-server boards are multiprocessor as
well, which blurs the lines between types of
computers.

Operating System Concepts – 9th Edition 1.11 Silberschatz, Galvin and Gagne ©2013
Blade Servers

Operating System Concepts – 9th Edition 1.12 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture
Clusters systems
• The clustered systems are a combination of
hardware clusters and software clusters.

• The hardware clusters help in sharing of high


performance disks between the systems.

• The software clusters makes all


the systems work together .

• Each node in the clustered systems contains


the cluster software.

Operating System Concepts – 9th Edition 1.13 Silberschatz, Galvin and Gagne ©2013
Clustered Systems

Operating System Concepts – 9th Edition 1.14 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture

Single Processor
Systems

Multiprocessors
systems

Clustered systems

Operating System Concepts – 9th Edition 1.15 Silberschatz, Galvin and Gagne ©2013
Computer System
Management

Operating System
Structure

Operating System Concepts – 9th Edition 1.16 Silberschatz, Galvin and Gagne ©2013
Operating System Structure
• Single user cannot keep CPU and I/O devices busy at
all times
Multiprogramming • Multiprogramming organizes jobs (code and data) so
(Batch system) CPU always has one to execute
needed for • A subset of total jobs in system is kept in memory
efficiency • One job selected and run via job scheduling
• When it has to wait (for I/O for example), OS switches
to another job
• 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
Timesharing memory process
(multitasking) • 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
• Virtual memory allows execution of processes not
completely in memory

Operating System Concepts – 9th Edition 1.17 Silberschatz, Galvin and Gagne ©2013
Memory Layout for Multiprogrammed System

Operating System Concepts – 9th Edition 1.18 Silberschatz, Galvin and Gagne ©2013
Operating-System Operations
 There are three main concepts

Interrupt

Dual mode

Timer

Operating System Concepts – 9th Edition 1.19 Silberschatz, Galvin and Gagne ©2013
Operating-System Operations
 Interrupt driven (hardware and software)

Hardware interrupt

• Hardware interrupt by one of the


devices as I/O

Software interrupt (exception or


trap):
• Software error (e.g., division by zero)
• Request for operating system service
• Other process problems include
infinite loop, processes modifying each
other or the operating system

Operating System Concepts – 9th Edition 1.20 Silberschatz, Galvin and Gagne ©2013
Operating-System Operations (cont.)
 We must be able to distinguish between the execution of
operating-system code and user defined code.

Dual-mode • Dual-mode operation allows OS to protect


operation itself and other system components

Dual mode • kernel mode


types • User mode
• Provides ability to distinguish when system
is running user code or kernel code
Mode bit • Some instructions designated as
provided by privileged, only executable in kernel
hardware mode
• System call changes mode to kernel,
return from call resets it to user

Operating System Concepts – 9th Edition 1.21 Silberschatz, Galvin and Gagne ©2013
Operating-System Operations (cont.)
Timer
 Timer to prevent infinite loop / process hogging resources,
take or use most or all of resources in an unfair or selfish
way
 Timer is set to interrupt the computer after some time
period
 Keep a counter that is decremented by the physical clock.
 Operating system set the counter (privileged instruction)
 When counter is zero, OS generates an interrupt
 Set up before scheduling process to regain control or
terminate program that exceeds allotted time

Operating System Concepts – 9th Edition 1.22 Silberschatz, Galvin and Gagne ©2013
Operating System

Dr. Abdalla Mostafa Abdalla


abdalla.mosta75@gmail.com

Operating System Concepts – 9th Edition 1.23 Silberschatz, Galvin and Gagne ©2013
Operating-System Resources Managment

Process management

Memory management

Storage management

Operating System Concepts – 9th Edition 1.24 Silberschatz, Galvin and Gagne ©2013
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

Operating System Concepts – 9th Edition 1.25 Silberschatz, Galvin and Gagne ©2013
Process Management Activities

The operating system is responsible for the


following activities in process management:

 Creating and deleting both user and system


processes
 Suspending and resuming processes
 Providing mechanisms for process synchronization
 Providing mechanisms for process communication
 Providing mechanisms for deadlock handling

Operating System Concepts – 9th Edition 1.26 Silberschatz, Galvin and Gagne ©2013
Memory Management

 To execute a program all (or part) of the instructions must be


in memory
 All (or part) of the data that is needed by the program must be
in memory.
 Memory management determines what is in memory and
when
 Optimizing CPU utilization and computer response to
users
 Memory management activities
 Keeping track of which parts of memory are currently
being used and by whom
 Deciding which processes (or parts thereof) and data to
move into and out of memory
 Allocating and deallocating memory space as needed

Operating System Concepts – 9th Edition 1.27 Silberschatz, Galvin and Gagne ©2013
Storage Management
 OS provides 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)

 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
 Mapping files onto secondary storage
 Backup files onto stable (non-volatile) storage media

Operating System Concepts – 9th Edition 1.28 Silberschatz, Galvin and Gagne ©2013
Mass-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
 Entire speed of computer operation depends on disk
subsystem and its algorithms (First Come First Serve
(FCFS), Shortest Seek Time First (SSTF), SCAN)
 OS activities
 Free-space management
 Storage allocation
 Disk scheduling (
 Some storage need not be fast
 storage includes optical storage, magnetic tape
 Still must be managed – by OS or applications

Operating System Concepts – 9th Edition 1.29 Silberschatz, Galvin and Gagne ©2013
Migration of data “A” from Disk to Register

Operating System Concepts – 9th Edition 1.30 Silberschatz, Galvin and Gagne ©2013
Protection and Security

 Protection – any mechanism for controlling access of processes or


users to resources defined by the OS
 Security – defense of the system against internal and external attacks
 Huge range, including denial-of-service, worms, viruses, identity
theft, theft of service
 Systems generally first distinguish among users, to determine who
can do what
 User identities (user IDs, security IDs) include name and
associated number, one per user
 User ID then associated with all files, processes of that user to
determine access control
 Group identifier (group ID) allows set of users to be defined and
controls managed, then also associated with each process, file
 Privilege allows user to change to effective ID with more rights

Operating System Concepts – 9th Edition 1.31 Silberschatz, Galvin and Gagne ©2013
Computer
Environment

Operating System Concepts – 9th Edition 1.32 Silberschatz, Galvin and Gagne ©2013
Computing Environments - Traditional

 Stand-alone general purpose machines


 But blurred as most systems interconnect
with others (i.e., the Internet)
 Portals provide web access to internal
systems
 Network computers (thin clients) are like
Web terminals
 Mobile computers interconnect via
wireless networks
 Systems use firewalls to protect computers
from Internet attacks

Operating System Concepts – 9th Edition 1.33 Silberschatz, Galvin and Gagne ©2013
Computing Environments – Mobile devices

 Handheld smartphones, tablets, etc


 Usually uses Android OS.
 Extra feature – more OS features ( like GPS)
 Leaders are Apple iOS and Google Android

 There are plenty of things laptops do that


smartphones can't, such as word
processing, software and web
development, tasks that require a ton of
multitasking, and anything that demands a
lot of processing power, a physical
keyboard, or a large screen

Operating System Concepts – 9th Edition 1.34 Silberschatz, Galvin and Gagne ©2013
Computing Environments – Distributed

 Distributed computing
 Collection of separate, possibly
heterogeneous, systems networked together
Network is a communications path, TCP/IP
protocol most common
– Local Area Network (LAN)
– Wide Area Network (WAN)
– Metropolitan Area Network (MAN)

Operating System Concepts – 9th Edition 1.35 Silberschatz, Galvin and Gagne ©2013
Computing Environments – Client-Server

 Client-Server Computing
 Dummy terminals supplanted by smart PCs
 Servers are responding to requests generated
by clients

Operating System Concepts – 9th Edition 1.36 Silberschatz, Galvin and Gagne ©2013
Computing Environments - Peer-to-Peer

 Another model of distributed system


 P2P does not distinguish clients and
servers
 Instead all nodes are considered
peers
 May each act as client, server or
both
 Node must join P2P network
 Registers its service with central
lookup service on network, or
 Broadcast request for service
and respond to requests for
service via discovery protocol

Operating System Concepts – 9th Edition 1.37 Silberschatz, Galvin and Gagne ©2013
Computing Environments - Virtualization

 Virtualization allows operating systems to run


applications within other OSes
 Vast and growing industry
 Virtualization – OS natively compiled for CPU,
running guest OSes also natively compiled
 Consider VMware running WinXP guests,
each running applications, all on native
WinXP host OS
 VMM (virtual machine Manager) provides
virtualization services

Operating System Concepts – 9th Edition 1.38 Silberschatz, Galvin and Gagne ©2013
Computing Environments - Virtualization

 Use cases involve laptops and desktops


running multiple OSes for exploration or
compatibility
 Apple laptop running Mac OS X host,
Windows as a guest
 Developing apps for multiple OSes without
having multiple systems
 Use applications without having multiple
systems
 Executing and managing compute
environments within data centers

Operating System Concepts – 9th Edition 1.39 Silberschatz, Galvin and Gagne ©2013
Computing Environments - Virtualization

Operating System Concepts – 9th Edition 1.40 Silberschatz, Galvin and Gagne ©2013
Computing Environments – Cloud Computing

 Delivers computing, storage, even apps as a service


across a network
 Logical extension of virtualization because it uses
virtualization as the base for it functionality.
 Amazon EC2 has thousands of servers, millions of
virtual machines, petabytes of storage available
across the Internet, pay based on usage

Operating System Concepts – 9th Edition 1.41 Silberschatz, Galvin and Gagne ©2013
Computing Environments – Cloud Computing

 Many types
 Public cloud – available via Internet to anyone willing to
pay
 Private cloud – run by a company for the company’s
own use
 Hybrid cloud – includes both public and private cloud
components
 Categories of cloud computing
 Software as a Service (SaaS) – one or more
applications available via the Internet (i.e., word
processor)
 Platform as a Service (PaaS) – software stack ready for
application use via the Internet (i.e., a database server)
 Infrastructure as a Service (IaaS) – servers or storage
available over Internet (i.e., storage available for backup
use)
Operating System Concepts – 9th Edition 1.42 Silberschatz, Galvin and Gagne ©2013
Computing Environments – Cloud Computing

 Cloud computing
environments composed of
traditional OSes, plus VMMs,
plus cloud management
tools
 Internet connectivity
requires security like
firewalls
 Load balancers spread
traffic across multiple
applications

Operating System Concepts – 9th Edition 1.43 Silberschatz, Galvin and Gagne ©2013
End of Chapter 2

Operating System Concepts – 9th Edit9on Silberschatz, Galvin and Gagne ©2013

You might also like