OPERATING SYSTEM
INTRODUCTION
(Part-I)
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
Abstract View of Components of Computer
Operating System Definition
• No universally accepted definition
• “Everything a vendor ships when you order an
operating system” is a good approximation
– But varies wildly
• “The one program running at all times on the
computer” is the kernel, part of the operating system
• Everything else is either
– A system program (ships with the operating system, but
not part of the kernel) , or
– An application program, all programs not associated
with the operating 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
Storage-Device Hierarchy
How a Modern Computer Works
A von Neumann
architecture
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
– Concurrency
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
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
File-system Management
• OS provides uniform, 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
– File-system Management activities include
• Creating and deleting files and directories
• Primitives to manipulate files and directories
• Mapping files onto secondary storage
• Backup files onto stable (non-volatile) storage media
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
• Proper management is of central importance
• Entire speed of computer operation hinges on
disk subsystem and its algorithms
• Mass-Storage Management Activities:
– Mounting and unmounting
– Free-space management
– Storage allocation
– Disk scheduling
– Partitioning
– Protection
Characteristics of Various Types of Storage
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
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
specific task.
2. Symmetric Multiprocessing – each processor performs all tasks
Symmetric Multiprocessing Architecture
Dual-Core Design
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
• Symmetric clustering
– 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
Computing Environments
• Traditional
• Mobile
• Client Server
• Pear-to-Pear
• Cloud computing
• Real-time Embedded
Traditional
• Stand-alone general-purpose machines
• 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
Mobile
• Handheld smartphones, tablets, etc.
• What is the functional difference between
them and a “traditional” laptop?
• Extra features – more OS features (GPS,
gyroscope)
• Allows new types of apps
• Use IEEE 802.11 wireless, or cellular data
networks for connectivity
• Leaders are Apple iOS and Google Android
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
File-server system provides interface for clients to store and
retrieve files
Peer-to-Peer
• Another model of distributed
system
• P2P does not distinguish clients and
servers
– Instead all nodes are considered peers
– Each may act as client, server or both
– Examples include Napster and Gnutella,
Voice over IP (VoIP)
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 its
functionality.
– Amazon EC2 has thousands of servers, millions of
virtual machines, petabytes of storage available
across the Internet, pay based on usage
Cloud Computing (Cont.)
• 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)
Real-Time Embedded Systems
• Special purpose, limited purpose OS, real-time OS
• 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
Free and Open-Source Operating Systems
• Operating systems made available in source-code format rather than
just binary closed-source and proprietary
• Counter to the copy protection and Digital Rights Management
(DRM) movement
• Started by Free Software Foundation (FSF), which has “copyleft”
GNU Public License (GPL)
– Free software and open-source software are two different ideas
championed by different groups of people
• Examples include GNU/Linux and BSD UNIX (including core of Mac
OS X), and many more
Reference: Operating System Concepts, Abraham Silberschatz,
Peter Baer Galvin, Greg Gagne, Wiley Publications
Slides downloaded from: https://codex.cs.yale.edu/avi/os-
book/OSE2/slide-dir/index.html