0% found this document useful (0 votes)
0 views66 pages

OS - Module 1

This document provides an overview of operating systems, detailing their functions, types, and components such as process management, memory management, and storage management. It outlines the evolution of operating systems from early generations to modern systems, including concepts like multiprogramming and distributed systems. Additionally, it discusses the goals of operating systems, user interfaces, and essential services they provide to users and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views66 pages

OS - Module 1

This document provides an overview of operating systems, detailing their functions, types, and components such as process management, memory management, and storage management. It outlines the evolution of operating systems from early generations to modern systems, including concepts like multiprogramming and distributed systems. Additionally, it discusses the goals of operating systems, user interfaces, and essential services they provide to users and applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 66

Module 1 –

Introduction to
Operating Systems
Module 1:

What operating systems do, Computer System Organization, Operating system


operations – Process Management, Memory Management, Storage Management,
I/O Systems, Protection & Security, Types of Operating Systems – Batch O.S.,
Multi programmed O.S., Time Sharing O.S., Distributed O.S., Virtualization,
Real Time Embedded Systems, Open source O.S., System calls & Overview on
Types of System calls.

Operating Systems 2
What is Operating
System ?
• An operating system is a program that manages a
computer’s hardware. It also provides a basis for
application programs and acts as an intermediary
between the computer user and the computer hardware.
• Operating system goals:
• A program that controls the execution of application
programs
• Make the computer system convenient to use.
• Use the computer hardware in an efficient manner.

Operating Systems 3
Where does the OS fit in?

• Basic Taxonomy HW SW

Applications System

OS Non-OS
• Software is differentiated according to its purpose
• System software provides a general environment where
programmers/developers can create applications and
users can run applications

Operating Systems 4
Introduction
• A computer system consists
of
• hardware
• system programs
• application programs

Operating Systems 5
System Goals
• Objectives of OS
• Convenience
• An operating system makes a computer more
convenient to use.
• Efficiency
• An operating system allows the computer system
resources to be used in an efficient manner.
• Ability to Evolve
• Should permit effective development, testing, and
introduction of new system features and functions
without interfering with service.

Operating Systems 6
Two View points
• User view
• User sits in front of PC
• User sit at a terminal connected to a mainframe
• System view
• Resource allocator
• Control program

Operating Systems 7
Abstract view of a
computer system
1. Hardware – provides basic computing resources (CPU, memory, I/O
devices).
2. Operating system – controls and coordinates the use of the
hardware among the various application programs for the various
users.
3. Applications programs – define the ways in which the system
resources are used to solve the computing problems of the users
(compilers, database systems, video games, business programs).
4. Users (people, machines, other computers).

Operating Systems 8
Abstract View of System Components

Operating Systems 9
Operating System
Definitions
• Resource allocator – manages and allocates
resources.
• Control program – controls the execution of user
programs and operations of I/O devices .
• Kernel – the one program running at all times (all else
being application programs).

Operating Systems 10
Operating System as a
resource manager
• It is actually a program that is executed by the
processor to control the processor!
• Directs the processor in the use of system resources
• Directs the processor when executing other
programs
• Processor stops executing the operating system in
order to execute other programs and, then, gives the
control back to the operating system

Operating Systems 11
Operating System as a
resource manager
• Memory management is decided by the operating
system and memory management hardware in the
processor.
• The operating system decides about the access of
programs and files to I/O devices.
• In case of multiple processors, it decides for them
all

Operating Systems 12
Operating system
timeline
• First generation: 1945 – 1955
• Vacuum tubes
• Plug boards
• Second generation: 1955 – 1965
• Transistors
• Batch systems
• Third generation: 1965 – 1980
• Integrated circuits
• Multiprogramming
• Fourth generation: 1980 – present
• Large scale integration
• Personal computers
• Next generation: ???
• Systems connected by high-speed networks?
• Wide area resource management?

Operating Systems 13
First generation: direct
input
• Run one job at a time
• Enter it into the computer (might require
rewiring!)
• Run it
• Record the results
• Problem: lots of wasted computer time!
• Computer was idle during first and last steps
• Computers were very expensive!
• Goal: make better use of an expensive commodity:
computer time

Operating Systems 14
Second generation: batch
systems

• Bring cards to 1401


• Read cards onto input tape
• Put input tape on 7094
• Perform the computation, writing results to output tape
• Put output tape on 1401, which prints output

Operating Systems 15
• Advantages of batch systems
• move much of the work of the operator to the computer
• increased performance since it was possible for job to
start as soon as the previous job finished
• Disadvantages
• turn-around time can be large from user standpoint
• more difficult to debug program
• due to lack of protection scheme, one batch job can
affect pending jobs (read too many cards, etc)
• a job could corrupt the monitor, thus affecting pending
jobs
• a job could enter an infinite loop

Operating Systems 16
Spooling
• Original batch systems used tape drives
• Later batch systems used disks for buffering
• Operator read cards onto disk attached to the computer
• Computer read jobs from disk
• Computer wrote job results to disk
• Operator directed that job results be printed from disk
• Disks enabled simultaneous peripheral operation on-line (spooling)
• Computer overlapped I/O of one job with execution of another
• Better utilization of the expensive CPU
• Still only one job active at any given time

Operating Systems 17
Third generation:
multiprogramming
• Multiple jobs in memory
• Protected from one
Job 3 another
• Operating system protected
from each job as well
Job 2 • Resources (time, hardware) split
between jobs
Memory
partitions Job 1 • Still not interactive
• User submits job
• Computer runs it
• User gets results minutes
Operating (hours, days) later
system

Operating Systems 18
Timesharing systems
• It’s a logical extension of multiprogramming.
• The CPU executes multiple jobs by switching among them
• It allows many users to share the computer simultaneously
• It uses time scheduling and multiprogramming to provide
each user with a small portion of a time shared computer.
• Its more complex than multiprogramming because jobs may
have to be swapped in and out of main memory.
• Here it comes virtual memory

Operating Systems 19
Desktop Systems
• Personal computers – computer system dedicated to a single user.
• I/O devices – keyboards, mice, display screens, small printers.
• User convenience and responsiveness.
• Can adopt technology developed for larger operating system’ often
individuals have sole use of computer and do not need advanced
CPU utilization of protection features.
• May run several different types of operating systems (Windows,
MacOS, UNIX, Linux)

Operating Systems 20
Parallel Systems
• Multiprocessor systems with more than on CPU in close
communication.
• Tightly coupled system – processors share memory and a clock;
communication usually takes place through the shared memory.
• Advantages of parallel system:
• Increased throughput
• Economical
• Increased reliability
• graceful degradation
• fail-soft systems

Operating Systems 21
Parallel Systems (Cont.)
• Symmetric multiprocessing (SMP)
• Each processor runs and identical copy of the operating
system.
• Many processes can run at once without performance
deterioration.
• Most modern operating systems support SMP
• Asymmetric multiprocessing
• Each processor is assigned a specific task; master processor
schedules and allocated work to slave processors.
• More common in extremely large systems

Operating Systems 22
Symmetric Multiprocessing
Architecture

Operating Systems 23
Distributed Systems
• Distribute the computation among several physical
processors.
• Loosely coupled system – each processor has its own local
memory; processors communicate with one another
through various communications lines, such as high-speed
buses or telephone lines.
• Advantages of distributed systems.
• Resources Sharing
• Computation speed up – load sharing
• Reliability
• Communications

Operating Systems 24
Distributed Systems
(cont.)

• Requires networking infrastructure.


• Local area networks (LAN) or Wide area networks
(WAN)
• May be either client-server or peer-to-peer
systems.

Operating Systems 25
General Structure of
Client-Server

Operating Systems 26
Handheld Systems
• Personal Digital Assistants (PDAs)
• Cellular telephones
• Issues:
• Limited memory
• Slow processors
• Small display screens.

Operating Systems 27
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
Clustered Systems
Operating System Services
• One set of operating-system services provides functions that are helpful
to the user:
• User interface - Almost all operating systems have a user interface (UI)
• Varies between Command-Line (CLI), Graphics User Interface (GUI)
• Program creation: The OS provides editors, debuggers, to assist the
programmer in creating programs.
• Program execution - A number of tasks need to be performed to execute a
program. Instructions and data must be loaded into main memory, I/O
devices and files must be initialized, and other resources must be prepared.
The OS handles these scheduling duties for the user.
• I/O operations - A running program may require I/O, which may involve a
file or an I/O device.
• File-system manipulation - The file system is of particular interest.
Obviously, programs need to read and write files and directories, create and
delete them, search them, list file Information, permission management.
Operating System Services (Cont.)
• One set of operating-system services provides functions that are helpful
to the user (Cont):
• Communications – Processes may exchange information,
on the same computer or between computers over a
network
• Communications may be via shared memory or through message
passing (packets moved by the OS)
• Error detection – OS needs to be constantly aware of
possible errors
• The OS contains routines to handle the errors in a program. When an
error is located in a user’s program the error handling routine in an OS
terminates the execution of the particular program, or may prompt the
user to correct it.
• After this, the computer system either takes up the next program for
execution or starts executing the same program after it has been
corrected by the user.
Operating System Services (Cont.)
• Another set of OS functions exists for ensuring the efficient operation of the system
itself via resource sharing
• Resource allocation - When multiple users or multiple jobs running concurrently,
resources must be allocated to each of them
• Many types of resources - Some (such as CPU cycles, main memory, and file
storage) may have special allocation code, others (such as I/O devices) may
have general request and release code.
• Accounting - To keep track of which users use how much and what kinds of
computer resources
• Protection and security - The owners of information stored in a multiuser or
networked computer system may want to control use of that information,
concurrent processes should not interfere with each other
• Protection involves ensuring that all access to system resources is controlled
• Security of the system from outsiders requires user authentication, extends
to defending external I/O devices from invalid access attempts
• If a system is to be protected and secure, precautions must be instituted
throughout it. A chain is only as strong as its weakest link.
System Components: 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 by multiplexing the CPUs among the processes / threads
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
Storage 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
• OS 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
• OS activities
• Free-space management
• Storage allocation
• Disk scheduling
• Some storage need not be fast
• Tertiary storage includes optical storage, magnetic tape
• Still must be managed – by OS or applications
• Varies between WORM (write-once, read-many-times) and RW
(read-write)
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
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 escalation allows user to change to effective ID with
more rights
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
• 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
• QA testing applications without having multiple systems
• Executing and managing compute environments within data
centers
• VMM can run natively, in which case they are also the host
• There is no general purpose host then (VMware ESX and Citrix
XenServer)
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
Real-Time Systems (Cont.)
• Hard real-time:
• Secondary storage limited or absent, data stored in short term
memory, or read-only memory (ROM)
• Conflicts with time-sharing systems, not supported by general-
purpose operating systems.

• Soft real-time
• Limited utility in industrial control of robotics
• Useful in applications (multimedia, virtual reality) requiring
advanced operating-system features.

Operating Systems 51
System Calls
• Programming interface to the services provided by the OS
• Typically written in a high-level language (C or C++)
• Mostly accessed by programs via a high-level Application
Programming Interface (API) rather than direct system call
use
• Three most common APIs are Win32 API for Windows,
POSIX API for POSIX-based systems (including virtually all
versions of UNIX, Linux, and Mac OS X), and Java API for
the Java virtual machine (JVM)

Note that the system-call names used throughout this ppt are generic
Example of System Calls
• System call sequence to copy the contents of one
file to another file
Types of System Calls
• Process control
• create process, terminate process
• end, abort
• load, execute
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
• Dump memory if error
• Debugger for determining bugs, single step execution
• Locks for managing access to shared data between
processes
Types of System Calls

• File management
• create file, delete file
• open, close file
• read, write, reposition
• get and set file attributes
• Device management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
Types of System Calls
(Cont.)
• Information maintenance
• get time or date, set time or date
• get system data, set system data
• get and set process, file, or device attributes
• Communications
• create, delete communication connection
• send, receive messages if message passing model to host
name or process name
• From client to server
• Shared-memory model create and gain access to memory
regions
• transfer status information
• attach and detach remote devices
Types of System Calls
(Cont.)
• Protection
• Control access to resources
• Get and set permissions
• Allow and deny user access
Examples of Windows and Unix System
Calls
Standard C Library Example
• C program invoking printf() library call, which calls
write() system call
Operating System
Structure
• General-purpose OS is very large program
• Various ways to structure ones
• Simple structure – MS-DOS
• More complex -- UNIX
• Layered – an abstraction
• Microkernel -Mach
Simple Structure -- MS-
DOS
• MS-DOS – written to
provide the most
functionality in the least
space
• Not divided into
modules
• Although MS-DOS has
some structure, its
interfaces and levels of
functionality are not
well separated
Non Simple Structure
-- UNIX
UNIX – limited by hardware functionality, the
original UNIX operating system had limited
structuring. The UNIX OS consists of two separable
parts
• Systems programs
• The kernel
• Consists of everything below the system-call interface and
above the physical hardware
• Provides the file system, CPU scheduling, memory
management, and other operating-system functions; a large
number of functions for one level
Traditional UNIX System
Structure
Beyond simple but not fully layered
Layered Approach

• The operating system is divided into


a number of layers (levels), each
built on top of lower layers. The
bottom layer (layer 0), is the
hardware; the highest (layer N) is
the user interface.
• With modularity, layers are selected
such that each uses functions
(operations) and services of only
lower-level layers
Microkernel System
Structure
• Moves as much from the kernel into user space
• Mach example of microkernel
• Mac OS X kernel (Darwin) partly based on Mach
• Communication takes place between user modules using message
passing
• Benefits:
• Easier to extend a microkernel
• Easier to port the operating system to new architectures
• More reliable (less code is running in kernel mode)
• More secure
• Detriments:
• Performance overhead of user space to kernel space
communication
Microkernel System
Structure

You might also like