SlideShare une entreprise Scribd logo
1  sur  20
Memory Map
Paging
• In protected mode linear address space is
mapped directly into a large physical memory
• Or indirectly (using paging) into a smaller
physical memory & disk storage.
• This second method of mapping the linear
address space is referred as virtual memory or
demand paged virtual memory
Paging
• Paging is another type of memory
management useful for virtual memory
multitasking operating systems
• Freed space of an outgoing task always same
as that needed for an incoming task
Paging
• Linear address space is divided into fixed size pages
• Pages can directly mapped into physical memory
and/or disk storage
• A page most likely corresponds to only a portion of
a module or data structure
Paging
• Page –
– Fixed Size
– May include Code/Data/Stack
– Linear address is used to generate address of a
page
• A program on HDD is looked at as collection of
same sized pages
Paging
• Fixed size
• Data structures and
program modules can be
partly in memory and
partly in disk storage
• Pages bear no direct
relation to the logical
structure of a program
Segmentation
• Size same as the code or
data structures they hold
• Data structures and
program modules will
have all its parts in
memory
• While segment selectors
can be considered the
logical ``name'' of a
program module or data
structure,
Advantages
• A uniform size of 4KB for all of the elements
simplifies memory allocation and reallocation
schemes, since there is no problem with
memory fragmentation.
Important Bits
Components of
the paging mechanism
• The page directory
• The page tables
• The page itself (page frame)
HDD
P2.1
P1.0
P2.0
P3.0
P1.1
P1.2
P2.2
P2.3
FREE Page
P1.0
P1.1
P1.2
P2.0
P2.1
P2.2
P2.3
P3.0
0
1
2
3
4
5
6
7
8
Page
No.
Base
address
0 0
1 2
2 5
Page
No.
Base
address
0 3
Page No. Base
address
0 1
1 4
2 6
3 7
PMT : P3 process
PMT : P1 process
PMT : P2 process
HDD
Page Map Table, Page Directory
• Pages of a unique program are tabulated in a
table – page Map table
• Base addresses of All page tables are
tabulated in a directory
• Every application loaded has a unique page
table
Page Directory
• Tabulates information about all page tables in
memory
• Every record is called a Page Directory Entry
(PDE)
• Processor provides a special register viz CR3 to
hold base address of this directory.
• CR3 is known as Page Directory Base Register
(PDBR)
Paging Exceptions
Page Directory Entry
Page Table Base Address OS
Reserved
(User)
0 0 D
(U)
A 0 0 U/S R/
W
P
31 12 11 10 9 8 7 6 5 4 3 2 1 0
Pg Size –
‘0’  4KB
Whether a page table
-
A – Accessed
P – Present
Access Rights
U/S –
‘0’ – table is assigned supervisor privilege level
‘1’ – table is assigned user level privilege level
R/W -
Read Write privileges for a group of pages i.e. table
PAGE TABLES
• Each Page Table is 4K bytes and holds up to
1024 Page Table Entries.
• Page Table Entries contain the starting address
of the page frame and statistical information
about the page
• Page tables can be shared between tasks and
swapped to disks.
Page Table Entry
PAGE FRAME ADDRESS
31..12
OS
Reserved
(User)
0 0 D A 0 0 U/S R/
W
P
31 12 11 10 9 8 7 6 5 4 3 2 1 0
Whether a page
D - Dirty
A – Accessed
P – Present
Access Rights
U/S –
‘0’ – table is assigned supervisor privilege level
‘1’ – table is assigned user level privilege level
R/W -
Read Write privileges for a group of pages i.e. table
Non Present Page directory or Page Table entry
31 1 P
Available to operating system for use 0
LINEAR ADDRESS TRANSLATION (4-KBYTE PAGES)
To select the various table entries, the linear address is
divided into three sections:
• Page-directory entry—Bits 22 through 31 provide an offset
to an entry in the page directory. The selected entry provides
the physical base address of a page table.
• Page-table entry—Bits 12 through 21 of the linear address
provide an offset to an entry in the selected page table. This
entry provides the physical base address of a page in physical
memory.
• Page offset—Bits 0 through 11 provides an offset to a
physical address in the page.
Linear Address Translation - (4 KB Pages)
Directory Entry Page Table Entry
4KB page
PDBR
Index to Directory Index to Table Offset in Page
31 22 21 12 11 0
Page Directory Page Table
Page
CR3
Virtual address 801C3400H
Directory Entry
000E4000
Page Table Entry
00028000
PDBR
Index to Directory Index to Table Offset in Page
1000000000 0111000011 010000000000
Page Directory Page Table
CR3
200H
1C3H
400H
+
Physical address
00028400H

Contenu connexe

Tendances

Process management os concept
Process management os conceptProcess management os concept
Process management os conceptpriyadeosarkar91
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionBipul Chandra Kar
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating SystemJanki Shah
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory managementrprajat007
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memorysgpraju
 
Kernel mode vs user mode in linux
Kernel mode vs user mode in linuxKernel mode vs user mode in linux
Kernel mode vs user mode in linuxSiddique Ibrahim
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader ExplainedAdarsh Kr Sinha
 
Virtual memory
Virtual memoryVirtual memory
Virtual memoryAnuj Modi
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and ArchitectureVinit Raut
 

Tendances (20)

CPU Scheduling Algorithms
CPU Scheduling AlgorithmsCPU Scheduling Algorithms
CPU Scheduling Algorithms
 
File system structure
File system structureFile system structure
File system structure
 
System calls
System callsSystem calls
System calls
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Peterson Critical Section Problem Solution
Peterson Critical Section Problem SolutionPeterson Critical Section Problem Solution
Peterson Critical Section Problem Solution
 
operating system structure
operating system structureoperating system structure
operating system structure
 
File Management in Operating System
File Management in Operating SystemFile Management in Operating System
File Management in Operating System
 
Virtual memory ppt
Virtual memory pptVirtual memory ppt
Virtual memory ppt
 
Memory management
Memory managementMemory management
Memory management
 
Kernels and its types
Kernels and its typesKernels and its types
Kernels and its types
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
mano.ppt
mano.pptmano.ppt
mano.ppt
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Kernel mode vs user mode in linux
Kernel mode vs user mode in linuxKernel mode vs user mode in linux
Kernel mode vs user mode in linux
 
Linker and Loader Explained
Linker and Loader  ExplainedLinker and Loader  Explained
Linker and Loader Explained
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and Architecture
 
process creation OS
process creation OSprocess creation OS
process creation OS
 

En vedette

Address mapping
Address mappingAddress mapping
Address mappingrockymani
 
The logic behind choosing logic controllers
The logic behind choosing logic controllersThe logic behind choosing logic controllers
The logic behind choosing logic controllersOptima Control Solutions
 
Chapter 6 Lecture Disco 4e
Chapter 6 Lecture Disco 4eChapter 6 Lecture Disco 4e
Chapter 6 Lecture Disco 4eprofessorbent
 
Microprocessor 8085 Chapter 3
Microprocessor 8085 Chapter 3Microprocessor 8085 Chapter 3
Microprocessor 8085 Chapter 3Rishikesh Bhavsar
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture pptParvesh Gautam
 

En vedette (7)

Address mapping
Address mappingAddress mapping
Address mapping
 
The logic behind choosing logic controllers
The logic behind choosing logic controllersThe logic behind choosing logic controllers
The logic behind choosing logic controllers
 
Chapter 6 Lecture Disco 4e
Chapter 6 Lecture Disco 4eChapter 6 Lecture Disco 4e
Chapter 6 Lecture Disco 4e
 
Microprocessor 8085 Chapter 3
Microprocessor 8085 Chapter 3Microprocessor 8085 Chapter 3
Microprocessor 8085 Chapter 3
 
Memory mapping
Memory mappingMemory mapping
Memory mapping
 
Memory Mapping Cache
Memory Mapping CacheMemory Mapping Cache
Memory Mapping Cache
 
8085 microprocessor architecture ppt
8085 microprocessor architecture ppt8085 microprocessor architecture ppt
8085 microprocessor architecture ppt
 

Similaire à Memory map

Lecture storage-buffer
Lecture storage-bufferLecture storage-buffer
Lecture storage-bufferKlaas Krona
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdfHarika Pudugosula
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptxSourabhRaj29
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxImranBhatti58
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptxRohitPaul71
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsDrishti Bhalla
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memoryMazin Alwaaly
 
How Data Instant Replay and Data Progression Work Together
How Data Instant Replay and Data Progression Work TogetherHow Data Instant Replay and Data Progression Work Together
How Data Instant Replay and Data Progression Work TogetherCompellent Technologies
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OSC.U
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptxItechAnand1
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003Prashant odhavani
 
Apache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversApache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversScyllaDB
 

Similaire à Memory map (20)

Os4
Os4Os4
Os4
 
Os4
Os4Os4
Os4
 
Lecture storage-buffer
Lecture storage-bufferLecture storage-buffer
Lecture storage-buffer
 
Memory Management Strategies - III.pdf
Memory Management Strategies - III.pdfMemory Management Strategies - III.pdf
Memory Management Strategies - III.pdf
 
Unit 5Memory management.pptx
Unit 5Memory management.pptxUnit 5Memory management.pptx
Unit 5Memory management.pptx
 
PAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docxPAGIN AND SEGMENTATION.docx
PAGIN AND SEGMENTATION.docx
 
Memory+management
Memory+managementMemory+management
Memory+management
 
Chapter 8 - Main Memory
Chapter 8 - Main MemoryChapter 8 - Main Memory
Chapter 8 - Main Memory
 
Memory Managment(OS).pptx
Memory Managment(OS).pptxMemory Managment(OS).pptx
Memory Managment(OS).pptx
 
Unix Memory Management - Operating Systems
Unix Memory Management - Operating SystemsUnix Memory Management - Operating Systems
Unix Memory Management - Operating Systems
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
How Data Instant Replay and Data Progression Work Together
How Data Instant Replay and Data Progression Work TogetherHow Data Instant Replay and Data Progression Work Together
How Data Instant Replay and Data Progression Work Together
 
08 operating system support
08 operating system support08 operating system support
08 operating system support
 
OSCh9
OSCh9OSCh9
OSCh9
 
Ch9 OS
Ch9 OSCh9 OS
Ch9 OS
 
OS_Ch9
OS_Ch9OS_Ch9
OS_Ch9
 
Unit-4 swapping.pptx
Unit-4 swapping.pptxUnit-4 swapping.pptx
Unit-4 swapping.pptx
 
Main memory os - prashant odhavani- 160920107003
Main memory   os - prashant odhavani- 160920107003Main memory   os - prashant odhavani- 160920107003
Main memory os - prashant odhavani- 160920107003
 
Apache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the CoversApache Iceberg: An Architectural Look Under the Covers
Apache Iceberg: An Architectural Look Under the Covers
 
Ppt
PptPpt
Ppt
 

Plus de aviban

Signal descriptors of 8086
Signal descriptors of 8086Signal descriptors of 8086
Signal descriptors of 8086aviban
 
Segments
SegmentsSegments
Segmentsaviban
 
Salient featurs of 80386
Salient featurs of 80386Salient featurs of 80386
Salient featurs of 80386aviban
 
Register of 80386
Register of 80386Register of 80386
Register of 80386aviban
 
Number system
Number systemNumber system
Number systemaviban
 
Modes of 80386
Modes of 80386Modes of 80386
Modes of 80386aviban
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontrolleraviban
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086aviban
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setaviban
 
Additional good diagrams
Additional good diagramsAdditional good diagrams
Additional good diagramsaviban
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptaviban
 
Applications of Discrete Structures
Applications of Discrete StructuresApplications of Discrete Structures
Applications of Discrete Structuresaviban
 

Plus de aviban (13)

Signal descriptors of 8086
Signal descriptors of 8086Signal descriptors of 8086
Signal descriptors of 8086
 
Segments
SegmentsSegments
Segments
 
Salient featurs of 80386
Salient featurs of 80386Salient featurs of 80386
Salient featurs of 80386
 
Register of 80386
Register of 80386Register of 80386
Register of 80386
 
Number system
Number systemNumber system
Number system
 
Modes of 80386
Modes of 80386Modes of 80386
Modes of 80386
 
Microprocessor vs. microcontroller
Microprocessor vs. microcontrollerMicroprocessor vs. microcontroller
Microprocessor vs. microcontroller
 
Ma
MaMa
Ma
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Flag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction setFlag registers, addressing modes, instruction set
Flag registers, addressing modes, instruction set
 
Additional good diagrams
Additional good diagramsAdditional good diagrams
Additional good diagrams
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 ppt
 
Applications of Discrete Structures
Applications of Discrete StructuresApplications of Discrete Structures
Applications of Discrete Structures
 

Memory map

  • 2. Paging • In protected mode linear address space is mapped directly into a large physical memory • Or indirectly (using paging) into a smaller physical memory & disk storage. • This second method of mapping the linear address space is referred as virtual memory or demand paged virtual memory
  • 3. Paging • Paging is another type of memory management useful for virtual memory multitasking operating systems • Freed space of an outgoing task always same as that needed for an incoming task
  • 4. Paging • Linear address space is divided into fixed size pages • Pages can directly mapped into physical memory and/or disk storage • A page most likely corresponds to only a portion of a module or data structure
  • 5. Paging • Page – – Fixed Size – May include Code/Data/Stack – Linear address is used to generate address of a page • A program on HDD is looked at as collection of same sized pages
  • 6. Paging • Fixed size • Data structures and program modules can be partly in memory and partly in disk storage • Pages bear no direct relation to the logical structure of a program Segmentation • Size same as the code or data structures they hold • Data structures and program modules will have all its parts in memory • While segment selectors can be considered the logical ``name'' of a program module or data structure,
  • 7. Advantages • A uniform size of 4KB for all of the elements simplifies memory allocation and reallocation schemes, since there is no problem with memory fragmentation.
  • 9. Components of the paging mechanism • The page directory • The page tables • The page itself (page frame)
  • 10. HDD P2.1 P1.0 P2.0 P3.0 P1.1 P1.2 P2.2 P2.3 FREE Page P1.0 P1.1 P1.2 P2.0 P2.1 P2.2 P2.3 P3.0 0 1 2 3 4 5 6 7 8 Page No. Base address 0 0 1 2 2 5 Page No. Base address 0 3 Page No. Base address 0 1 1 4 2 6 3 7 PMT : P3 process PMT : P1 process PMT : P2 process HDD
  • 11. Page Map Table, Page Directory • Pages of a unique program are tabulated in a table – page Map table • Base addresses of All page tables are tabulated in a directory • Every application loaded has a unique page table
  • 12. Page Directory • Tabulates information about all page tables in memory • Every record is called a Page Directory Entry (PDE) • Processor provides a special register viz CR3 to hold base address of this directory. • CR3 is known as Page Directory Base Register (PDBR)
  • 14. Page Directory Entry Page Table Base Address OS Reserved (User) 0 0 D (U) A 0 0 U/S R/ W P 31 12 11 10 9 8 7 6 5 4 3 2 1 0 Pg Size – ‘0’  4KB Whether a page table - A – Accessed P – Present Access Rights U/S – ‘0’ – table is assigned supervisor privilege level ‘1’ – table is assigned user level privilege level R/W - Read Write privileges for a group of pages i.e. table
  • 15. PAGE TABLES • Each Page Table is 4K bytes and holds up to 1024 Page Table Entries. • Page Table Entries contain the starting address of the page frame and statistical information about the page • Page tables can be shared between tasks and swapped to disks.
  • 16. Page Table Entry PAGE FRAME ADDRESS 31..12 OS Reserved (User) 0 0 D A 0 0 U/S R/ W P 31 12 11 10 9 8 7 6 5 4 3 2 1 0 Whether a page D - Dirty A – Accessed P – Present Access Rights U/S – ‘0’ – table is assigned supervisor privilege level ‘1’ – table is assigned user level privilege level R/W - Read Write privileges for a group of pages i.e. table
  • 17. Non Present Page directory or Page Table entry 31 1 P Available to operating system for use 0
  • 18. LINEAR ADDRESS TRANSLATION (4-KBYTE PAGES) To select the various table entries, the linear address is divided into three sections: • Page-directory entry—Bits 22 through 31 provide an offset to an entry in the page directory. The selected entry provides the physical base address of a page table. • Page-table entry—Bits 12 through 21 of the linear address provide an offset to an entry in the selected page table. This entry provides the physical base address of a page in physical memory. • Page offset—Bits 0 through 11 provides an offset to a physical address in the page.
  • 19. Linear Address Translation - (4 KB Pages) Directory Entry Page Table Entry 4KB page PDBR Index to Directory Index to Table Offset in Page 31 22 21 12 11 0 Page Directory Page Table Page CR3
  • 20. Virtual address 801C3400H Directory Entry 000E4000 Page Table Entry 00028000 PDBR Index to Directory Index to Table Offset in Page 1000000000 0111000011 010000000000 Page Directory Page Table CR3 200H 1C3H 400H + Physical address 00028400H