SlideShare a Scribd company logo
1 of 18
8.1 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Paging
 Physical address space of a process can be noncontiguous;
process is allocated physical memory whenever the latter is
available
 Avoids external fragmentation
 Avoids problem of varying sized memory chunks
 Divide physical memory into fixed-sized blocks called frames
 Size is power of 2, between 512 bytes and 16 Mbytes
 Divide logical memory into blocks of same size called pages
 Keep track of all free frames
 To run a program of size N pages, need to find N free frames and
load program
 Set up a page table to translate logical to physical addresses
 Backing store likewise split into pages
 Still have Internal fragmentation
8.2 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Address Translation Scheme
 Address generated by CPU is divided into:
 Page number (p) – used as an index into a page table which
contains base address of each page in physical memory
 Page offset (d) – combined with base address to define the
physical memory address that is sent to the memory unit
 For given logical address space 2m and page size 2n
page number page offset
p d
m -n n
8.3 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Paging Hardware
8.4 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Paging Model of Logical and Physical Memory
8.5 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Paging Example
n=2 and m=4 32-byte memory and 4-byte pages
8.6 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Free Frames
 When a process arrives in the system to be executed, its size,
expressed in pages, is examined.
 Each page of the process needs one frame. Thus, if the process
requires n pages, at least n frames must be available in memory.
 If n frames are available, they are allocated to this arriving process.
 The first page of the process is loaded into one of the allocated
frames, and the frame number is put in the page table for this
process.
 The next page is loaded into another frame, its frame number is
put into the page table, and so on
8.7 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Free Frames
Before allocation After allocation
8.8 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Implementation of Page Table
 Page table is kept in main memory
 Page-table base register (PTBR) points to the page table
 Page-table length register (PTLR) indicates size of the page table
 In this scheme every data/instruction access requires two memory
accesses
 One for the page table and one for the data / instruction
 The two memory access problem can be solved by the use of a
special fast-lookup hardware cache called associative memory or
translation look-aside buffers (TLBs)
Problem : number of memory access (?)
8.9 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Implementation of Page Table (Cont.)
 Some TLBs store address-space identifiers (ASIDs) in each
TLB entry – uniquely identifies each process to provide
address-space protection for that process
 Otherwise need to flush at every context switch
 TLBs typically small (64 to 1,024 entries)
 On a TLB miss, value is loaded into the TLB for faster access
next time
 Replacement policies must be considered
 Some entries can be wired down for permanent fast
access
8.10 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Associative Memory
 Associative memory – parallel search
 Address translation (p, d)
 If p is in associative register, get frame # out
 Otherwise get frame # from page table in memory
Page # Frame #
8.11 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Paging Hardware With TLB
8.12 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Memory Protection
 Memory protection implemented by associating protection bit
with each frame to indicate if read-only or read-write access is
allowed
 Can also add more bits to indicate page execute-only, and
so on
 Valid-invalid bit attached to each entry in the page table:
 “valid” indicates that the associated page is in the
process’ logical address space, and is thus a legal page
 “invalid” indicates that the page is not in the process’
logical address space
 Or use page-table length register (PTLR)
 Any violations result in a trap to the kernel
8.13 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
 Suppose, for example, that in a system with a 14-bit address space (0 to
16383), we have a program that should use only addresses 0 to 10468.
 Given a page size of 2 KB, we have the situation shown in Figure 9.13.
 Addresses in pages 0, 1, 2, 3, 4, and 5 are mapped normally through the
page table.
 Any attempt to generate an address in pages 6 or 7, however, will find that
the valid –invalid bit is set to invalid, and the computer will trap to the
operating system (invalid page reference).
 Notice that this scheme has created a problem. Because the program
extends only to address 10468, any reference beyond that address is
illegal.
 However, references to page 5 are classified as valid, so accesses to
addresses up to 12287 are valid.
 Only the addresses from 12288 to 16383 are invalid.
 This problem is a result of the 2-KB page size and reflects the internal
fragmentation of paging
8.14 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Valid (v) or Invalid (i) Bit In A Page Table
8.15 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Shared Pages
 Shared code
 One copy of read-only (reentrant) code shared among
processes (i.e., text editors, compilers, window systems)
 Similar to multiple threads sharing the same process space
 Also useful for interprocess communication if sharing of
read-write pages is allowed
 Private code and data
 Each process keeps a separate copy of the code and data
 The pages for the private code and data can appear
anywhere in the logical address space
8.16 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Shared Pages Example
8.17 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Explanation
8.18 Silberschatz, Galvin and Gagne ©2013
Operating System Concepts – 9th Edition
Example: ARM Architecture
 Dominant mobile platform chip
(Apple iOS and Google Android
devices for example)
 Modern, energy efficient, 32-bit
CPU
 4 KB and 16 KB pages
 1 MB and 16 MB pages (termed
sections)
 One-level paging for sections, two-
level for smaller pages
 Two levels of TLBs
 Outer level has two micro
TLBs (one data, one
instruction)
 Inner is single main TLB
 First inner is checked, on
miss outers are checked,
and on miss page table
walk performed by CPU
outer page inner page offset
4-KB
or
16-KB
page
1-MB
or
16-MB
section
32 bits

More Related Content

What's hot

Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsWayne Jones Jnr
 
Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptinfomerlin
 
Inter process communication
Inter process communicationInter process communication
Inter process communicationRJ Mehul Gadhiya
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSUnited International University
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process managementArnav Chowdhury
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor schedulingShashank Kapoor
 
Memory management
Memory managementMemory management
Memory managementcpjcollege
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process CommunicationAdeel Rasheed
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on SegmentationPriyanka bisht
 

What's hot (20)

Demand paging
Demand pagingDemand paging
Demand paging
 
Chapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage SystemsChapter 12 - Mass Storage Systems
Chapter 12 - Mass Storage Systems
 
CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2CS6401 OPERATING SYSTEMS Unit 2
CS6401 OPERATING SYSTEMS Unit 2
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Contiguous Memory Allocation.ppt
Contiguous Memory Allocation.pptContiguous Memory Allocation.ppt
Contiguous Memory Allocation.ppt
 
Memory management
Memory managementMemory management
Memory management
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Sequential consistency model
Sequential consistency modelSequential consistency model
Sequential consistency model
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Free Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFSFree Space Management, Efficiency & Performance, Recovery and NFS
Free Space Management, Efficiency & Performance, Recovery and NFS
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Multi processor scheduling
Multi  processor schedulingMulti  processor scheduling
Multi processor scheduling
 
Memory management
Memory managementMemory management
Memory management
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
 
Distributed Coordination-Based Systems
Distributed Coordination-Based SystemsDistributed Coordination-Based Systems
Distributed Coordination-Based Systems
 
Shared memory
Shared memoryShared memory
Shared memory
 
Os Threads
Os ThreadsOs Threads
Os Threads
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Presentation on Segmentation
Presentation on SegmentationPresentation on Segmentation
Presentation on Segmentation
 

Similar to Paging.ppt

OS memory management
OS memory management OS memory management
OS memory management laiba29012
 
OS Memory Management.pptx
OS Memory Management.pptxOS Memory Management.pptx
OS Memory Management.pptxAkshimaPurohit
 
Main memory operating system
Main memory   operating systemMain memory   operating system
Main memory operating systemIndhu Periys
 
The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...OvhayKumar1
 
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgtch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgtaaravjamela
 
memory management.ppt
memory management.pptmemory management.ppt
memory management.pptAVUDAI1
 
ch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptptttttttttttttttttttttttttttch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptptttttttttttttttttttttttttttAmullyaPatil
 
cs8493 - operating systems unit 3
cs8493 - operating systems unit 3cs8493 - operating systems unit 3
cs8493 - operating systems unit 3SIMONTHOMAS S
 
Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )HimanshuSharma1389
 
ch8.pdf operating systems by galvin to learn
ch8.pdf operating systems by  galvin to learnch8.pdf operating systems by  galvin to learn
ch8.pdf operating systems by galvin to learnrajitha ellandula
 
Ch9: Memory Management
Ch9: Memory ManagementCh9: Memory Management
Ch9: Memory ManagementAhmar Hashmi
 

Similar to Paging.ppt (20)

Ch07
Ch07Ch07
Ch07
 
OS memory management
OS memory management OS memory management
OS memory management
 
OS Memory Management.pptx
OS Memory Management.pptxOS Memory Management.pptx
OS Memory Management.pptx
 
ch8.ppt
ch8.pptch8.ppt
ch8.ppt
 
ch8 (2).ppt
ch8 (2).pptch8 (2).ppt
ch8 (2).ppt
 
Main memory operating system
Main memory   operating systemMain memory   operating system
Main memory operating system
 
The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...The Council of Architecture (COA) has been constituted by the Government of I...
The Council of Architecture (COA) has been constituted by the Government of I...
 
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgtch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
ch8.ppt ejejnenjfjrnjnrjngjngktgtmtommgt
 
ch8.ppt
ch8.pptch8.ppt
ch8.ppt
 
memory management.ppt
memory management.pptmemory management.ppt
memory management.ppt
 
ch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptptttttttttttttttttttttttttttch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
ch8.ppt pptptptpptptptptpttttttttttttttttttttttttttt
 
cs8493 - operating systems unit 3
cs8493 - operating systems unit 3cs8493 - operating systems unit 3
cs8493 - operating systems unit 3
 
ch8.ppt
ch8.pptch8.ppt
ch8.ppt
 
Ch9
Ch9Ch9
Ch9
 
Memory Management
 Memory Management Memory Management
Memory Management
 
بيي
بييبيي
بيي
 
Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )Memory : operating system ( Btech cse )
Memory : operating system ( Btech cse )
 
ch8.pdf operating systems by galvin to learn
ch8.pdf operating systems by  galvin to learnch8.pdf operating systems by  galvin to learn
ch8.pdf operating systems by galvin to learn
 
Ch9: Memory Management
Ch9: Memory ManagementCh9: Memory Management
Ch9: Memory Management
 
Main memory-2 (ch8,os)
Main memory-2 (ch8,os)Main memory-2 (ch8,os)
Main memory-2 (ch8,os)
 

More from infomerlin

GSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptxGSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptxinfomerlin
 
Page Replacement Algorithms.pptx
Page Replacement Algorithms.pptxPage Replacement Algorithms.pptx
Page Replacement Algorithms.pptxinfomerlin
 
Segmentation.ppt
Segmentation.pptSegmentation.ppt
Segmentation.pptinfomerlin
 
Allocating of Frames.pptx
Allocating of Frames.pptxAllocating of Frames.pptx
Allocating of Frames.pptxinfomerlin
 
Allocating Kernel Memory.pptx
Allocating Kernel Memory.pptxAllocating Kernel Memory.pptx
Allocating Kernel Memory.pptxinfomerlin
 
Deadlock Detection.pptx
Deadlock Detection.pptxDeadlock Detection.pptx
Deadlock Detection.pptxinfomerlin
 
Deadlock Prevention.pptx
Deadlock Prevention.pptxDeadlock Prevention.pptx
Deadlock Prevention.pptxinfomerlin
 
Frame detection.pdf
Frame detection.pdfFrame detection.pdf
Frame detection.pdfinfomerlin
 
Deadlock Backgroud.pptx
Deadlock Backgroud.pptxDeadlock Backgroud.pptx
Deadlock Backgroud.pptxinfomerlin
 
5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptx5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptxinfomerlin
 
Lecture 4.pptx
Lecture 4.pptxLecture 4.pptx
Lecture 4.pptxinfomerlin
 
System Calls.ppt
System Calls.pptSystem Calls.ppt
System Calls.pptinfomerlin
 
Lec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.pptLec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.pptinfomerlin
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.pptinfomerlin
 
Lecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptxLecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptxinfomerlin
 
Noise in AM systems.ppt
Noise in AM systems.pptNoise in AM systems.ppt
Noise in AM systems.pptinfomerlin
 
Lecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptxLecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptxinfomerlin
 
Lecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptxLecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptxinfomerlin
 

More from infomerlin (20)

GSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptxGSC-21_029_4_09_TSDSI-R1-1.pptx
GSC-21_029_4_09_TSDSI-R1-1.pptx
 
sat-ppt.pptx
sat-ppt.pptxsat-ppt.pptx
sat-ppt.pptx
 
Page Replacement Algorithms.pptx
Page Replacement Algorithms.pptxPage Replacement Algorithms.pptx
Page Replacement Algorithms.pptx
 
Segmentation.ppt
Segmentation.pptSegmentation.ppt
Segmentation.ppt
 
Allocating of Frames.pptx
Allocating of Frames.pptxAllocating of Frames.pptx
Allocating of Frames.pptx
 
Allocating Kernel Memory.pptx
Allocating Kernel Memory.pptxAllocating Kernel Memory.pptx
Allocating Kernel Memory.pptx
 
Deadlock Detection.pptx
Deadlock Detection.pptxDeadlock Detection.pptx
Deadlock Detection.pptx
 
Deadlock Prevention.pptx
Deadlock Prevention.pptxDeadlock Prevention.pptx
Deadlock Prevention.pptx
 
Frame detection.pdf
Frame detection.pdfFrame detection.pdf
Frame detection.pdf
 
Deadlock Backgroud.pptx
Deadlock Backgroud.pptxDeadlock Backgroud.pptx
Deadlock Backgroud.pptx
 
5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptx5G Hackathon - Brainstorming Session.pptx
5G Hackathon - Brainstorming Session.pptx
 
LNA.ppt
LNA.pptLNA.ppt
LNA.ppt
 
Lecture 4.pptx
Lecture 4.pptxLecture 4.pptx
Lecture 4.pptx
 
System Calls.ppt
System Calls.pptSystem Calls.ppt
System Calls.ppt
 
Lec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.pptLec 6 OS structure and Operations.ppt
Lec 6 OS structure and Operations.ppt
 
cs-intro-os.ppt
cs-intro-os.pptcs-intro-os.ppt
cs-intro-os.ppt
 
Lecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptxLecture-2 Signal-Spectra-Modulation.pptx
Lecture-2 Signal-Spectra-Modulation.pptx
 
Noise in AM systems.ppt
Noise in AM systems.pptNoise in AM systems.ppt
Noise in AM systems.ppt
 
Lecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptxLecture 22 Threshold effects in FM.pptx
Lecture 22 Threshold effects in FM.pptx
 
Lecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptxLecture-5 AM Signal Generation – Type 1.pptx
Lecture-5 AM Signal Generation – Type 1.pptx
 

Recently uploaded

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 

Recently uploaded (20)

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 

Paging.ppt

  • 1. 8.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Paging  Physical address space of a process can be noncontiguous; process is allocated physical memory whenever the latter is available  Avoids external fragmentation  Avoids problem of varying sized memory chunks  Divide physical memory into fixed-sized blocks called frames  Size is power of 2, between 512 bytes and 16 Mbytes  Divide logical memory into blocks of same size called pages  Keep track of all free frames  To run a program of size N pages, need to find N free frames and load program  Set up a page table to translate logical to physical addresses  Backing store likewise split into pages  Still have Internal fragmentation
  • 2. 8.2 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Address Translation Scheme  Address generated by CPU is divided into:  Page number (p) – used as an index into a page table which contains base address of each page in physical memory  Page offset (d) – combined with base address to define the physical memory address that is sent to the memory unit  For given logical address space 2m and page size 2n page number page offset p d m -n n
  • 3. 8.3 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Paging Hardware
  • 4. 8.4 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Paging Model of Logical and Physical Memory
  • 5. 8.5 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Paging Example n=2 and m=4 32-byte memory and 4-byte pages
  • 6. 8.6 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Free Frames  When a process arrives in the system to be executed, its size, expressed in pages, is examined.  Each page of the process needs one frame. Thus, if the process requires n pages, at least n frames must be available in memory.  If n frames are available, they are allocated to this arriving process.  The first page of the process is loaded into one of the allocated frames, and the frame number is put in the page table for this process.  The next page is loaded into another frame, its frame number is put into the page table, and so on
  • 7. 8.7 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Free Frames Before allocation After allocation
  • 8. 8.8 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Implementation of Page Table  Page table is kept in main memory  Page-table base register (PTBR) points to the page table  Page-table length register (PTLR) indicates size of the page table  In this scheme every data/instruction access requires two memory accesses  One for the page table and one for the data / instruction  The two memory access problem can be solved by the use of a special fast-lookup hardware cache called associative memory or translation look-aside buffers (TLBs) Problem : number of memory access (?)
  • 9. 8.9 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Implementation of Page Table (Cont.)  Some TLBs store address-space identifiers (ASIDs) in each TLB entry – uniquely identifies each process to provide address-space protection for that process  Otherwise need to flush at every context switch  TLBs typically small (64 to 1,024 entries)  On a TLB miss, value is loaded into the TLB for faster access next time  Replacement policies must be considered  Some entries can be wired down for permanent fast access
  • 10. 8.10 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Associative Memory  Associative memory – parallel search  Address translation (p, d)  If p is in associative register, get frame # out  Otherwise get frame # from page table in memory Page # Frame #
  • 11. 8.11 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Paging Hardware With TLB
  • 12. 8.12 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Memory Protection  Memory protection implemented by associating protection bit with each frame to indicate if read-only or read-write access is allowed  Can also add more bits to indicate page execute-only, and so on  Valid-invalid bit attached to each entry in the page table:  “valid” indicates that the associated page is in the process’ logical address space, and is thus a legal page  “invalid” indicates that the page is not in the process’ logical address space  Or use page-table length register (PTLR)  Any violations result in a trap to the kernel
  • 13. 8.13 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition  Suppose, for example, that in a system with a 14-bit address space (0 to 16383), we have a program that should use only addresses 0 to 10468.  Given a page size of 2 KB, we have the situation shown in Figure 9.13.  Addresses in pages 0, 1, 2, 3, 4, and 5 are mapped normally through the page table.  Any attempt to generate an address in pages 6 or 7, however, will find that the valid –invalid bit is set to invalid, and the computer will trap to the operating system (invalid page reference).  Notice that this scheme has created a problem. Because the program extends only to address 10468, any reference beyond that address is illegal.  However, references to page 5 are classified as valid, so accesses to addresses up to 12287 are valid.  Only the addresses from 12288 to 16383 are invalid.  This problem is a result of the 2-KB page size and reflects the internal fragmentation of paging
  • 14. 8.14 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Valid (v) or Invalid (i) Bit In A Page Table
  • 15. 8.15 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Shared Pages  Shared code  One copy of read-only (reentrant) code shared among processes (i.e., text editors, compilers, window systems)  Similar to multiple threads sharing the same process space  Also useful for interprocess communication if sharing of read-write pages is allowed  Private code and data  Each process keeps a separate copy of the code and data  The pages for the private code and data can appear anywhere in the logical address space
  • 16. 8.16 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Shared Pages Example
  • 17. 8.17 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Explanation
  • 18. 8.18 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9th Edition Example: ARM Architecture  Dominant mobile platform chip (Apple iOS and Google Android devices for example)  Modern, energy efficient, 32-bit CPU  4 KB and 16 KB pages  1 MB and 16 MB pages (termed sections)  One-level paging for sections, two- level for smaller pages  Two levels of TLBs  Outer level has two micro TLBs (one data, one instruction)  Inner is single main TLB  First inner is checked, on miss outers are checked, and on miss page table walk performed by CPU outer page inner page offset 4-KB or 16-KB page 1-MB or 16-MB section 32 bits