Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Operating System Concepts – 9th Edit9on Silberschatz, Galvin and Gagne ©2013
n Course: Operating Systems
n 3+1 credit hours
n MID: 25 marks
n Final: 50 Marks
n Sessional: 25 Marks (Class participation, Behavior, Home Assignments,
Quiz, Presentation)
n Recommended Book: Operating Systems Concepts, 9th edition by Abraham
Silbershatz
Operating System Concepts – 9th Edition 1.2 Silberschatz, Galvin and Gagne ©2013
Chapter 1: Introduction
n What Operating Systems Do
n Computer-System Organization
n Computer-System Architecture
n Operating-System Structure
n Operating-System Operations
n Process Management
n Memory Management
n Storage Management
n Protection and Security
n Computing Environments
Operating System Concepts – 9th Edition 1.3 Silberschatz, Galvin and Gagne ©2013
Objectives
Operating System Concepts – 9th Edition 1.4 Silberschatz, Galvin and Gagne ©2013
What is an Operating System?
Operating System Concepts – 9th Edition 1.5 Silberschatz, Galvin and Gagne ©2013
Operating system’s functions
Operating System Concepts – 9th Edition 1.6 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition 1.7 Silberschatz, Galvin and Gagne ©2013
Computer System Structure
Operating System Concepts – 9th Edition 1.8 Silberschatz, Galvin and Gagne ©2013
Four Components of a Computer System
Operating System Concepts – 9th Edition 1.9 Silberschatz, Galvin and Gagne ©2013
Operating System Definition
n OS is a resource allocator
l Manages all resources
l Decides between conflicting requests for efficient and
fair resource use
n OS is a control program
l Controls execution of programs OS decides over
which program
will be using
RAM/disk or any
other device at
a particular
time. That's y
OS is called
resource
allocator
Operating System Concepts – 9th Edition 1.10 Silberschatz, Galvin and Gagne ©2013
Computer Startup
Operating System Concepts – 9th Edition 1.11 Silberschatz, Galvin and Gagne ©2013
Computer System Organization
n Computer-system operation
l One or more CPUs, device controllers connect through common
bus providing access to shared memory
l Concurrent execution of CPU and devices.
Operating System Concepts – 9th Edition 1.12 Silberschatz, Galvin and Gagne ©2013
Computer-System Operation
Operating System Concepts – 9th Edition 1.13 Silberschatz, Galvin and Gagne ©2013
Computer-System Operation
Operating System Concepts – 9th Edition 1.14 Silberschatz, Galvin and Gagne ©2013
Interrupts
Operating System Concepts – 9th Edition 1.15 Silberschatz, Galvin and Gagne ©2013
Interrupts
Operating System Concepts – 9th Edition 1.16 Silberschatz, Galvin and Gagne ©2013
Common Functions of Interrupts
Operating System Concepts – 9th Edition 1.17 Silberschatz, Galvin and Gagne ©2013
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.
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
(because networks move data a bit at a time).
Operating System Concepts – 9th Edition 1.18 Silberschatz, Galvin and Gagne ©2013
Storage Structure
n The CPU can load instructions only from memory, so any programs to
run must be stored there.
n Computers run most of their programs from main memory (also called
random-access memory , or RAM).
l Random access
l Typically volatile (holds data temporarily)
n Secondary storage – extension of main memory that provides large
nonvolatile storage capacity and holds data permanently.
Operating System Concepts – 9th Edition 1.19 Silberschatz, Galvin and Gagne ©2013
Storage Structure
Operating System Concepts – 9th Edition 1.20 Silberschatz, Galvin and Gagne ©2013
Storage Hierarchy
Operating System Concepts – 9th Edition 1.21 Silberschatz, Galvin and Gagne ©2013
Storage-Device Hierarchy
Operating System Concepts – 9th Edition 1.22 Silberschatz, Galvin and Gagne ©2013
Storage Hierarchy
Operating System Concepts – 9th Edition 1.23 Silberschatz, Galvin and Gagne ©2013
Caching
Operating System Concepts – 9th Edition 1.24 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture
Operating System Concepts – 9th Edition 1.25 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture
n Multiprocessors Systems
n Also known as parallel systems or multicore systems
n Such systems have two or more processors in close communication,
n Sharing the computer bus. memory, and peripheral devices.
n Multiprocessor systems have three main advantages
1. Increased throughput:
By increasing the number of processors, we expect
to get more work done in less time.
2. Economy of scale:
It is cheaper to store data on one disk and to have all the processors
share them than to have many computers with local disks and many
copies of the data.
3. Increased reliability –If functions can be distributed properly among
several processors, then the failure of one processor will not affect the
system, only slow it down
Operating System Concepts – 9th Edition 1.26 Silberschatz, Galvin and Gagne ©2013
Computer-System Architecture
n Two types of multiprocessor systems:
1. Asymmetric Multiprocessing – each processor is assigned a
specific task.
A boss processor controls the system; the other processors either
look to the boss for instruction or have predefined tasks.
Operating System Concepts – 9th Edition 1.27 Silberschatz, Galvin and Gagne ©2013
Symmetric Multiprocessing Architecture
Operating System Concepts – 9th Edition 1.28 Silberschatz, Galvin and Gagne ©2013
A Dual-Core Design
Operating System Concepts – 9th Edition 1.29 Silberschatz, Galvin and Gagne ©2013
A Dual-Core Design
Operating System Concepts – 9th Edition 1.30 Silberschatz, Galvin and Gagne ©2013
Operating System Structure
n One of the most important aspects of operating systems is the ability
to multi program.
n Single users have multiple programs running.
n Multiprogramming needed for efficiency
l Single user cannot keep CPU and I/O devices busy at all times
l Multiprogramming organizes jobs (code and data) so CPU always has one
to execute
l Main memory is too small to accommodate all jobs, the jobs are kept initially
on the disk in the job pool
l This pool consists of processes awaiting allocation of main memory.
l A subset of total jobs in system is kept in memory
l The operating system picks and begins to execute one of the jobs in
memory.
l In a non-multiprogrammed system, the CPU would sit idle.
l In a multiprogrammed system, the operating system simply switches to, and
executes, another job.
l When that job needs to wait, the CPU switches to
another job, and so on. Eventually, the first job finishes waiting and gets the
CPU back.
l x
Operating System Concepts – 9th Edition 1.31 Silberschatz, Galvin and Gagne ©2013
Operating System Structure
Operating System Concepts – 9th Edition 1.32 Silberschatz, Galvin and Gagne ©2013
Memory Layout for Multiprogrammed System
Operating System Concepts – 9th Edition 1.33 Silberschatz, Galvin and Gagne ©2013
Operating-System Operations
n Interrupt driven (hardware and software)
l Hardware interrupt by one of the devices
l 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 Concepts – 9th Edition 1.34 Silberschatz, Galvin and Gagne ©2013
Operating-System Operations (cont.)
Operating System Concepts – 9th Edition 1.35 Silberschatz, Galvin and Gagne ©2013
Operating-System Operations (cont.)
Operating System Concepts – 9th Edition 1.36 Silberschatz, Galvin and Gagne ©2013
Transition from User to Kernel Mode
n We can use the timer to prevent a user program from running too long.
n A simple technique is to initialize a counter with the amount of time that
a program is allowed to run.
n A program with a 7-minute time limit, for example, would have its
counter initialized to 420.
n Every second, the timer interrupts, and the counter is decremented by
1.
n As long as the counter is positive, control is returned to the user
program.
n When the counter becomes negative, the operating system terminates
the program for exceeding the assigned time limit.
n Timer is set up to regain control or terminate program that exceeds
allotted time
Operating System Concepts – 9th Edition 1.37 Silberschatz, Galvin and Gagne ©2013
Process Management
Operating System Concepts – 9th Edition 1.38 Silberschatz, Galvin and Gagne ©2013
Process Management Activities
Single process has one program counter specifying location of next instruction to
execute
Process executes instructions sequentially, one at a time, until completion
Typically system has many processes, some user, some operating system running
concurrently on one or more CPUs
The operating system is responsible for the following activities in connection with
process management:
n Creating and deleting both user and system processes
n Suspending and resuming processes
n Providing mechanisms for process synchronization
n Providing mechanisms for process communication
n Providing mechanisms for deadlock handling
Operating System Concepts – 9th Edition 1.39 Silberschatz, Galvin and Gagne ©2013
Memory Management
Operating System Concepts – 9th Edition 1.40 Silberschatz, Galvin and Gagne ©2013
Memory Management
Operating System Concepts – 9th Edition 1.41 Silberschatz, Galvin and Gagne ©2013
Storage Management
Operating System Concepts – 9th Edition 1.42 Silberschatz, Galvin and Gagne ©2013
Storage Management
Files represent programs (both source and object forms) and data.
Operating System Concepts – 9th Edition 1.43 Silberschatz, Galvin and Gagne ©2013
Mass-Storage Management
n Main memory is too small to accommodate all data and programs,
n The data that it holds are lost when power is lost,
n The computer system must provide secondary storage to back up
main memory.
n Most modern computer systems use disks as storage medium for
both programs and data
n The operating system is responsible for the following activities in
connection with disk management:
• Free-space management
• Storage allocation
• Disk scheduling
n
n 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
n Proper management is of central importance
n Entire speed of computer operation hinges on disk subsystem and its
Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition 1.44
Secondary storage is used frequently, it must be used efficiently.
Magnetic tape drives and their tapes and CD and DVD drives
and platters are typical tertiary storage devices.
The main objective of the tertiary storage level is to provide huge
storage capacity at low cost.
The media (tapes and optical discs) vary between WORM (write-
once, read-many-times) and RW (read–write) formats.
Tertiary storage is not crucial to system performance, but it still
must be managed.
Some of the functions that operating systems can provide include:
• Mounting and unmounting media in devices
• Allocating and freeing the devices for exclusive use by processes.
• Migrating data from secondary to tertiary storage.
Operating System Concepts – 9th Edition 1.45 Silberschatz, Galvin and Gagne ©2013
Migration of data “A” from Disk to Register
n All the CPUs must have the most recent value in their cache
Operating System Concepts – 9th Edition 1.46 Silberschatz, Galvin and Gagne ©2013
Protection and Security
Operating System Concepts – 9th Edition 1.47 Silberschatz, Galvin and Gagne ©2013
Protection and Security
Operating System Concepts – 9th Edition 1.48 Silberschatz, Galvin and Gagne ©2013
End of Chapter 1
Operating System Concepts – 9th Edit9on Silberschatz, Galvin and Gagne ©2013