You are on page 1of 38

Operating System Lecture # 1

Operating System Concepts – 8th Edition Silberschatz, Galvin and Gagne ©2009
Operating System Course Plane

 Course Books:
 Operating System Concepts,
7th Edition by Silberschatz, Galvin, Gagne

 Operating Systems: Internals and Design Principles


7th Edition by William Stallings

 Course Web Site :


https://sites.google.com/site/stegnopro/

Operating System Concepts – 8th Edition 1.2 Silberschatz, Galvin and Gagne ©2009
What is an Operating System?

 A program that acts as an intermediary between a user of a computer


and the computer 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 manner

Operating System Concepts – 8th Edition 1.3 Silberschatz, Galvin and Gagne ©2009
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

Operating System Concepts – 8th Edition 1.4 Silberschatz, Galvin and Gagne ©2009
Four Components of a Computer System

Operating System Concepts – 8th Edition 1.5 Silberschatz, Galvin and Gagne ©2009
Evolution of Operating Systems
 Serial processing
Machines run from a console with display lights, toggle switches, input
device
 Uni programming
Processor must wait for I/O instruction to complete before proceeding

 Multiprogramming

Operating System Concepts – 8th Edition 1.6 Silberschatz, Galvin and Gagne ©2009
Evolution of Operating Systems ..
 Multiprogramming with 3 programs

Operating System Concepts – 8th Edition 1.7 Silberschatz, Galvin and Gagne ©2009
Types of Operating Systems
 Work Stations / PC / Single User/Client
 Multiple Users/Main Frames/Servers
 Micro OS

Operating System Concepts – 8th Edition 1.8 Silberschatz, Galvin and Gagne ©2009
What Operating Systems Do
 Depends on the point of view
 Users want convenience, ease of use
 Don’t care about resource utilization(memory,ram,cpu cycles,i/o)
 But shared computer such as mainframe or minicomputer must keep all
users happy
 Users of dedicate systems such as workstations have dedicated resources
but frequently use shared resources from servers
 Handheld computers are resource poor, optimized for usability and battery
life
 Some computers have little or no user interface, such as embedded
computers in devices and automobiles

Operating System Concepts – 8th Edition 1.9 Silberschatz, Galvin and Gagne ©2009
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

Operating System Concepts – 8th Edition 1.10 Silberschatz, Galvin and Gagne ©2009
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

 CPU moves data from/to main memory to/from local buffers

 Device controller informs CPU that it has finished its operation by


causing an interrupt

Operating System Concepts – 8th Edition 1.11 Silberschatz, Galvin and Gagne ©2009
Interrupts
 Interrupts an event external to the currently executing process that causes a
change in the normal flow of instruction execution.
 An interrupt is a signal to the processor emitted by hardware or software
indicating an event that needs immediate attention.
 Ex: i/o interrupt , power button press, Alt + f4 ,key press, new program load
 Types of interrupts
1) Internal Interrupt : The Internal Interrupts are those which are occurred due to
Some Problem in the Execution For Example When a user performing any
Operation which contains any Error for example 1 / 0, reading file failure
2) External Interrupt : External Interrupt occurs when any Input and Output Device
request for any Operation and the CPU will Execute that instructions first For
Example When a Program is executed and when we move the Mouse on the
Screen then the CPU will handle this External interrupt first and after that he will
resume with his Operation.

Operating System Concepts – 8th Edition 1.12 Silberschatz, Galvin and Gagne ©2009
Sequential
Interrupt Processing

Operating System Concepts – 8th Edition 1.13 Silberschatz, Galvin and Gagne ©2009
Nested
Interrupt Processing

Operating System Concepts – 8th Edition 1.14 Silberschatz, Galvin and Gagne ©2009
More Example of
Nested Interrupts

Operating System Concepts – 8th Edition 1.15 Silberschatz, Galvin and Gagne ©2009
Direct Memory Access
 A direct memory access (DMA) is an operation in which data is copied
(transported) from one resource to another resource in a computer
system without the involvement of the CPU.
 Direct Memory Access is a capability provided by some computer bus
architectures that allows data to be sent directly from an attached
device (such as a disk drive) to the memory on the computer's
motherboard. The microprocessor is freed from involvement with the
data transfer, thus speeding up overall computer operation

Operating System Concepts – 8th Edition 1.16 Silberschatz, Galvin and Gagne ©2009
Storage Hierarchy
 Storage systems organized in hierarchy
 Speed
 Cost
 Volatility
 Volatile memory or volatile storage is computer memory that
requires power to maintain the stored information. It retains its contents
while powered, but when power is interrupted stored data is
immediately lost.
 Non Volatile memory is memory that maintains its content even
when unpowered.

Operating System Concepts – 8th Edition 1.17 Silberschatz, Galvin and Gagne ©2009
Storage-Device Hierarchy

Operating System Concepts – 8th Edition 1.18 Silberschatz, Galvin and Gagne ©2009
Storage Structure
 Register
A special, high-speed storage area within the CPU. All data must be
represented in a register before it can be processed. For example, if
two numbers are to be multiplied, both numbers must be in registers,
and the result is also placed in a register. (The register can contain the
address of a memory location where data is stored rather than the
actual data itself.)
32 bit , 64 bit OS
 Cache is memory that a computer microprocessor can access
more quickly than it can access regular RAM. As the microprocessor
processes data, it looks first in the cache memory and if it finds the
data there.

Operating System Concepts – 8th Edition 1.19 Silberschatz, Galvin and Gagne ©2009
Storage Structure …
 Main memory(RAM) is where programs and data are kept when
the processor is actively using them. When programs and data
become active, they are copied from secondary memory into main
memory where the processor can interact with them. A copy
remains in secondary memory.
 Main memory is intimately connected to the processor, so moving
instructions and data into and out of the processor is very fast.
Main memory is sometimes called RAM. RAM stands for Random
Access Memory. "Random" means that the memory cells can be
accessed in any order.
 Magnetic storage is the storage of data on a magnetized
medium. Magnetic storage uses different patterns of
magnetization in a magnetizable material to store data and is a
form of non-volatile memory. The information is accessed using
one or more read/write heads.
 Optical memory is computer memory that uses optical techniques
which generally involve an addressable laser beam.

Operating System Concepts – 8th Edition 1.20 Silberschatz, Galvin and Gagne ©2009
Performance of Various Levels of Storage

 Movement between levels of storage hierarchy can be explicit or


implicit

Operating System Concepts – 8th Edition 1.21 Silberschatz, Galvin and Gagne ©2009
How a Modern Computer Works

A von Neumann architecture

Operating System Concepts – 8th Edition 1.22 Silberschatz, Galvin and Gagne ©2009
Symmetric Multiprocessing Architecture

Operating System Concepts – 8th Edition 1.23 Silberschatz, Galvin and Gagne ©2009
A Dual-Core Design

Operating System Concepts – 8th Edition 1.24 Silberschatz, Galvin and Gagne ©2009
Clustered Systems
 Like multiprocessor systems, but multiple systems working together
 Usually sharing storage via a storage-area network (SAN)
 Provides a high-availability service which survives failures
 Asymmetric clustering has one machine in hot-standby mode
 Symmetric clustering has multiple nodes running applications,
monitoring each other
 Some clusters are for high-performance computing (HPC)
 Applications must be written to use parallel processing
Hot standby is a redundant method of having one system running
simultaneously with another identical primary system. Upon failure of the primary
system, the hot standby system immediately takes over replacing the primary
system. However, data is still mirrored in real time, thus both the systems are
assured of having identical data.
Parallel Processing parallel processing is the processing
of program instructions by dividing them among multiple processors with the
objective of running a program in less time.

Operating System Concepts – 8th Edition 1.25 Silberschatz, Galvin and Gagne ©2009
Clustered Systems

Operating System Concepts – 8th Edition 1.26 Silberschatz, Galvin and Gagne ©2009
Process

 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 is instance of a program running on a computer
 A program by itself is not a process. It is a static entity made up of program
statement while process is a dynamic entity.
 Process States
 As a process executes, it changes state. The state of a process is defined as
the current activity of the process.
 New
The process is being created.
 Ready
The process is waiting to be assigned to a processor.
 Running
Process instructions are being executed (i.e. The process that is currently being
executed).

Operating System Concepts – 8th Edition 1.27 Silberschatz, Galvin and Gagne ©2009
Process ..

 Waiting
The process is waiting for some event to occur
 Terminated
The process has finished execution.

SIMPLE QUEUE DIAGRAM

Operating System Concepts – 8th Edition 1.28 Silberschatz, Galvin and Gagne ©2009
Process Management
 Process needs resources to accomplish its task

CPU, memory, I/O, files
 Initialization data
 While the process is running it has a number of elements including
 Identifier
 State
 Priority
 Program counter
 Memory pointers
 Context data
 I/O status information
 Accounting information

Operating System Concepts – 8th Edition 1.29 Silberschatz, Galvin and Gagne ©2009
Process Management Activities
The operating system is responsible for the following activities in
connection with 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 – 8th Edition 1.30 Silberschatz, Galvin and Gagne ©2009
Distributed Computing
 A distributed computer system consists of multiple software components that are
on multiple computers, but run as a single system.
 The computers that are in a distributed system can be physically close together
and connected by a local network, or they can be geographically distant and
connected by a wide area network. A distributed system can consist of any
number of possible configurations, such as mainframes, personal computers,
workstations, minicomputers, and so on. The goal of distributed computing is to
make such a network work as a single computer.
 Distributed systems offer many benefits over centralized systems, including the
following :
• Scalability The system can easily be expanded by adding more machines as
needed.
• Redundancy Several machines can provide the same services, so if one is
unavailable, work does not stop. Additionally, because many smaller
machines can be used, this redundancy does not need to be prohibitively
expensive.

Operating System Concepts – 8th Edition 1.31 Silberschatz, Galvin and Gagne ©2009
Distributed Computing ..
 In Distributed Computing Network is a communications path
 Local Area Network (LAN)
 Wide Area Network (WAN)
 Metropolitan Area Network (MAN)
 Wireless Local Area Network (WLAN)
 Campus Area Network (CAN)
 Desk Area Network (DAN)

Operating System Concepts – 8th Edition 1.32 Silberschatz, Galvin and Gagne ©2009
Special-Purpose Systems
 Real-time embedded systems most prevalent form of computers
 Vary considerable, special purpose, limited purpose OS, real-time OS
 Multimedia systems
 Streams of data must be delivered according to time restrictions
 Handheld systems
 PDAs, smart phones, limited CPU, memory, power
 Reduced feature set OS, limited I/O

Operating System Concepts – 8th Edition 1.33 Silberschatz, Galvin and Gagne ©2009
Peer-to-Peer Computing
 A peer-to-peer (P2P) network is a type of decentralized and distributed
network architecture in which individual nodes in the network (called
"peers") act as both suppliers and consumers of resources.
 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
 Examples include Napster and Gnutella

Operating System Concepts – 8th Edition 1.34 Silberschatz, Galvin and Gagne ©2009
Web-Based Computing
 Web has become ubiquitous

 More devices becoming networked to allow web access

 New category of devices to manage web traffic among similar servers:

 Use of operating systems like Windows 95, client-side, have evolved


into Linux and Windows XP, which can be clients and servers

Operating System Concepts – 8th Edition 1.35 Silberschatz, Galvin and Gagne ©2009
Computing Environments
 Traditional computer
 Office environment
 PCs connected to a network, terminals attached to
mainframe or minicomputers providing batch and
timesharing
 Now portals allowing networked and remote systems
access to same resources
 Home networks
 Used to be single system, then modems
 Now firewalled, networked

Operating System Concepts – 8th Edition 1.36 Silberschatz, Galvin and Gagne ©2009
Computing Environments (Cont.)
 Client-Server Computing
 Dumb terminals supplanted by smart PCs
 Many systems now servers, responding to requests generated
by clients
 Compute-server provides an interface to client to request
services (i.e., database)
 File-server provides interface for clients to store and
retrieve files

Operating System Concepts – 8th Edition 1.37 Silberschatz, Galvin and Gagne ©2009
Open-Source Operating Systems
 Operating systems made available in source-code format rather than
just binary closed-source

 Counter to the copy protection and Digital Rights Management


(DRM)

 Started by Free Software Foundation (FSF), which has “copyleft”


GNU Public License (GPL)

 Examples include GNU/Linux and BSD UNIX (including core of Mac


OS X), and many more

Operating System Concepts – 8th Edition 1.38 Silberschatz, Galvin and Gagne ©2009

You might also like