Operating System Overview
Introduction
Operating System Concepts by Silberschatz, Galvin, and Gagne
Content
What is an Operating System?
Operating system functions
Operating-System Structure
Operating-System Operations
Computing Environments
Open-Source Operating Systems
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
Four Components of a Computer System
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
What Operating Systems Do?
Computer system is divided into four components
Hardware
CPU
Memory
I/O Devices
User View
Users want convenience, ease of use and good performance
System View
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
What is an Operating System?
A program that acts as an agent between a user of a
computer and the computer hardware. The purpose of an
operating system is to provide a platform on which a user
can execute programs conveniently and efficiently.
Operating system goals: (ECE)
Efficiency: Use the computer hardware in an efficient
manner
Convenience: Make the computer system convenient to
use
Execute: solving user problems easier through user
programs
Note: The main goal of the Operating System is to make the
computer environment more convenient to use and the
Secondary goal is to use the resources most efficiently.
Why are Operating Systems Used?
Operating System handles the following responsibilities:
It controls all the computer resources.
It provides valuable services to user programs.
It coordinates the execution of user programs.
It provides resources for user programs.
It provides an interface (virtual machine) to the user.
It hides the complexity of software.
It supports multiple execution modes.
It monitors the execution of user programs to prevent errors.
Operating system functions
Memory Management: The operating system manages the
Primary Memory or Main Memory
Processor Management
Device Management
File Management
User Interface or Command Interpreter
Booting the Computer
Security
Operating system functions cont.
Services Provided by an Operating System
Program Execution
Handling Input/Output Operations
Manipulation of File System
Error Detection and Handling
Resource Allocation
Accounting
Information and Resource Protection
System Services
Operating-System Structure
A Single program OS
Multiprogramming OS
Time-sharing or Multitasking: Interactive computer system
Job Scheduling/CPU Scheduling
Storage Structure
Main memory – only large storage media that the CPU can
access directly
Random access
Typically volatile
Secondary storage – extension of main memory that
provides large nonvolatile storage capacity
Hard disks – 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
Storage Hierarchy
Storage systems organized in hierarchy
Speed
Cost
Volatility
Storage-Device Hierarchy
Computer-System Architecture
Most systems use a single general-purpose processor
Most systems have special-purpose processors as well
Multiprocessors systems growing in use and importance
Also known as parallel systems, tightly-coupled systems
Advantages include:
1. Increased throughput
2. Economy of scale
3. Increased reliability – graceful degradation or fault tolerance
Two types:
1. Asymmetric Multiprocessing – each processor is assigned
a specie task.
2. Symmetric Multiprocessing – each processor performs all
tasks
Symmetric Multiprocessing Architecture
A Dual-Core Design
Multi-chip and multicore
Systems containing all chips
Chassis containing multiple separate systems
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 parallelization
Some have distributed lock manager (DLM) to avoid
conflicting operations
Clustered Systems
Clustered Operating Systems work similarly to Parallel Operating Systems
as they have many CPUs. Cluster systems are created when two or more
computer systems are merged. Basically, they have an independent
computer but have common storage and the systems work together.
The components of clusters are usually connected using fast area networks,
with each node running its own instance of an operating system.
Operating System Structure
Multiprogramming (Batch system) needed for efficiency
Single user cannot keep CPU and I/O devices busy at all times
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 has to 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
Virtual memory allows execution of processes not completely in
memory
Memory Layout for Multiprogrammed System
Operating-System Operations
Interrupt driven (hardware and software)
Hardware interrupt by one of the devices
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 Operations (cont.)
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
running user code or kernel code
Some instructions designated as privileged, only
executable in kernel mode
System call changes mode to kernel, return from
call resets it to user
Increasingly CPUs support multi-mode operations
i.e. virtual machine manager (VMM) mode for guest
VMs
Transition from User to Kernel Mode
Timer to prevent infinite loop / process hogging resources
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 zero generate an interrupt
Set up before scheduling process to regain control or terminate
program that exceeds allotted time
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
Networking becoming ubiquitous – even home systems use
firewalls to protect home computers from Internet attacks
Computing Environments - Mobile
Handheld smartphones, tablets, etc
What is the functional difference between them and a
“traditional” laptop?
Extra feature – more OS features (GPS, gyroscope)
Allows new types of apps like augmented reality
Use IEEE 802.11 wireless, or cellular data networks for
connectivity
Leaders are Apple iOS and Google Android
Computing Environments – Distributed
Distributed computing
Collection of separate, possibly heterogeneous, systems
networked together
Network is a communications path, TCP/IP most
common
– Local Area Network (LAN)
– Wide Area Network (WAN)
– Metropolitan Area Network (MAN)
– Personal Area Network (PAN)
Network Operating System provides features between
systems across network
Communication scheme allows systems to exchange
messages
Illusion of a single system
Computing Environments – Client-Server
Client-Server Computing
Dumb terminals supplanted by smart PCs
Many systems now servers, responding to requests
generated by clients
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
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
Examples include Napster and
Gnutella, Voice over IP (VoIP) such as
Skype
Computing Environments - Virtualization
Allows operating systems to run applications within other
OSes
Vast and growing industry
Emulation used when source CPU type different from target
type (i.e. PowerPC to Intel x86)
Generally slowest method
When computer language not compiled to native code –
Interpretation
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
Computing Environments - Virtualization
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
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
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)
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
Computing Environments – Real-Time Embedded
Systems
Real-time embedded systems most prevalent form of
computers
Vary considerable, special purpose, limited purpose OS,
real-time OS
Use expanding
Many other special computing environments as well
Some have OSes, some perform tasks without an OS
Real-time OS has well-defined fixed time constraints
Processing must be done within constraint
Correct operation only if constraints met
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) movement
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
Solaris a commercial UNIX based OS of Sun Microsystems.