0% found this document useful (0 votes)
7 views

ch01 -m- Introduction

The document provides an overview of operating systems, defining them as intermediaries between users and computer hardware while outlining their goals and components. It discusses various operating system types, including batch systems, multiprogramming, time-sharing, and distributed systems, along with their features and functionalities. Additionally, it covers system organization, resource management, and the evolution of operating systems over time.

Uploaded by

Zeynep Bayram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

ch01 -m- Introduction

The document provides an overview of operating systems, defining them as intermediaries between users and computer hardware while outlining their goals and components. It discusses various operating system types, including batch systems, multiprogramming, time-sharing, and distributed systems, along with their features and functionalities. Additionally, it covers system organization, resource management, and the evolution of operating systems over time.

Uploaded by

Zeynep Bayram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 56

Chapter 1: Introduction

Operating System Concepts – 10th Edition Silberschatz, Galvin and Gagne ©2018
What is an Operating System?

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


computer and the computer hardware (manages computer’s
hardware).
 Provides an environment in which a user can execute programs
 It is an interface between user and hardware, between
application program and hardware and between two programs.
 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 – 10th Edition 2.2 Silberschatz, Galvin and Gagne ©2018
Computer System Components

 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 – 10th Edition 2.3 Silberschatz, Galvin and Gagne ©2018
Abstract View of System Components

Operating System Concepts – 10th Edition 2.4 Silberschatz, Galvin and Gagne ©2018
Operating System Definitions
 OS is a resource allocator
 Manages and allocates all resources (CPU time, memory space,
file-storage space, I/O devices, etc.)
 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 (control operations of I/O devices)
 Parts of the OS
 The one program running at all times on the computer is the
kernel.
 Shell – Operating systems such as Windows and Unix include a
command interpreter as a special program. It is an interface
between user and the kernel which can also be used to start an
application program. GUI is an alternative interface for the OS.
 Everything else is
 either a system program (ships with the operating system),
 or an application program.

Operating System Concepts – 10th Edition 2.5 Silberschatz, Galvin and Gagne ©2018
Kernel Services

 I/O Management
 Process Management
 Memory Management
 File Systems Management
 Device Drivers Management
 System Calls (Application Program Interface)
 Interprocess Communication
 Protection System
 Networking

Operating System Concepts Silberschatz, Galvin and Gagne ©2018


Operating System Concepts – 10th Edition 2.6
Computer Startup

 Small piece of code – bootstrap program is loaded at power-


up or reboot

 Typically stored in ROM or EEPROM (electrically erasable


programmable ROM), generally known as firmware

 Initializes all aspects of system

 Loads operating system kernel and starts execution

Operating System Concepts – 10th Edition 2.7 Silberschatz, Galvin and Gagne ©2018
Computer System Organization
 A modern general purpose computer-system consists of
 One or more CPUs and device controllers (disk controller,
USB controller, etc.) are connected through common bus
providing access between components and shared memory
 CPU and the device controllers can execute in parallel (i.e.
concurrently)
 Memory controller synchronizes access to the memory to
ensure orderly accessing

memory controller

Operating System Concepts – 10th Edition 2.8 Silberschatz, Galvin and Gagne ©2018
Computer System Organization

 The device controller is responsible for moving the data between the
peripheral devices that it controls and its local buffer storage.

 Device Drivers are software modules that can be plugged into an


OS to handle a particular device. Operating System takes help from
device drivers to handle all I/O devices. In other words, device driver
understands the device controller and provides the rest of the
operating system with a uniform interface to the device.

Operating System Concepts – 10th Edition 2.9 Silberschatz, Galvin and Gagne ©2018
Computer System Operation
 The occurrence of an event is usually signaled by an interrupt from
either the hardware or the software.
 Hardware may trigger an interrupt at any time by sending a signal to
the CPU, usually by way of the system bus. When the CPU is
interrupted, it stops what it is doing and immediately transfers
execution to the address where the service routine for the interrupt
is located.
 Software may trigger an interrupt by executing a special operation
called a system call

Operating System Concepts – 10th Edition 2.10 Silberschatz, Galvin and Gagne ©2018
Simple Batch Systems (1960’s)

 A fairly simple operating system was


used. An operator other than user
was also used.
 A card reader was employed as the
input device. CPU is generally idle
due to low speeds of mechanical I/O
devices compared to those of
electronic ones (e.g. slow punch
card reader).
 Processing speed is increased by
batching similar jobs together and
run them as a group. In other words,
manual intervention by the operator
is reduced.
 In processing each batch, automatic
job sequencing allows transfer of
control from one job to another.
Operating System Concepts – 10th Edition 2.11 Silberschatz, Galvin and Gagne ©2018
Simple Batch Systems (1960’s)

Operating System Concepts – 10th Edition 2.12 Silberschatz, Galvin and Gagne ©2018
Multiprogrammed Batch Systems (1970’s)

 Several jobs are kept in main


memory at the same time which is
known as job pool.

 The operating system picks one


job from memory to execute.

 When a job has to wait, operating


system switches to another job.

 Eventually, the first job finishes


waiting and gets the CPU back.

Operating System Concepts – 10th Edition 2.13 Silberschatz, Galvin and Gagne ©2018
Spooling
 Spooling: Simultaneous Peripheral Operation on-line is another major feature
of multiprogramming operating systems
 Jobs are not read directly into memory but onto the disk. Since reading is time
consuming, some other jobs can be performed during reading.
 Overlap I/O of one job with computation of another job. While executing one
job,
 Next job can be read from card reader into a storage area
 Print the output of previous job from disk to printer
 The main goal is reduce CPU idle time since I/O speed is slower than CPU
speed
 By using spooling technique, a printer could be used by users without waiting

Operating System Concepts – 10th Edition 2.14 Silberschatz, Galvin and Gagne ©2018
OS Features Needed for Multiprogramming
A single user cannot keep CPU and I/O devices busy at all times. In
multiprogramming systems there are several jobs in memory at the same
time. They organize jobs (code and data) so that CPU always has one to
execute. One job selected and run via job scheduling. When it has to wait
(for I/O for example), OS switches to another job. In order to accomplish
these, some features are needed:

 Memory management – the system must allocate/deallocate the


memory to several jobs and keep track of memory use.
 Process management – Scheduling, creating, deleting, synchronization
of processes, process communication and deadlock handling
 Storage management - including mass-storage (e.g. Free-space
management, storage allocation, disc scheduling) and file-system
management (e.g. Create/delete files, directories etc).
 Protection and Security – controlling the access of processes to the
resources.

Operating System Concepts – 10th Edition 2.15 Silberschatz, Galvin and Gagne ©2018
Time-Sharing (multitasking) Systems-Interactive Computing

 A time-shared OS uses CPU scheduling and multiprogramming that


provides each user a small portion of time.
 The CPU is multiplexed among several jobs that are kept in memory
and on disk (the CPU is allocated to a job only if the job is in memory).
 The CPU is switched among multiple jobs so frequently that the users
may interact with each program during execution.
 Jobs are swapped in and out of memory to the disk to modify the
degree of multiprogramming.
 On-line communication between the user and the system is provided
 Time-sharing also compensates for low-speed I/O operations such as
low-speed keyboard typing.
 A time-shared operating system allows many users to share the
computer simultaneously.

Note: A program loaded into memory and executing is called a process


(will be explained later).

Operating System Concepts – 10th Edition 2.16 Silberschatz, Galvin and Gagne ©2018
Parallel or Multiprocessor Systems

 Multiprocessor systems have more than one CPU in close


communication.
 Tightly coupled system – processors share memory and other
resources; communication usually takes place through the
shared memory.
 Advantages of parallel system:
 Increased throughput: More work is done in the same time
period. Increasing processors by n does not mean
decreasing operation time by n.
 Economical: Shared peripherals and power supplies. Several
programs can be run on same set of data on a shared disk
 Increased reliability

The failure of one processor does not halt the system (also
known as fault tolerance). The rest continues to do the
task. The ability to continue providing service proportional
to the level of surviving hardware is called graceful
degradation.

Operating System Concepts – 10th Edition 2.17 Silberschatz, Galvin and Gagne ©2018
Multiprocessor Systems

The multiple-processor systems are organized in two different ways:

 Asymmetric multiprocessing
 Each processor is assigned a specific task; master or boss
processor schedules and allocates work to slave or worker
processors.
 More common in extremely large systems

 Symmetric multiprocessing (SMP)


 Each processor performs all tasks within the operating
system
 All proccesors are peers, no mater-slave reationship
 Most modern operating systems support SMP

Operating System Concepts – 10th Edition 2.18 Silberschatz, Galvin and Gagne ©2018
Symmetric Multiprocessing Architecture
A typical SMP architecture. Notice that each processor has its own set
of registers, as well as a private—or local—cache. However, all
processors share physical memory.

The difference between symmetric and asymmetric multiprocessing


may result from either hardware or software. Special hardware can
differentiate the multiple processors, or the software can be written to
allow only one boss and multiple workers.
Operating System Concepts – 10th Edition 2.19 Silberschatz, Galvin and Gagne ©2018
A Dual-Core Design
 Multiple computing cores on a single chip – multicore

 More efficient than multiple chips with single core because on-
chip communication is faster than between-chip communication

 Figure shows dual-core design with two cores on the same chip

Operating System Concepts – 10th Edition 2.20 Silberschatz, Galvin and Gagne ©2018
Distributed Systems
 A collection of physically separate, possibly heterogeneous,
computer systems that are networked to provide users with access
to the various resources that the system maintains.
 Distribute the computation among several physical processors
referred to as sites, nodes, computers etc.
 Unlike tightly-coupled parallel systems, these are loosely coupled
systems
 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 (printers, files etc.)
 Computation speed up – load sharing
 Reliability
 Communications – information exchange

Operating System Concepts – 10th Edition 2.21 Silberschatz, Galvin and Gagne ©2018
Distributed Systems
 Collection of separate, possibly heterogeneous systems require
a networking structure

 Network is a communication path between two or more


systems, TCP/IP most common network protocol
 Personal Area Network (PAN)
 between a phone and a headset or a smartphone and a
desktop computer
 Local Area Network (LAN)
 connects computers within a room, a building, or a
campus.
 Metropolitan Area Network (MAN)
 link buildings within a city.
 Wide Area Network (WAN)
 usually links buildings, cities, or countries.

Operating System Concepts – 10th Edition 2.22 Silberschatz, Galvin and Gagne ©2018
Distributed Systems
 Networking support is necessary in distributed systems.
Network Operating System is a computer operating system
that facilitates to connect and communicate various autonomous
computers over a network. Provide features such as file sharing
across the network, along with a communication scheme that
allow
 Different processes on different computers to exchange
messages.
 The different computers communicate closely enough to
provide the illusion that only a single operating system
controls the network

 Microsoft Windows Server, UNIX/Linux are historical examples


of network operating systems
 Currently, all general-purpose operating systems, and even
embedded operating systems such as Android and iOS, are
network operating systems.

Operating System Concepts – 10th Edition 2.23 Silberschatz, Galvin and Gagne ©2018
Distributed Computing Environments

 Client-Server computing is model of distributed systems.


Many systems now servers, responding to requests
generated by clients
 Compute-server system provides an interface to which a
client may send a request to perform an action (e.g. run a
database)
 File-server system provides interface for clients to store
and retrieve files

Operating System Concepts – 10th Edition 2.24 Silberschatz, Galvin and Gagne ©2018
Distributed Computing Environments
 Peer-to-Peer Computing is another model of
distributed systems
 P2P does not distinguish clients and servers
 All nodes are considered as peers
 Each may 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, that
allow users to exchange files. Voice over IP
(VoIP) used by Skype allows clients to make
voice calls and video calls and to send text
messages over the Internet.

Operating System Concepts – 10th Edition 2.25 Silberschatz, Galvin and Gagne ©2018
Cloud Computing Systems

 Cloud computing is a
type of computing that
delivers computing,
storage, and even
applications as a service
across a network.
 Public clouds are
available via the Internet
to anyone willing to pay
for the services
 Cloud computing
environments are
composed of traditional
OS’s, plus cloud
management tools

Operating System Concepts – 10th Edition 2.26 Silberschatz, Galvin and Gagne ©2018
Real-Time Embedded Systems
 Special-purpose systems that are often used as a control
device in a dedicated application such as controlling
scientific experiments, medical imaging systems, industrial
control systems, and some display systems (car engines,
manufacturing robots, DVDs, microwave ovens,
firewalls,etc.)
 Embedded systems run real-time operating systems.
Generally there is no user interface. They perform managing
and monitoring of the hardware.
 Real-time OS has well-defined fixed time constraints
 Processing must be done within the defined constraint.
Data brought by sensors to the computer, must be
analyzed and corresponding control adjustments must be
done in a small time interval
 Correct operation only if constraints met
Operating System Concepts – 10th Edition 2.27 Silberschatz, Galvin and Gagne ©2018
Personal Computer Systems

 Personal computers – computer system dedicated to a single


user.
 I/O devices – keyboards, mice, display screens, small printers.
 Can adopt technology developed for larger operating system.
 May run several different types of operating systems (Windows,
MacOS, UNIX, Linux)
 Client PCs, printers, servers

Operating System Concepts – 10th Edition 2.28 Silberschatz, Galvin and Gagne ©2018
Mobile Systems

 Personal Digital Assistants (PDAs)


 Handheld smartphones, tablets, etc
 Use IEEE 802.11 wireless, or cellular data networks for
connectivity
 Leaders are Apple iOS and Google Android
 Issues:
 Limited memory
 Slow processors
 Small display screens.

Operating System Concepts – 10th Edition 2.29 Silberschatz, Galvin and Gagne ©2018
History of Operating Systems
First Generation: Fourth Generation:
*1945-1955 *1980-present
*Vacuum Tubes *Large scale integration
*OS: Plugboards *Personal computers
*OS: personal systems
Second Generation:
*1955-1965
Next Generation:
*Transistors
*????
*OS: Batch Systems
*System connected to high
speed networks
Third Generation: *Wide area resource control
*1965-1980 *OS: net-centric computing,
*Integrated circuits embedded systems.
*OS: Multiprogramming

Operating System Concepts – 10th Edition 2.30 Silberschatz, Galvin and Gagne ©2018
Storage Structure
 Main memory (primary storage, RAM) – only large storage media that the
CPU can access directly (so any programs must first be loaded into
memory to run).
 Random access
 Typically volatile (it loses its contents when power is turned off or otherwise
lost)
 Disks (secondary storage) – extension of main memory that provides
large nonvolatile storage capacity
 Secondary storage is also much slower than main memory.
 Hard disks – rigid metal or glass platters covered with magnetic
recording material (Hard Disk Drives-HDDs)
 Solid-state disks (SSDs)– faster than hard disks, nonvolatile
 Various technologies
 Becoming more popular
 Optical disks, mahnetic tapes (tertiary storage) They are slow enough
and large enough and used only for special purposes (to store backup
copies of material).

Operating System Concepts – 10th Edition 2.31 Silberschatz, Galvin and Gagne ©2018
Storage Structure (cont.)
Notes:
 The programs must be in the main memory to be executed.
 CPU automatically loads instruction from main memory for
execution
 Main memory is an array of words or bytes ranging in size. Each
word has it own size.
 Secondary storage provides storage for programs and data
 Most programs (web browsers, compilers, word processors) are
stored on the disk until they are loaded into memory.
 Instruction-execution cycle: fetch the instruction from memory,
decode instruction, execute instruction, store instruction back in
memory.

Operating System Concepts – 10th Edition 2.32 Silberschatz, Galvin and Gagne ©2018
Storage Definitions and Notation Review
The basic unit of computer storage is the bit. A bit can contain one of two values, 0 and 1. All
other storage in a computer is based on collections of bits. Given enough bits, it is amazing
how many things a computer can represent: numbers, letters, images, movies, sounds,
documents, and programs, to name a few.
A byte is 8 bits, and on most computers it is the smallest convenient chunk of storage. For
example, most computers don’t have an instruction to move a bit but do have one to move a
byte.
A less common term is word, which is a given computer architecture’s native unit of data. A
word is made up of one or more bytes. For example, a computer that has 64-bit registers
and 64-bit memory addressing typically has 64-bit (8-byte) words. A computer executes many
operations in its native word size rather than a byte at a time.

Computer storage, along with most computer throughput, is generally measured and
manipulated in bytes and collections of bytes.
A kilobyte, or KB, is 1,024 bytes
a megabyte, or MB, is 1,0242 bytes
a gigabyte, or GB, is 1,0243 bytes
a terabyte, or TB, is 1,0244 bytes
a petabyte, or PB, is 1,0245 bytes

Computer manufacturers often round off these numbers and say that a megabyte is 1 million
bytes and a gigabyte is 1 billion bytes.
Networking measurements are an exception to this general rule; they are given in bits
e.g. 1 Kbps (because networks move data a bit at a time).
Operating System Concepts – 10th Edition 2.33 Silberschatz, Galvin and Gagne ©2018
Metric Units

Operating System Concepts – 10th Edition 2.34 Silberschatz, Galvin and Gagne ©2018
Storage Hierarchy
 Storage systems organized in hierarchy according to
 Speed
 Cost
 Volatility

 Caching – copying information into faster storage system


 main memory can be viewed as a cache for secondary
storage

Operating System Concepts – 10th Edition 2.35 Silberschatz, Galvin and Gagne ©2018
Storage-Device Hierarchy

Operating System Concepts – 10th Edition 2.36 Silberschatz, Galvin and Gagne ©2018
Memory Protection
 We must protect the OS from access by user
programs and protect user programs from one
another.
 We must provide memory protection at least for
the interrupt vector and the interrupt service
routines of the operating system.
 In order to have memory protection, add two
registers that determine the range of legal
addresses a program may access:
 Base register – holds the smallest legal physical
memory address.
 Limit register – contains the size of the range
 Memory outside the defined range is protected.

Operating System Concepts – 10th Edition 2.37 Silberschatz, Galvin and Gagne ©2018
Use of A Base and Limit Registers
Kernel mode
(Supervisor mode,
System mode,
Privilaged mode,
Monitor mode)

User mode

Operating System Concepts – 10th Edition 2.38 Silberschatz, Galvin and Gagne ©2018
Hardware Address Protection

Operating System Concepts – 10th Edition 2.39 Silberschatz, Galvin and Gagne ©2018
Operating System Operations
 Dual-mode operation allows OS to protect itself and other system
components
 User mode and kernel mode (see next slide)
 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 (I/O instructions, instruction to
modify the memory-management registers or the timers,
halt instructions).
 System call changes mode to kernel, return from call resets
it to user mode
 If an attempt is made to execute a privileged instruction in user
mode, the hardware does not execute the instruction but rather
treats it as illegal and traps it to the operating system.

Operating System Concepts – 10th Edition 2.40 Silberschatz, Galvin and Gagne ©2018
Operating System Operations(cont.)

System call changes mode to kernel, return from call


resets it to user mode

Operating System Concepts – 10th Edition 2.41 Silberschatz, Galvin and Gagne ©2018
Common System Components
Resource Management

As we have seen, an operating system is a resource manager.

The system’s CPU, memory space, file-storage space, and I/O


devices are among the resources that the operating system must
manage.

 Process Management
 Main Memory Management
 File Management
 Secondary Storage Management
 I/O System Management
 Networking
 Protection System

Operating System Concepts – 10th Edition 2.42 Silberschatz, Galvin and Gagne ©2018
Process Management
 A program can do nothing unless its instructions are executed by a CPU.
 A process is a program in execution. It is a unit of work within the system.
Program is a passive entity (content of a file stored on the disk), process is
an active entity (with a program counter specifying the next instruction to
execute).
 A process needs certain resources, including CPU time, memory, files, and
I/O devices, to accomplish its task (also needs input, instructions).
 Single-threaded process has one program counter specifying location of
next instruction to execute (threads are covered later)

The execution of such a process must be sequential. The CPU executes
one instruction of the process after another, until the process completes..
 Multi-threaded process has one program counter per thread (thread is a unit
of execution). A process is the unit of work in a system.
 Typically system has many processes, some user (execute user code), some
operating system (execute system code), running concurrently on one or
more CPUs (see next slide)
 Concurrency by multiplexing the CPUs among the processes/threads

Operating System Concepts – 10th Edition 2.43 Silberschatz, Galvin and Gagne ©2018
More on processes
 A program such as a compiler is a process, and
a word-processing program being run by an
individual user on a PC is a process. Similarly, a
social media app on a mobile device is a
process.
 For now, you can consider a process to be an
instance of a program in execution, but later
you will see that the concept is more general. It
is possible to provide system calls that allow
processes to create subprocesses to execute
concurrently (will be described later).

Operating System Concepts Silberschatz, Galvin and Gagne ©2018


Operating System Concepts – 10th Edition 2.44
Single and Multithreaded Processes

Most software applications that run on modern computers are multithreaded.


An application is typically implemented as a separate process with several
threads of control.
A web browser might have one thread displays images or text while another
thread retrieves data from the network.

Operating System Concepts – 10th Edition 2.45 Silberschatz, Galvin and Gagne ©2018
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 – 10th Edition 2.46 Silberschatz, Galvin and Gagne ©2018
Main Memory Management
 Main memory is central to the operation of a modern computer system
 Main memory is a large array of words or bytes, each with its own address.
Memory is a repository of quickly accessible data shared by the CPU and I/O
devices.
 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.
 Main memory is a volatile storage device. It loses its contents in the case of
system failure.
 Memory management determines what is in memory and where they are
located
 Memory management activities:
 Keeping track of which parts of memory are currently being used and by
whom (which process)
 Deciding which processes (or parts of processes) and data to move into
and out of memory
 Allocating and deallocating memory space as needed

Operating System Concepts – 10th Edition 2.47 Silberschatz, Galvin and Gagne ©2018
File-System Management
 To make the computer system convenient for users, the operating system
provides a uniform, logical view of information storage. The operating system
abstracts from the physical properties of its storage devices to define a logical
storage unit, file.
 A file is a collection of related information defined by its creator. Commonly,
files represent programs (both source and object forms) and data
 Each medium is controlled by device (i.e., disk drive, tape drive) having
varying properties that 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 and how (read,
write, execute, append)
 OS activities include
 Creating and deleting files and directories
 Primitives to manipulate (control) files and directories
 Mapping files onto secondary storage
 Backup files onto stable (non-volatile) storage media

Operating System Concepts – 10th Edition 2.48 Silberschatz, Galvin and Gagne ©2018
Secondary-Storage Management
 Since main memory (primary storage) is volatile and too small to
accommodate all data and programs permanently, the computer
system must provide secondary storage to back up main memory.
 Usually disks are used to store data and programs that does not
fit in main memory or data that must be kept for a “long” period of
time.
 The operating system is responsible for the following activities in
connection with disk management:
 Free space management
 Storage allocation
 Disk scheduling
 Partitioning
 Protection

Operating System Concepts – 10th Edition 2.49 Silberschatz, Galvin and Gagne ©2018
Characteristics of Various Types of Storage

Movement between levels of storage hierarchy can be explicit or implicit

Operating System Concepts – 10th Edition 2.50 Silberschatz, Galvin and Gagne ©2018
Cache Management
 Important principle, performed at many levels in a computer (in
hardware, operating system, software)
 Use of high-speed memory to hold recently-accessed data.
 Information in use copied from slower to faster storage
temporarily
 Faster storage (cache) checked first to determine if information
is there
 If it is, information used directly from the cache (fast)
 If not, data copied to cache and used there
 Requires a cache management policy, since caches have
limited memory size.
 Caching introduces another level in storage hierarchy. This
requires data that is simultaneously stored in more than one
level to be consistent.
 Ex: Value of a variable can be different in register and in the
various storage systems.

Operating System Concepts – 10th Edition 2.51 Silberschatz, Galvin and Gagne ©2018
Migration of data “A” from Disk to Register
 Multitasking environments must be careful to use most recent
value, no matter where it is stored in the storage hierarchy

Multiprocessor environment must provide cache coherency in


hardware such that all CPUs have the most recent value in their
cache
 Distributed environment situation is even more complex
 Several copies of a datum can exist

Data transfer from cache to CPU and registers is usually a


hardware function, with no operating-system intervention
(implicit movement of information).

Transfer of data from disk to memory is usually controlled


by the operating system (explicit movement of information).

Operating System Concepts – 10th Edition 2.52 Silberschatz, Galvin and Gagne ©2018
Migration of data “A” from Disk to Register
 In a hierarchical storage structure, the same data may appear in
different levels of the storage system.
 For example, suppose that an integer A that is to be incremented by
1 is located in file B, and file B resides on hard disk.
 The increment operation proceeds by first issuing an I/O operation
to copy the disk block on which A resides to main memory.
 This operation is followed by copying A to the cache and to an
internal register. Thus, the copy of A appears in several places: on
the hard disk, in main memory, in the cache, and in an internal
register (see figure in previous slide).
 Once the increment takes place in the internal register, the value of
A differs in the various storage systems.
 The value of A becomes the same only after the new value of A is
written from the internal register back to the hard disk.

Operating System Concepts – 10th Edition 2.53 Silberschatz, Galvin and Gagne ©2018
I/O System Management
 One purpose of OS is to hide peculiarities (properties) of
hardware devices from the user.

 Only device driver knows peculiarities of the specific device to which


it is assigned.

 I/O subsystem consists of several components:


 Memory management component that includes 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)
 A general device-driver interface
 Drivers for specific hardware devices

Operating System Concepts – 10th Edition 2.54 Silberschatz, Galvin and Gagne ©2018
Networking (Distributed Systems)
 A distributed system is a collection of processors that do not share memory
or a clock. Each processor has its own local memory and clock.
 The processors in the system are connected through a communication
network.
 Communication takes place using protocols.
 A distributed system provides user access to various system resources.
 Access to a shared resource allows:
 Computation speed-up
 Increased data availability
 Enhanced(improved) reliability

Operating System Concepts – 10th Edition 2.55 Silberschatz, Galvin and Gagne ©2018
Protection and Security
 If a computer system has multiple users and allows the concurrent execution
of multiple processes, then access to data must be regulated (controlled)
 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
 Protection and security require the system to be able to distinguish
(differentiate) among all its users. User identities (user Ids or security IDs)
include name and associated number are unique, one per user
 Each user ID is associated with all files and 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/thread.
 For example, the owner of a file on a UNIX system may be allowed to
issue all operations on that file, whereas a selected set of users may
be allowed only to read the file.
 Privilege escalation allows user to change to effective ID with more
rights

Operating System Concepts – 10th Edition 2.56 Silberschatz, Galvin and Gagne ©2018

You might also like