SlideShare une entreprise Scribd logo
1  sur  26
- Raj Mohan. B
Stores all kind of data and information
1. Physical Memory- Total memory of the computer. EX: RAM
2. Logical Memory- CPU memory
3. Virtual memory- An imaginary memory area supported by
some operating systems (for example, Windows). It is an extension
of logical memory
 If the size of the program is greater than the available
memory size, then the concept of virtual memory is used
 Ever wondered how a 10GB Game like God Of War fits into
your 2GB RAM computer?
 Paging is a memory management technique in which the
memory is divided into fixed size pages.
 Paging is used for faster access to data.
 It is a logical concept
STATEMENT 1
STATEMENT 2
STATEMENT 3
STATEMENT 4
STATEMENT 5
STATEMENT 6
STATEMENT 7
Suppose a program X consists of 7
statements. But the memory can hold
only 4 statements, then Paging concept
is used.
PROGRAM X
STATEMENT 1
STATEMENT 2
STATEMENT 3
STATEMENT 4
STATEMENT 5
STATEMENT 6
STATEMENT 7
 Frames are physical concept
 It is present in the RAM
 We cannot see Pages, but we can see Frames
 Converting pages(virtual address) into frames (physical address)
 Enables program to be executed
 It is performed by the Memory Management Unit (M.M.U.)
CPU
(WHERE
PAGES ARE
DIVIDED)
MMU
Memory 1 Memory 2Virtual address
of
each page
Converts
virtual address
to physical
 If any error error occurs at
any physical address, it is
quickly retrieved from
memory and sent to the CPU
0 0 0 0 0 1 0 1 1 1 0 1 1 1 0
6-bit page # 10-bit offset #
16-bit logical address
0 0 0 0 1 0 1
1 0 0 0 1 1 0
0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0
Page Table
16-bit Physical address
 LOGICAL ADDRESS
PAGE NUMBER
(WHICH PAGE IS TO BE
SEARCHED IN THE MEMORY)
PAGE OFFSET
(WHICH BYTE OF DATA IS TO
BE READ FROM THAT PAGE)
MAXIMUM OF 6 BYTES MAXIMUM OF 10
BYTES
 PHYSICAL ADDRESS
FRAME NUMBER FRAME OFFSET
MAXIMUM OF 6 BYTES MAXIMUM OF 10 BYTES
LOGICAL ADDRESS
PAGE P0
P1
P2
P3
P4
P5
P6
P7
MAPPING
PHYSICAL
ADDRESS
P7
P2
P1
P5
FO
F1
F2
F3
page
frame 0
page
frame 1
page
frame 2
page
frame 3
physical memory
offset
physical address
F3’s Value
F3
F2
F0
page table(MMU)
offset
logical address
P=3
CPU
P0
P1
P2
P3
P4
P5
P6
P7
F1
The paging process is protected by the concept of
insertion of an additional bit called VALID/INVALID
BIT
Consider a 14 bit address space= 2^14=16383
bytes
Let us set an address limit of 10468
If five process are defined within this address
space (P0-P4), it is considered as a Valid bit
Process P5 has started before 10468, so that alone
is considered
The remaining processes are considered as Invalid
In this way the pages are internally fragmented
This is how Paging is protected
• No external
Fragmentation
• Simple memory
management
algorithm
• Swapping is easy
(Equal sized Pages
and Page Frames)
• Internal
fragmentation
• Page tables may
consume more
memory.
 Segmentation is one of the most common ways to achieve memory
protection.
 Because internal fragmentation of pages takes place, the user’s view of
memory is lost
 The user will view the memory as a combination of segments
 In this type, memory addresses used are not contiguous
 Each memory segment is associated with a specific length and a set of
permissions.
 When a process tries to access the memory it is first checked to see
whether it has the required permission to access the particular memory
segment and whether it is within the length specified by that particular
memory segment.
1
3
2
4
1
4
2
3
user space physical memory space
Free
Free
 Segment table - maps two-dimensional user defined address into one-
dimensional physical address
 base - starting physical address of the segment
 limit - length of segment
Logical Address space
Segment number
Offset
The maximum length of the offset value is 12 bits
Logical
Address
0<d<limit
 The advantage of segmentation is that the protection is associated
within the segments
 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
 Lends itself to sharing data
among processes.
 Lends itself to protection.
Costly memory management
algorithm
As processes are loaded and
removed from memory , the
free memory space is
broken into little pieces
,causing external
fragmentation
In a combined
paging/segmentation
system a user’s address
space is broken up into
a number of segments.
Each segment is broken
up into a number of
fixed-sized pages which
are equal in length to a
main memory frame
Segmentation is
visible to the
programmer
Paging is transparent
to the programmer
Paging and Segmentation in Operating System

Contenu connexe

Tendances

Virtual memory
Virtual memoryVirtual memory
Virtual memory
Anuj Modi
 

Tendances (20)

Memory management
Memory managementMemory management
Memory management
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Memory management
Memory managementMemory management
Memory management
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Memory management
Memory managementMemory management
Memory management
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Operating System-Ch8 memory management
Operating System-Ch8 memory managementOperating System-Ch8 memory management
Operating System-Ch8 memory management
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Cache memory ppt
Cache memory ppt  Cache memory ppt
Cache memory ppt
 
Memory management
Memory managementMemory management
Memory management
 
Memory allocation (4)
Memory allocation (4)Memory allocation (4)
Memory allocation (4)
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Virtual Memory
Virtual MemoryVirtual Memory
Virtual Memory
 
Memory management ppt
Memory management pptMemory management ppt
Memory management ppt
 
Synchronization hardware
Synchronization hardwareSynchronization hardware
Synchronization hardware
 
cache memory
cache memorycache memory
cache memory
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
Cache memory
Cache memoryCache memory
Cache memory
 

En vedette (7)

Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
 
Combined paging and segmentation
Combined paging and segmentationCombined paging and segmentation
Combined paging and segmentation
 
04 Cache Memory
04  Cache  Memory04  Cache  Memory
04 Cache Memory
 
Paging
PagingPaging
Paging
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Memory management
Memory managementMemory management
Memory management
 

Similaire à Paging and Segmentation in Operating System

Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
RohitPaul71
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
C.U
 

Similaire à Paging and Segmentation in Operating System (20)

Paging and Segmentation
Paging and SegmentationPaging and Segmentation
Paging and Segmentation
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Bab 4
Bab 4Bab 4
Bab 4
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
Paging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory managementPaging +Algorithem+Segmentation+memory management
Paging +Algorithem+Segmentation+memory management
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Ch8
Ch8Ch8
Ch8
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
Memory comp
Memory compMemory comp
Memory comp
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Memory management
Memory managementMemory management
Memory management
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
Operating System
Operating SystemOperating System
Operating System
 
Operating system
Operating systemOperating system
Operating system
 

Dernier

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
dharasingh5698
 

Dernier (20)

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 

Paging and Segmentation in Operating System

  • 2. Stores all kind of data and information
  • 3. 1. Physical Memory- Total memory of the computer. EX: RAM 2. Logical Memory- CPU memory 3. Virtual memory- An imaginary memory area supported by some operating systems (for example, Windows). It is an extension of logical memory
  • 4.  If the size of the program is greater than the available memory size, then the concept of virtual memory is used  Ever wondered how a 10GB Game like God Of War fits into your 2GB RAM computer?
  • 5.  Paging is a memory management technique in which the memory is divided into fixed size pages.  Paging is used for faster access to data.  It is a logical concept
  • 6. STATEMENT 1 STATEMENT 2 STATEMENT 3 STATEMENT 4 STATEMENT 5 STATEMENT 6 STATEMENT 7 Suppose a program X consists of 7 statements. But the memory can hold only 4 statements, then Paging concept is used. PROGRAM X STATEMENT 1 STATEMENT 2 STATEMENT 3 STATEMENT 4 STATEMENT 5 STATEMENT 6 STATEMENT 7
  • 7.  Frames are physical concept  It is present in the RAM  We cannot see Pages, but we can see Frames
  • 8.  Converting pages(virtual address) into frames (physical address)  Enables program to be executed  It is performed by the Memory Management Unit (M.M.U.) CPU (WHERE PAGES ARE DIVIDED) MMU Memory 1 Memory 2Virtual address of each page Converts virtual address to physical  If any error error occurs at any physical address, it is quickly retrieved from memory and sent to the CPU
  • 9. 0 0 0 0 0 1 0 1 1 1 0 1 1 1 0 6-bit page # 10-bit offset # 16-bit logical address 0 0 0 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 0 1 1 1 0 1 1 1 1 0 Page Table 16-bit Physical address
  • 10.  LOGICAL ADDRESS PAGE NUMBER (WHICH PAGE IS TO BE SEARCHED IN THE MEMORY) PAGE OFFSET (WHICH BYTE OF DATA IS TO BE READ FROM THAT PAGE) MAXIMUM OF 6 BYTES MAXIMUM OF 10 BYTES  PHYSICAL ADDRESS FRAME NUMBER FRAME OFFSET MAXIMUM OF 6 BYTES MAXIMUM OF 10 BYTES
  • 12. page frame 0 page frame 1 page frame 2 page frame 3 physical memory offset physical address F3’s Value F3 F2 F0 page table(MMU) offset logical address P=3 CPU P0 P1 P2 P3 P4 P5 P6 P7 F1
  • 13. The paging process is protected by the concept of insertion of an additional bit called VALID/INVALID BIT Consider a 14 bit address space= 2^14=16383 bytes Let us set an address limit of 10468 If five process are defined within this address space (P0-P4), it is considered as a Valid bit Process P5 has started before 10468, so that alone is considered The remaining processes are considered as Invalid In this way the pages are internally fragmented This is how Paging is protected
  • 14.
  • 15. • No external Fragmentation • Simple memory management algorithm • Swapping is easy (Equal sized Pages and Page Frames) • Internal fragmentation • Page tables may consume more memory.
  • 16.  Segmentation is one of the most common ways to achieve memory protection.  Because internal fragmentation of pages takes place, the user’s view of memory is lost  The user will view the memory as a combination of segments  In this type, memory addresses used are not contiguous  Each memory segment is associated with a specific length and a set of permissions.  When a process tries to access the memory it is first checked to see whether it has the required permission to access the particular memory segment and whether it is within the length specified by that particular memory segment.
  • 17. 1 3 2 4 1 4 2 3 user space physical memory space Free Free
  • 18.  Segment table - maps two-dimensional user defined address into one- dimensional physical address  base - starting physical address of the segment  limit - length of segment Logical Address space Segment number Offset The maximum length of the offset value is 12 bits
  • 20.
  • 21.  The advantage of segmentation is that the protection is associated within the segments  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
  • 22.
  • 23.  No internal fragmentation  Segment tables consume less memory than page  Lends itself to sharing data among processes.  Lends itself to protection. Costly memory management algorithm As processes are loaded and removed from memory , the free memory space is broken into little pieces ,causing external fragmentation
  • 24.
  • 25. In a combined paging/segmentation system a user’s address space is broken up into a number of segments. Each segment is broken up into a number of fixed-sized pages which are equal in length to a main memory frame Segmentation is visible to the programmer Paging is transparent to the programmer