SlideShare a Scribd company logo
1 of 32
 Paging
 Presenter Kosha Raval
 Segmentation
 Presenter Senaea Ukaji
 Physical memory is divided into fixed size-
blocks called FRAMES
 Logical memory is divided into blocks of the
same size called PAGES
A frame
 has the same size as a page
 is a place where a (logical) page can be
(physically) placed
Memory-management technique that permits the
physical address space of a process to be non-
contiguous
Address Mapping
 Every address generated by the CPU is divided
into two parts: Page number (p) and Page
offset (d)
 The page number is used as an index into a
Page Table
 The page size is defined by the hardware
 The size of a page is typically a power of 2,
varying between 512 bytes and 16MB per
page
 Reason: If the size of logical address is 2^m
and page size is 2^n, then the high-order
m-n bits of a logical address designate the
page number
Paging Hardware
Paging Hardware
 When we use a paging scheme, we have no
external fragmentation: ANY free frame can be
allocated to a process that needs it.
 However, we may have internal fragmentation
 If the process requires n pages, at least n
frames are required
 The first page of the process is loaded into the
first frame listed on free-frame list, and the
frame number is put into page table
Paging Example
Paging Example
Paging Example
 To implement paging, the simplest method
is to implement the page table as a set of
registers
 However, the size of register is limited and
the size of page table is usually large
 Therefore, the page table is kept in main
memory
MMU Address Transaction
 If we want to access any location, we
must first index into the page table
 This requires atleast one memory access
 The standard solution is to use a special,
small, fast cache, called Translation
look-aside buffer (TLB) or associative
memory
TLB-Assisted Transaction
 If the page number is not in the TLB (TLB
miss) a memory reference to the page
table must be made.
 In addition, we add the page number and
frame number into TLB
 If the TLB already full, the OS have to
must select one for replacement
 Some TLBs allow entries to be wire down,
meaning that they cannot be removed
from the TLB, for example kernel codes
 The percentage of times that a particular
page number is found in the TLN is
called hit ratio
 If it takes 20 nanosecond to search the
TLB and 100 nanosecond to access
memory
ADVANTAGES
 No external Fragmentation
 Simple memory management algorithm
 Swapping is easy (Equal sized Pages and Page
Frames)
 Share common code especially in a time-sharing
environment
DISADVANTAGES
 Internal fragmentation
 Page tables may consume more memory.
 Multi level paging leads to memory
reference overhead.
There is another way in which addressable memory
can be subdivided, known as
segmentation
 An important part of the memory management is
that become unavoidable with paging is the
separation of the user’s view of the memory and
the actual physical memory
 The users view is mapped to the physical memory
 Thus the differentiation comes between the logical
and physical memory.
Do users view memory as
linear array of bytes some
containing instruction and
other containing data???
No…Rather they would see it
as collection of
segments…….
 User View of logical memory
◦ Linear array of bytes
 Reflected by the ‘Paging’ memory
scheme
◦ A collection of variable-sized
entities
 User thinks in terms of “subroutines”,
“stack”, “symbol table”, “main program”
which are somehow located somewhere
in memory.]
 Segmentation supports this user
view. The logical address space
is a collection of segments.
 Although the user can refer to objects in the
program by a two-dimensional address, the actual
physical address is still a one-dimensional
sequence
 Thus, we need to map the segment number
 This mapping is effected by a segment table
 In order to protect the memory space, each entry in
segment table has a segment base and a segment
limit
Logical Address space
Segment number
Offset
The mapping of the logical address to the physical address is done
with the help of the segment table.
Segment Limit Segment Base Other bits
A bit is needed to determine if the segment
is already in main memory (P)
Another bit is needed to determine if the
segment has been modified since it was
loaded in main memory (M)
the length of the
segment SEGMENT TABLE
starting address of the
corresponding segment
in main memory
 Segments are variable-sized
◦ Dynamic memory allocation required (first fit, best fit, worst fit).
 External fragmentation
◦ In the worst case the largest hole may not be large enough to fit
in a new segment. Note that paging has no external fragmentation
problem.
 Each process has its own segment table
◦ like with paging where each process has its own page table. The
size of the segment table is determined by the number of
segments, whereas the size of the page table depends on the total
amount of memory occupied.
 Segment table located in main memory
◦ as is the page table with paging
 Segment table base register (STBR)
◦ points to current segment table in memory
 Segment table length register (STLR)
◦ indicates number of segments
 Segmentation lends itself to the
implementation of protection and sharing
policies
 Each entry has a base address and length so
inadvertent memory access can be controlled
 Sharing can be achieved by segments
referencing multiple processes
 Two processes that need to share access to a
single segment would have the same segment
name and address in their segment tables.
 No internal fragmentation
 Segment tables consume less memory than
page tables ( only one entry per actual segment
as opposed to one entry per page in Paging
method)
 Because of the small segment table, memory
reference is easy
 Lends itself to sharing data among processes.
 Lends itself to protection.
 As the individual lines of a page do not form
one logical unit, it is not possible to set a
particular access right to a page.
 Note that each segment could be set up an
access right
 External fragmentation.
 Costly memory management algorithm
 Unequal size of segments is not good in the
case of swapping.
 With paging physical memory is divided into fixed-
size frames. When memory space is needed, as many
free frames are occupied as necessary. These frames
can be located anywhere in memory, the user process
always sees a logical contiguous address space
 With segmentation the memory is not systematically
divided. When a program needs k segments (usually
these have different sizes), the OS tries to place these
segments in the available memory holes. The
segments can be scattered around memory. The user
process does not see a contiguous address space, but
sees a collection of segments (of course each
individual segment is contiguous as is each page or
frame).
Paging Segmentation
 Each process is assigned
its page table.
 Page table size
proportional to allocated
memory
 Often large page tables
and/or multi-level
paging
 Internal fragmentation
 Free memory is quickly
allocated to a process
 Each process is assigned
a segment table
 Segment table size
proportional to number
of segments
 Usually small segment
tables
 External fragmentation.
 Lengthy search times
when allocating memory
to a process.
Thank You

More Related Content

What's hot

Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
Ravindra Raju Kolahalam
 

What's hot (20)

File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Operating Systems: Device Management
Operating Systems: Device ManagementOperating Systems: Device Management
Operating Systems: Device Management
 
Scheduling algorithms
Scheduling algorithmsScheduling algorithms
Scheduling algorithms
 
Memory management
Memory managementMemory management
Memory management
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Swapping | Computer Science
Swapping | Computer ScienceSwapping | Computer Science
Swapping | Computer Science
 
Paging and Segmentation in Operating System
Paging and Segmentation in Operating SystemPaging and Segmentation in Operating System
Paging and Segmentation in Operating System
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Concurrency Control in Database Management System
Concurrency Control in Database Management SystemConcurrency Control in Database Management System
Concurrency Control in Database Management System
 
Deadlock
DeadlockDeadlock
Deadlock
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computing
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Memory organization in computer architecture
Memory organization in computer architectureMemory organization in computer architecture
Memory organization in computer architecture
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
Threads (operating System)
Threads (operating System)Threads (operating System)
Threads (operating System)
 

Viewers also liked

Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentation
Tech_MX
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48
myrajendra
 
Index allocation 48 1
Index allocation 48 1Index allocation 48 1
Index allocation 48 1
myrajendra
 
Secondary storage management in os
Secondary storage management in osSecondary storage management in os
Secondary storage management in os
Sumant Diwakar
 

Viewers also liked (14)

Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentation
 
Operation System
Operation SystemOperation System
Operation System
 
File System and File allocation tables
File System and File allocation tablesFile System and File allocation tables
File System and File allocation tables
 
Linked allocation 48
Linked  allocation 48Linked  allocation 48
Linked allocation 48
 
Index allocation 48 1
Index allocation 48 1Index allocation 48 1
Index allocation 48 1
 
Secondary storage management in os
Secondary storage management in osSecondary storage management in os
Secondary storage management in os
 
ITFT_File system interface in Operating System
ITFT_File system interface in Operating SystemITFT_File system interface in Operating System
ITFT_File system interface in Operating System
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
 
Memory management
Memory managementMemory management
Memory management
 

Similar to Paging and segmentation

Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
C.U
 

Similar to Paging and segmentation (20)

CSI-503 - 8.Paging and Segmentation
CSI-503 - 8.Paging and SegmentationCSI-503 - 8.Paging and Segmentation
CSI-503 - 8.Paging and Segmentation
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
os presentation.ppt
os presentation.pptos presentation.ppt
os presentation.ppt
 
os ppt.pptx
os  ppt.pptxos  ppt.pptx
os ppt.pptx
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Memory comp
Memory compMemory comp
Memory comp
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Memory management Assignment Help
Memory management Assignment HelpMemory management Assignment Help
Memory management Assignment Help
 
unit5_os (1).pptx
unit5_os (1).pptxunit5_os (1).pptx
unit5_os (1).pptx
 
Cs416 08 09a
Cs416 08 09aCs416 08 09a
Cs416 08 09a
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
Ch8
Ch8Ch8
Ch8
 
Bab 4
Bab 4Bab 4
Bab 4
 
Csc4320 chapter 8 2
Csc4320 chapter 8 2Csc4320 chapter 8 2
Csc4320 chapter 8 2
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
 
Os unit 2
Os unit 2Os unit 2
Os unit 2
 
Memory management ppt coa
Memory management ppt coaMemory management ppt coa
Memory management ppt coa
 

More from Piyush Rochwani (20)

Unit 2
Unit 2Unit 2
Unit 2
 
Unit 3
Unit 3Unit 3
Unit 3
 
Biometrics based key generation
Biometrics based key generationBiometrics based key generation
Biometrics based key generation
 
Serial transmission
Serial transmissionSerial transmission
Serial transmission
 
Sequential and combinational alu
Sequential and combinational alu Sequential and combinational alu
Sequential and combinational alu
 
Memory virtualization
Memory virtualizationMemory virtualization
Memory virtualization
 
Risc
RiscRisc
Risc
 
Raid
Raid Raid
Raid
 
Pipelining and co processor.
Pipelining and co processor.Pipelining and co processor.
Pipelining and co processor.
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
8086 Microprocessor
8086 Microprocessor8086 Microprocessor
8086 Microprocessor
 
Dma
DmaDma
Dma
 
Control unit
Control unitControl unit
Control unit
 
Memory types
Memory typesMemory types
Memory types
 
Solid state solid state drives
Solid state solid state drivesSolid state solid state drives
Solid state solid state drives
 
Coa INTERUPT
Coa INTERUPTCoa INTERUPT
Coa INTERUPT
 
Cisc(a022& a023)
Cisc(a022& a023)Cisc(a022& a023)
Cisc(a022& a023)
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
 
06 floating point
06 floating point06 floating point
06 floating point
 
05 multiply divide
05 multiply divide05 multiply divide
05 multiply divide
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Paging and segmentation

  • 1.
  • 2.  Paging  Presenter Kosha Raval  Segmentation  Presenter Senaea Ukaji
  • 3.  Physical memory is divided into fixed size- blocks called FRAMES  Logical memory is divided into blocks of the same size called PAGES A frame  has the same size as a page  is a place where a (logical) page can be (physically) placed Memory-management technique that permits the physical address space of a process to be non- contiguous
  • 5.
  • 6.  Every address generated by the CPU is divided into two parts: Page number (p) and Page offset (d)
  • 7.  The page number is used as an index into a Page Table  The page size is defined by the hardware  The size of a page is typically a power of 2, varying between 512 bytes and 16MB per page  Reason: If the size of logical address is 2^m and page size is 2^n, then the high-order m-n bits of a logical address designate the page number Paging Hardware
  • 9.  When we use a paging scheme, we have no external fragmentation: ANY free frame can be allocated to a process that needs it.  However, we may have internal fragmentation  If the process requires n pages, at least n frames are required  The first page of the process is loaded into the first frame listed on free-frame list, and the frame number is put into page table Paging Example
  • 12.  To implement paging, the simplest method is to implement the page table as a set of registers  However, the size of register is limited and the size of page table is usually large  Therefore, the page table is kept in main memory
  • 14.  If we want to access any location, we must first index into the page table  This requires atleast one memory access  The standard solution is to use a special, small, fast cache, called Translation look-aside buffer (TLB) or associative memory
  • 16.  If the page number is not in the TLB (TLB miss) a memory reference to the page table must be made.  In addition, we add the page number and frame number into TLB  If the TLB already full, the OS have to must select one for replacement  Some TLBs allow entries to be wire down, meaning that they cannot be removed from the TLB, for example kernel codes  The percentage of times that a particular page number is found in the TLN is called hit ratio  If it takes 20 nanosecond to search the TLB and 100 nanosecond to access memory
  • 17. ADVANTAGES  No external Fragmentation  Simple memory management algorithm  Swapping is easy (Equal sized Pages and Page Frames)  Share common code especially in a time-sharing environment DISADVANTAGES  Internal fragmentation  Page tables may consume more memory.  Multi level paging leads to memory reference overhead.
  • 18. There is another way in which addressable memory can be subdivided, known as segmentation
  • 19.  An important part of the memory management is that become unavoidable with paging is the separation of the user’s view of the memory and the actual physical memory  The users view is mapped to the physical memory  Thus the differentiation comes between the logical and physical memory. Do users view memory as linear array of bytes some containing instruction and other containing data??? No…Rather they would see it as collection of segments…….
  • 20.  User View of logical memory ◦ Linear array of bytes  Reflected by the ‘Paging’ memory scheme ◦ A collection of variable-sized entities  User thinks in terms of “subroutines”, “stack”, “symbol table”, “main program” which are somehow located somewhere in memory.]  Segmentation supports this user view. The logical address space is a collection of segments.
  • 21.  Although the user can refer to objects in the program by a two-dimensional address, the actual physical address is still a one-dimensional sequence  Thus, we need to map the segment number  This mapping is effected by a segment table  In order to protect the memory space, each entry in segment table has a segment base and a segment limit
  • 22. Logical Address space Segment number Offset The mapping of the logical address to the physical address is done with the help of the segment table. Segment Limit Segment Base Other bits A bit is needed to determine if the segment is already in main memory (P) Another bit is needed to determine if the segment has been modified since it was loaded in main memory (M) the length of the segment SEGMENT TABLE starting address of the corresponding segment in main memory
  • 23.  Segments are variable-sized ◦ Dynamic memory allocation required (first fit, best fit, worst fit).  External fragmentation ◦ In the worst case the largest hole may not be large enough to fit in a new segment. Note that paging has no external fragmentation problem.  Each process has its own segment table ◦ like with paging where each process has its own page table. The size of the segment table is determined by the number of segments, whereas the size of the page table depends on the total amount of memory occupied.  Segment table located in main memory ◦ as is the page table with paging  Segment table base register (STBR) ◦ points to current segment table in memory  Segment table length register (STLR) ◦ indicates number of segments
  • 24.
  • 25.
  • 26.  Segmentation lends itself to the implementation of protection and sharing policies  Each entry has a base address and length so inadvertent memory access can be controlled  Sharing can be achieved by segments referencing multiple processes  Two processes that need to share access to a single segment would have the same segment name and address in their segment tables.
  • 27.  No internal fragmentation  Segment tables consume less memory than page tables ( only one entry per actual segment as opposed to one entry per page in Paging method)  Because of the small segment table, memory reference is easy  Lends itself to sharing data among processes.  Lends itself to protection.  As the individual lines of a page do not form one logical unit, it is not possible to set a particular access right to a page.  Note that each segment could be set up an access right
  • 28.  External fragmentation.  Costly memory management algorithm  Unequal size of segments is not good in the case of swapping.
  • 29.  With paging physical memory is divided into fixed- size frames. When memory space is needed, as many free frames are occupied as necessary. These frames can be located anywhere in memory, the user process always sees a logical contiguous address space  With segmentation the memory is not systematically divided. When a program needs k segments (usually these have different sizes), the OS tries to place these segments in the available memory holes. The segments can be scattered around memory. The user process does not see a contiguous address space, but sees a collection of segments (of course each individual segment is contiguous as is each page or frame).
  • 30.
  • 31. Paging Segmentation  Each process is assigned its page table.  Page table size proportional to allocated memory  Often large page tables and/or multi-level paging  Internal fragmentation  Free memory is quickly allocated to a process  Each process is assigned a segment table  Segment table size proportional to number of segments  Usually small segment tables  External fragmentation.  Lengthy search times when allocating memory to a process.

Editor's Notes

  1. explAINATION From handout pdf slide 11 12 13