Você está na página 1de 105

Operating

Systems
Topics to discuss
• What is an operating system(OS)?
• Main objectives of an OS
• Main functions of an OS
• Evolution of OS.
• Process management.
• Context switching.
• Process state diagrams

Operating Systems 2
Components of a
Computer System

hardware—electronic,
devices.
 mechanical, optical

 
software—programs.
 
Liveware – Computer Users

Operating Systems 3
What is an operating
system(OS)?
 
 An operating system (OS) is a resource manager.
 
What is the necessity for a resource manager?

Many processes are active
 at any given time and
 compete for resources.

An operating system provides orderly and
controlled allocation of the resources among 
processes (jobs) that are competing for them.

Operating Systems 4
Different types of Software
 
Application Software
 
Systems Software
 
 Operating system
 
System utilities

The quality of system software also directly


affects the application software

Operating Systems 5
Types of Software
Utility software: system
software designed to help
analyze, configure, optimize
or maintain a computer(Anti -
virus, Backup software,
Editors, Data compression,
Disk cleaners ….).
They are not essential to the
running of the computer

Transient Component

Operating Systems 6
Execution of
source programs

Operating Systems 7
What is an operating
system(OS)?

Operating Systems 8
What is an operating
system(OS)?
Kernel : Part of the
O/S that resides in
the main memory
all the time.

Operating Systems 9
Different types of OSs(Based
on the processor)
• Windows/Linux – For personal computers
• Unix,z/OS, OS/390, VM – For mainframes
• MacOs – For Macs
• X Server, Windows Server – Server
Operating Systems
• Symbian,Android – For mobile phones.

Operating Systems 10
Different types of
OSs(Based on the users)
• Single User – Allows only a single user to use
the OS at any given time. The use may run
several processes at the same time.
• Example - DOS
• Multi User - Allows multiple users to access
a computer system at the same time
• Example UNIX, Time-sharing systems and Internet
servers.

Operating Systems 11
Different types of OSs(Based
on the number of tasks)
• Single Task– Allows only one running program
at any given time.
• Multi Task - A multi-tasking operating system
allows more than one program to be running
at the same time.

Operating Systems 12
Different types of OSs
• Real Time – OS is designed to run applications
with very precise timing and with a high degree of
reliability.
• The main objective of real-time operating systems
is their quick and predictable response to events.
• These types of OS are needed in situations where
downtime is costly or a program delay could cause
a safety hazard.

Operating Systems 13
Main objectives of an OS
Convenience: Make the computer more convenient
to use
◦ Provide easy to use interface for a normal users.
◦ Hide the complexity of the hardware devices from
the application developer.

Efficiency: Monitor and manage resources of


the computer system efficiently
◦ CPU
◦ Main memory
◦ Secondary Storages
◦ Various devices connected to the computer

Operating Systems 14
Services provided by an
OS
Process Management
Storage (external) management
Memory management
I/O device management
Management of the File System
Networking
User Interface
Protection

Operating Systems 15
Services provided by an
OS….
Error detection and response
◦ Hardware errors: memory error or device failure
◦ Software errors: arithmetic errors, access
forbidden memory locations
Accounting
◦ collect statistics (billing)
◦ monitor performance

Operating Systems 16
Types of User Interfaces
Command Line Interface(CLI)

Operating Systems 17
Types of User Interfaces
Graphical User Interface(GUI)

Operating Systems 18
OS and Processors
Can any OS run on any
processor?
Operating systems are software
Operating systems are designed
and developed for a specific
CPU family.
◦ Macintosh OS: Motorola
680xx, PowerPC Gx, Intel
◦ DOS: Intel CPUs
◦ Windows 9x and XP: Intel 80386,
80486, and Pentium CPUs
◦ Linux: Intel CPUs
◦ MS NT & 2000: Intel CPUs

Operating Systems 19
Compatibility of Software
Question
Will software developed for one
operating system work on another?
For example will MS Word for Macintosh
run on a PC with Windows XP?

Operating Systems 20
Compatibility of Software
Question
Will software developed for one operating
system work on another?
Answer
No (unless there is special emulation software
or hardware). The software is typically
developed separately for each operating system.

Operating Systems 21
Evolution of
Operating systems
Serial Processing (1940 –
mid 1950s)
◦ Single user system.
◦ Programmer/User acts as the
operator and interacted with
the hardware.
◦ No operating system.
◦ Machines run from a console
with display lights, toggle
switches.
◦ Paper Tapes or Punched cards
for the program and I/O. Disadvantages :
◦ Setup included loading the 
Scheduling: Hardcopy sigh-up sheet for reserving
compiler, source program, time
saving compiled program, and 
User could reserve for 45 mins and finish in 30 mins
loading and linking => wastage of time

User may not beable to finish in
scheduled time

Operating Systems 22
Simple batch system
Simple Batch Processing Systems
◦ Use of high-level languages
◦ Jobs are batched together by the
language.
◦ Input/output is through punch
cards and magnetic tapes.
◦ Software called the Monitor was
introduced to sequence the jobs.
◦ Hardware support for
the monitor model
◦ Memory protection: some memory
areas are accessible only to the
monitor
◦ Privileged mode instructions: only
accessible to the monitor
◦ Interrupts (early machines did
not have this)

Operating Systems 23
Simple batch processing
system
• The user submits a job (written on cards or tape) to
a computer operator.
• The computer operator place a batch of several jobs on
an input device.
• A special program called the monitor, manages
the execution of each program in the batch.
◦ “Monitor” is always in main memory.
◦ Monitor reads and loaded programs sequentially and then (the utility
programs when needed) passed the control to the loaded program.
◦ When a job terminates the control returns back to the monitor program. ◦
Alternate execution between user program and the monitor program.
• instructions for the monitor were given by using a special
purpose language called Job Control Language (JCL)

Operating Systems 24
Simple batch system …..
• A user program executes in user mode, in
which certain areas of memory were
protected from the user’s use, and user
program is not allowed to execute certain
instructions.
•The monitor executes in a system mode, or a
kernel mode and it can execute privileged
instructions and can access protected memory
segments.
• Machine time alternates between
monitor and the user programs.

Operating Systems 25
Simple batch system …..
Disadvantages
•A portion of the memory has to be
allocated for the monitor
•A small portion of the machine time
is consumed by the monitor.

Advantage of batch systems.


•Reduce setup time by batching
similar jobs.

Operating Systems 26
Card Deck of a job

Operating Systems 27
Simple batch system :
Problems
◦ During I/O operations CPU is not used.

Operating Systems 28
Simple batch system : I/O
◦ I/O devices (Card Readers, Printers) slow when
compared to CPU.
Solution: Offline Operation (Satellite Computers)
◦ Speed up computation by loading jobs into memory from
tapes while card reading and line printing
is done off-line using smaller machines.

Operating Systems 29
Multiprogramming
Running multiple programs “at the same time”
◦ Requires sharing the CPU among multiple processes

Firefox Word javac Firefox Word

Transfer of control is called a context switch

Operating Systems 30
Multiprogramming
Why multiprogramming?
◦ 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 CPU is give for that job.
• When it has to wait, OS switches to another job.

Operating Systems 31
Multiprogramming

Operating Systems 32
Time Sharing Systems
• Processor’s time is shared among multiple users
• Multiple users simultaneously access the system
through terminals.

Operating Systems 33
Multiprogramming Vs
Time Sharing Systems
• Multiprogramming maximizes CPU utilization
• Time-sharing minimizes user response time

Operating Systems 34
Loading the
Operating System
• OS is also a software like any other, but has to
be loaded and run by the OS itself.
• The process of initializing the computer and
loading the OS is known as bootstrapping or
booting the system.
• The bootstrapping program normally exist in non-
volatile memory and is executed automatically
when the machine is turned on.
• The operating system software (kernel) copied into
RAM, usually from the hard disk, during the boot-up.
• Once loaded the OS wait for an event to occur (eg:
user typing a command) and process the event.
• OS is an event driven software

Operating Systems 35
Loading the
Operating System
• The kernel remains in RAM while the computer
is on and is in charge of the overall operation of
the computer system.
• The kernel contains the “internal programs”
for the most often used operations like file
management, memory management, security.

Operating Systems 36
Gaining Control

 The OS gets the control of the CPU when either
external event or an internal event occurs.
 an
 
External Events
 
 Character typed at the console
 
 Completion of an I/O operation
 
 Timer quantum allowed for a process expires.
 
 Internal Events
 
 Division by zero,
 
 System call issued by a program
 
 Page Fault
 
Unauthorized memory access
Operating Systems 37
Interrupts

External events get 
the attention of the CPU
through Interrupts.

For example when a disk driver has finished
transferring the requested data, it generates an
to the OS to inform the OS that the task
interrupt
 is over.

Interrupts occur asynchronously to the ongoing
 at which
activity of the processor. Thus the times
interrupts occur are unpredictable.

Operating Systems 38
Interrupt Handlers

Interrupt Handlers :
Code that get executed when
an interrupt occurs.

Associated with each type of interrupt
there is a specific program to handle that
 handler
type of interrupts – Interrupt
(Interrupt service routine)

Operating Systems 39
Getting the services of OS
 
How do the user programs get the service of OS?

User programs
 access the functionality of the OS through system calls – privileged
operations.
 
 Example : open(), close(), fork(),…….

The execution
 of system call change the execution mode of the CPU to supervisor
mode.

Operating Systems 40
Processes
 
Process is a fundamental concepts in modern operating systems.

It was first
 introduced by the designers of Multics operating systems in the
1960s.

The programs that reside in main memory are absolutely different from
 the program files on hard disks or any other secondary
their counter-parts
storage devices.

Operating Systems 41
Process and a program
• A process is a program in execution
• An instance of a program running on a computer.
• The entity that can be assigned to and executed
on a processor
• A program is a static set of instructions

Operating Systems 42
Characteristics of a process
Consists of three components
◦ An executable program
◦ Associated data needed by the program
◦ Execution context of the program
◦ All information the operating system needs
to manage the process.
• When a new process is created, the operating
system builds the date structures that are
used to manage the process and allocates
space in main memory to the process.

Operating Systems 43
Process creation and
termination
• When a new process is created, the operating system
builds the date structures that are used to manage
the process and allocates space in main memory to
the process.
• A process may terminates in a number of ways.
• After completion of the instructions.
• User terminates (kills) the process explicitly. For
example clicking on the cross button in the
windows applications.
• A process may terminate due to abnormal condition.
• When a process finishes, the operating system will
free the memory space it occupies and remove the
data structures it allocated to manage the process.
Operating Systems 44
Processes in a typical
Linux system

Operating Systems 45
Uniprocessor Scheduling
Type of processes
• I/O bound processes
• Processor bound processes

Operating Systems 46
Uniprocessor Scheduling
Types of Scheduling
• Long-term scheduling(Job scheduling) : It determines
which programs are admitted to the system for
processing. Job scheduler selects processes from the
queue and loads them into memory for execution.
Process loads into the memory for CPU scheduling.
• Medium-term scheduling : Medium term scheduling is in
charge of swapping processes between the main
memory and the secondary storage.
• Short-term scheduling (low-level scheduling) : Determines
which ready process will be assigned the CPU when it
next becomes available.

Operating Systems 47
Scheduling Policies
◦ Non-preemptive
◦ Once a process is in the running state, it will
continue until it terminates or blocks itself for
I/O.
◦ Preemptive
◦ Currently running process may be interrupted
and moved to the Ready state by the OS.
◦ Allows for better service since any one process
cannot monopolize the processor for very long

Operating Systems 48
Processor Scheduling
Assigning the processor to the processes.
Turnaround time : Time required for a particular process to
complete, from submission time to completion.
Response time : The time taken in an interactive program from
the issuance of a command to the commence of a response to
that command.
Throughput : Number of processes completed per unit time. May range
from 10 / second to 1 / hour depending on the specific processes.
Waiting time : How much time a process spends in the ready queue
waiting its turn to get on the CPU.

Operating Systems 49
Long-term scheduling(Job
scheduling)
• Determines which processes are admitted to
the system for processing
• Controls the degree of multiprogramming
• If more processes are admitted
• better CPU usage
• less likely that all processes will be blocked
• The long term scheduler may attempt to keep a
mix of processor-bound and I/O-bound processes

Operating Systems 50
Medium-Term Scheduling
• Swapping decisions based on the need to
manage multiprogramming
• Done by memory management software

Operating Systems 51
Short-Term Scheduling
• Determines which process is going to execute
next (also called CPU scheduling)
• The short term scheduler is known as
the dispatcher
• Dispatching the CPU to the process

Operating Systems 52
Schedulers - Comparison
Long Term Scheduler Short Term Scheduler Medium Term Scheduler
Job Scheduler CPU scheduler Processes swapping
scheduler
Selects processes from a Selects those processes Re-introduces the
pool and loads them into which are ready to processes into memory
the memory for execute for dispatching and execution can be
execution continued.
Controls the degree of Provides lesser control Reduces the degree of
multiprogramming over the degree of multiprogramming
multiprogramming
Speed is lesser than Speed is fastest among Speed is in between
short term scheduler other two (short and long term
schedulers)

Operating Systems 53
Queuing Diagram
for Scheduling

Operating Systems 54
Seven state process
transition Diagram
Typically, new
processes are not in the
main memory.

Operating Systems 55
Seven state process
transition Diagram

Long Term
Medium Term Scheduler
Scheduler Short Term

Scheduler

Operating Systems 56
Process Control
Block (PCB)
All of the information needed to keep track of a process
when switching states is kept in a data package called a
process control block. The process control block
typically contains:
• An ID number that identifies the process
• Pointers to the locations in the program and its data where
processing last occurred
• Register contents
• States of various flags and switches
• A list of files opened by the process
• The priority of the process
• The status of all I/O devices needed by the process

Operating Systems 57
Context Switching
• A context switch is the mechanism to store and restore the state or
context of a CPU in Process Control block so that a process
execution can be resumed from the same point at a later time.
• Using this technique a context switcher enables multiple processes to
share a single CPU. Context switching is an essential part of a
multitasking operating system features.
• When the scheduler switches the CPU from executing one process to
execute another, the context switcher saves the content of all
processor registers for the process being removed from the CPU, in
its process control block.
• Context switch time is pure overhead.
• Context switching can significantly affect performance as modern
computers have a lot of general and status registers to be saved.

Operating Systems 58
Context Switching

Operating Systems 59
Short-term
scheduling algorithms
• First-come-first served
• Round Robin
• Shortest Process next

Operating Systems 60
Objectives of Short-
Term Scheduling
User-oriented
◦ Response Time: Elapsed time from the
submission of a request to the beginning of
response
◦ Turnaround Time: Elapsed time from the
submission of a process to its completion
System-oriented
◦ processor utilization
◦ fairness
◦ throughput: number of process completed
per unit time

Operating Systems 61
First-come-first
served scheduling
• Each process joins the end of the Ready queue.
• When the current process ceases to execute,
the process waited the longest time in the Ready
queue is assigned the CPU.

Operating Systems 62
Example - FCFS
Process Arrival Service Finish Turnaround
Time Time time time Average Turnaround time
A 0 3 3 3 = (3 + 7+ 9+ 12 + 12)/5
B 2 6 9 7 = 8.60
C 4 4 13 9
D 6 5 18 12
E 8 2 20 12

Operating Systems 63
Shortest Job First
(Shortest Process Next)
• Nonpreemptive policy
• Process with shortest expected processing time
is selected next
• Short process jumps ahead of longer processes

Operating Systems 64
Shortest Job First
(Shortest Process Next)
Process Arrival Service Finish Turnaround
Time Time time time Average Turnaround time
A 0 3 3 3 = (3 + 7+ 11+ 14 + 3)/5
B 2 6 9 7 = 7.60
C 4 4 15 11
D 6 5 20 14
E 8 2 11 3

Operating Systems 65
FCFS - Issues
A short process may have to wait a
very long time before it can execute
Favors CPU-bound processes
◦ I/O processes have to wait until
CPU-bound process completes

Operating Systems 66
Round Robin Scheduling
• Clock interrupt is generated at periodic intervals.
• When an interrupt occurs, the currently
running process is placed in the ready queue
(preempted)
• Next process in the ready queue is assigned
the CPU.
• Known as time slicing

Operating Systems 67
Queuing Diagram

Operating Systems 68
Round Robin Scheduling
Scheduling Policy – Preemption, Time quantum for each process = 1
Process Arrival Service Finish Turnaround Average Turnaround time
Time Time time time
= (4 + 16+ 13+ 14 + 7)/5
A 0 3 4 4
= 10.80
B 2 6 18 16
C 4 4 17 13
D 6 5 20 14
E 8 2 15 7

0 5 10 15 20

Operating Systems 69
Round Robin Scheduling
Scheduling Policy – Preemption, Time quantum for each process = 4
Process Arrival Service Finish Turnaround Average Turnaround time
Time Time time time
= ( 3+ 15+ 7+ 14 + 11)/5
A 0 3 3 3
= 10.00
B 2 6 17 15
C 4 4 11 7
D 6 5 20 14
E 8 2 19 11

Gantt Chart ?

Operating Systems 70
Priority Scheduling
• Scheduler will always choose a process of
higher priority over one of lower priority
• Use multiple ready queues to represent
multiple levels of priority
• Lower-priority may suffer starvation
• Allow a process to change its priority based on its age
or execution history

Operating Systems 71
Priority Queuing

Can be either preemptive or non-preemptive

Operating Systems 72
Threads
A thread is the smallest schedulable unit in a system that can be
managed independently by an operating system. A thread can also be
viewed as an execution streams within a single process. Generally a
thread contained inside a process. It is possible to have processes
with one threads or processes with multiple threads.
All threads of a process share common code, data, and other resources,
including CPU registers.
• Allows multiple tasks to be performed simultaneously in a single
address space.
• Context switching generates less overhead.

Operating Systems 73
Threads …..
Threads are very useful whenever a process has multiple tasks
to perform independently of the others.
For example in a word processor, a background thread may
check spelling of a document while a foreground thread
processes user keystrokes, while another thread may
automatically backs up the edited section periodically.

Operating Systems 74
Virtual Memory

Operating Systems 75
Virtual Memory - Goals
• Allow applications larger than physical memory to execute.
• Run partially loaded programs.
• Multiprogramming: Many programs simultaneously
reside in memory.
• Allow re-locatable programs – anywhere, anytime
• Application Portability:
• Applications should not have to manage memory resources
• Write machine independent code – program should
not depend on memory architecture.
• Permit sharing of memory segments or regions.
• For example, read-only code segments should be
shared between program instances.

Operating Systems 76
Virtual Memory

Operating Systems 77
Address Translation
• Memory
management unit
(MMU) translate
virtual address into
physical address.
• Each process has its
own memory space

Operating Systems 78
Virtual Memory
• Process runs on a virtual machine as defined
by the underlying hardware.
• Focus is on Hardware support for a virtual
address space
• virtual addresses independent of
physical memory
• Key hardware component is the
Memory Management Unit (MMU)
• address translation: virtual to physical memory
• ensures virtual address space protection

Operating Systems 79
Virtual Memory

Keep track of
whether a
page is in a
physical page
frame or not.

Operating Systems 80
Using Virtual Memory

http://www.tutorialspoint.com/operating_system/os_virtual_memory.htm

Operating Systems 81
Using Virtual Memory
• Check an internal table for this process, to determine whether
the reference was a valid or it was an invalid memory access.
• If the reference was invalid, terminate the process. If it was valid,
but page have not yet brought in, page in the latter.
• Find a free frame.
• Schedule a disk operation to read the desired page into the
newly allocated frame.
• When the disk read is complete, modify the internal table kept
with the process and the page table to indicate that the page is
now in memory.
• Restart the instruction that was interrupted by the illegal address
trap. The process can now access the page as though it had always
been in memory. Therefore, the operating system reads the
desired page into memory and restarts the process as though the
page had always been in memory.

Operating Systems 82
Virtual Memory -
Disadvantages
Space: Translation tables and other data used by VM
system reduce available memory to programs
Time: Address translation time is added to the
cost (execution time) of each instruction.
Overhead: Memory management operations have been
measured to consume up to 10% of the CPU time on a
busy system.
Efficiency: Allocating memory in pages may result
in fragmentation

Operating Systems 83
Virtual Memory
Allows programmers to address memory from a logical point of view
◦ Another layer of indirection

Allow the illusion of operating with a larger memory space than what
is available in reality
◦ By storing some of the information on the file system

Operating Systems 84
Device Drivers
Device driver is a software.
The computer communicates
with peripheral devices through
device drivers.

A driver provides a software


interface to hardware devices,
enabling operating systems and
other computer programs to
access hardware functions without
knowing the precise hardware Device drivers depends on
details. both the hardware and the
operating system loaded in
to the computer

Operating Systems 85
Secondary Storage
Management
Secondary storage is the non-volatile repository for both user
and system data and programs.
Secondary storage is typically used to store
◦ Source program
◦ Executable programs
◦ Data for the program
◦ Temporaty data

Operating Systems 86
Files
A file is a named collection of related information, usually a sequence
of bytes
A file can be viewed in two different ways.
• Logical (programmer’s) view: how the users see the file.
◦ Liners collection of records.
◦ Image File – rows of intensity values
◦ Linear sequence of bytes.

• Physical (operating system) view: how the file is stored on


secondary storage.
◦ Many possibilities, not necessarily contiguous

Operating Systems 87
File Attributes
Each file has an associated collection
of information(attributes)
• file name
• Owner
• type (e.g., source, data, executable)
• location(s) on the secondary storage.
• organization (e.g. sequential, indexed, random)
• access permissions – who is permitted
to read/write/delete data in the file.
• time and date of creation, modification, last access
• file size

Operating Systems 88
File Types
File can be classified into various types based on
the content.
• Executable
• Text
• Source
• Library
• Compressed
• Word Processor
• Spread sheet.

One of the possible implementation technique of


file type is to include the type as an extension to the
file name.
Operating Systems 89
File Access Methods
File access methods describe how the data stored in a file can
be accessed
• Sequential: access in order, one record after another.
• Direct (random): access in any order, skipping over uninteresting records
• Indexed : access in any order, but based on key value(s)

Operating Systems 90
Directories
Directories are used to organize file to
logical categories.
A directory is a file that can be searched for
information about other files.
◦ Entries in the directory file are created, deleted and
modified when the files they describe are create, deleted
and modified.

Operating Systems 91
Unix Directory structure

Operating Systems 92
File allocation
Common file allocation techniques
◦ Contiguous
◦ Linked
◦ Indexed
Typically the allocation techniques allocate storage space
on the basis of fixed size addressable units.

Operating Systems 93
File allocation - Contiguous
Allocate disk space as a collection
of adjacent/contiguous blocks.
This technique needs to keep
track of unused disk space.
Directory
File Name Start Block No No of Blocks
file1 00 03
file2 12 06
file3 20 11

Operating Systems 94
File allocation - Contiguous
Advantages:
• Simple easy access.
• Easy Access.
Disadvantage
• File size is not known at the
time of creation.
• Extending file size is difficult
• External fragmentation

Operating Systems 95
File allocation - Linked
Inside each block a link is
maintained to point to
the next block of the file

Directory
File Name Start Block No No of Blocks
file1 00 03

Operating Systems 96
File allocation - Linked
Advantages:
• No external fragmentation.
• Files can grow easily.
Disadvantage
• Many seek are required to
access file data

Example :
MSDOS FAT file system

Operating Systems 97
File allocation - Indexed
Creates a table of
pointers(index) at the time
of the file creation. This
table is modified as new
blocks are allocated for the
file or removed from the file.
The index table is also
saved in a block/s.
Example : UNIX file system

Operating Systems 98
Formatting a
storage device
Hard disks, need to be formatted before using.
Formatting a disk configures the disk with a
file system so that OS can store information on
the disk.

Operating Systems 99
File Allocation Table(FAT)
 
FAT is the file systems used by Windows NT operating system.


FAT uses a file allocation
 table (FAT) to keep track of files in the
storage devices

FAT and the root directory reside at a fixed location of the
volume so that the system's boot files can be correctly located.
 
To protect a volume, two copies of the FAT are kept.

Operating Systems 100


New Technology
File System
NTFS (New Technology File System) is a proprietary file system
developed by Microsoft. This is improvement of FAT. This
improvements includes

The capability to recover from some
 disk-related errors
automatically, which FAT cannot.
  Improved support for larger hard disks.

Better security because you can use permissions
 and encryption to restrict
access to specific files to approved users.
NTFS is a recoverable file system which keeps track of
transactions against the file system in a log.

http://windows.microsoft.com/en-us/windows-vista/comparing-ntfs-and-fat-file-systems

Operating Systems 101


Memory Fragmentation
Fragmentation is the unintentional division of
memory into many small free areas that cannot
be used effectively.
• External Fragmentation – total memory
space exists to satisfy a request, but it is not
contiguous.
• Internal Fragmentation – allocated memory
may be slightly larger than requested memory
• This size difference is in memory internal to a
partition, hence cannot be used for any
other process.

Operating Systems 102


Memory Fragmentation ….
Compaction is a technique that can be used
to deal with (external) fragmentation by moving
partitions to bring many small free areas
together to form a single large free area.

Operating Systems 103


References
Operating System Concepts by Avi Silberschat, Peter Baer Galvin
and Greg Gagne
◦ http://codex.cs.yale.edu/avi/os-book/OS8/os8c/slide-dir/

Operating Systems 104

Você também pode gostar