Lec1 Introduction
Lec1 Introduction
Punsisi Pemarathne
1
Introduction
Lecture 1
2
Outline
• Operating System Definition
• Computer-System Organization, Architecture, Structure and Operations
• Process Management
• Memory Management
• Storage Management
• Protection and Security
• Distributed Systems
• Special-Purpose Systems
• Computing Environments
3
Computer System Structure
Computer system divided into four components.
5
Operating System
User View
• Execute user programs and solve user problems.
• Make the computer system convenient to use.
• Use the computer hardware in an efficient manner.
System View
– OS is a resource allocator : Manages all resources and 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.
6
Operating System Definition
7
Computer System Organization
• 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.
8
Computer System Operation
Computer Startup
– Bootstrap program is loaded at power-up or reboot.
– Typically stored in ROM or EEPROM, generally known as
firmware.
– Initializes all aspects of system.
– Loads operating system kernel and starts execution.
9
Computer System Operation Cont.
• I/O devices and the CPU can execute concurrently.
• Each device controller is in charge of a particular device type and
has a local buffer.
• 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.
10
Common Functions of Interrupts
• Interrupt transfers control to the Interrupt Service Routine (ISR), through the
Interrupt Vector (IV), which contains the addresses of all the service routines.
• Interrupt architecture must save the address of the interrupted instruction.
• Incoming interrupts are disabled while another
interrupt is being processed to prevent a lost interrupt.
• A trap is a software-generated interrupt caused either by an error or a user
request.
• An operating system is interrupt driven.
11
Direct Memory Access Structure
• Only one interrupt is generated per block, rather than the one
interrupt per byte.
12
Storage Structure
• Main Memory : only large storage media that CPU can access directly.
• Secondary Storage : extension of main memory that provides large nonvolatile
storage capacity.
• Magnetic Disks : rigid metal or glass platters covered with magnetic recording
material
13
Storage Hierarchy
14
Modern Computer System
Direct Memory Access
• Used for high-speed I/O devices able to transmit information at close to
memory speeds.
• Device controller transfers blocks of data from buffer storage directly to main
memory without CPU intervention.
• Only on interrupt is generated per block
15
Computer-System Architecture
16
Computer-System Architecture Cont.
Multiprocessors systems ( Parallel systems / tightly-coupled systems)
• Asymmetric Multiprocessing (Each processor is assigned a specific task) and
Symmetric Multiprocessing (Each processor performs all tasks within the OS)
• Advantages:
High throughput
Economy of scale
High reliability
17
Symmetric Multiprocessing Architecture
18
A Dual-Core Design
19
Computer-System Architecture Cont.
Clustered Systems
• Like multiprocessor systems, but multiple systems working together
• Usually sharing storage via a storage-area network (SAN)
• Provides a high-availability service in failures
20
Operating System Structure
Multiprogramming
– Needed for efficiency
– One user cannot keep CPU and I/O devices busy at all times
– A subset of total jobs in system is kept in memory and One job selected and
run via job scheduling
– When it has to wait for I/O, OS switches to another job, so CPU always has
one to execute
21
Operating System Structure Cont.
Timesharing (Multitasking)
• A logical extension in which CPU switches jobs so frequently that users can interact with
each job while it is running, creating interactive computing and 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
• Virtual memory allows execution
of processes not completely in
memory
22
Memory Layout for Multiprogrammed System
23
Operating-System Operations
25
Process Management
• A process is a program in execution
• Program is a passive entity, process is an active entity.
• Process needs resources to accomplish its task : CPU, memory, I/O, files and
Initialization data
• Process termination requires reclaim of any reusable resources
Process executes instructions sequentially, one at a time, until completion
• Single-threaded process has one program counter specifying location of next
instruction to execute and Multi-threaded process has one program counter per
thread
26
Process Management Cont.
• Typically system has many processes, running concurrently on one or more
CPUs
• Process management activities:
– 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
27
Memory Management
• All data should be in memory before and after processing
• All instructions should be in memory in order to execute
• Memory management determines what is in memory when to optimize CPU
utilization and computer response to users
• Memory management activities :
– Keep track of which parts of memory are currently being
used and by whom
– Decide which processes and data to move into and out of memory
– Allocating and de allocating memory space as needed
28
Storage Management
File-System management
– Files usually organized into directories
– Access control on most systems to determine who can access what
– File-System management activities :
30
Storage Management Cont.
Caching
• Information in use, is copied from slower to faster storage temporarily
• Cache storage is checked first to determine if information is there
– If it is there, information used directly from the cache (fast)
– If not, data will be copied to cache and will be used from cache
31
Performance of Various Levels of Storage
32
I/O Subsystem
• One purpose of OS is to hide peculiarities of
hardware devices from the user
• I/O subsystem responsible for
– Memory management of I/O including buffering (storing data temporarily
while it is being transferred), caching (storing parts of data in faster storage
for performance), spooling (the overlapping of output of one job with input
of other jobs)
– General device-driver interface
– Drivers for specific hardware devices
33
Protection and Security
• Protection – Mechanisms for controlling access
of processes or users to resources defined by the OS
• Security – defense of the system against internal and external attacks
• Systems generally first distinguish users, to determine who can do what
– User identities (user IDs, security IDs) associated with all files, processes of that
user to determine access control
– Group identifier (group ID) allows set of users to be defined and managed, then also
associated with each process, file
– Privilege escalation allows user to change effective ID with more rights
34
Special Purpose Systems
Real-Time Systems
• Often used as a control device in a dedicated applications such as controlling
scientific experiments, medical imaging systems, industrial control systems,
and display systems
• Well-defined fixed-time constraints
• Hard real-time and Soft real-time systems
Handheld Systems
• Personal Digital Assistants (PDAs) and Cellular telephones
• Limited memory, Slow processors and Small display screens
35
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
36
Computing Environments Cont.
Client-Server Computing
• Compute-server system provides an interface to client to request services
(i.e. database)
• File-server system provides interface for clients to store and retrieve files
37
Computing Environments Cont.
Peer-to-Peer Computing
• P2P does not distinguish clients and servers
• Instead all nodes are considered peers
• May each node act as a 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
38
Thank You………………….
39