SlideShare a Scribd company logo
1 of 26
Protected Addressing Mode
and Paging
Presented by Rauf
Protected Addressing Mode
• It allows system software to use features such as virtual memory, paging, and multi-
tasking designed to increase an operating system's control over application software.
Also real mode code is never in 32 bits whereas protected mode code can be 16 bits
or 32 bits. Every x86 CPU starts in real mode. Protected mode starts after OS sets up
several descriptor tables and enables the Protection Enable (PE) bit in the control
register 0.
• Allows access to data and programs located within and above the first 1M byte of
memory.
• Addressing this extended section of the memory system requires a change to the
segment plus an offset addressing scheme used with real mode memory addressing.
• Protected mode is where Windows operates.
• Used by Windows NT, 2000, XP, Linux
Logical to Physical Address
Translation in Pentium
• CPU generates Logical address and it is given to SEGMENTATION UNIT
• SU produces Linear address and it is given to PAGING UNIT
• PU converts linear address into Physical and stores it in the main memory
• If no paging is used Linear address = Physical address
Intel Pentium Segmentation
In place of a segment address, the segment
register contains a selector that selects a
descriptor from a descriptor table.
The descriptor describes the memory
segment’s location, length, and access rights.
- it selects one of 8192 descriptors from one of two tables of
descriptors
Descriptors are placed in descriptor tables in
main memory
Protection is provided by restricting access to
memory segments through:
- Privilege levels,
- and Access rights
Logical address
32-bit16-bit
Segment register Offset
16 bits segment register = 13 bit descriptor selector + 1 bit descriptor table
selector + 2-bit requested privilege
Descriptor Tables (Segment Table)
• each descriptor is 8 bytes in length
• Each table holds 8192 descriptors
• Table can range in size from 8 bytes to 64KB (8192 descriptor requires
8*8192=64kb of memory) (213 x 23) (3 bits are implied as descriptor size is
fixed)
• Global descriptors contain segment definitions that apply to all
programs.
• Local descriptors are usually unique to an application.
– a global descriptor might be called a system descriptor, and local
descriptor an application descriptor
• Limit – specifies the length
of the segment
• Base– specifies start
address of the segment
• Access rights– controls access to
the segment
-Defines how the segment will function
Base
Address
[B0-B15]
Limit
[L0-L15]
Base
Address
[B24-B31]
Flag
Limit
[L16-L19]
Access Rights
Base
Address
[B16-B23]
15 01631
32394047485152555663
2 bytes 2 bytes
2 bytes2 bytes
DPL will be compared with
the request privilege level
(RPL) in the segment
register
specifying this segment.
Allow access to the
segment only if RPL has
higher or equal privilege
to the DPL, subject to the
state of C bit if applicable
TYPE of segment
=1 32-bit
=0 16-bit
AVL=1: segment is available (e.g. not
being accessed by another thread)
AVL=0: segment is NOT available
Descriptor Tables (Segment Table)
• The G, or granularity bit allows a segment length of 4K to 4G bytes in steps of
4K bytes.
– G = 0, the limit is from 1 to 1MB in length
– G = 1, the limit is multiplied by 4K bytes (appended with 000H). So segment
length is 4K to 4G bytes in steps of 4K bytes
– G=granularity bit: • G=0: limit is 1B-1MB (00000h to
FFFFFh) • G=1: limit is multiplied by 4K (00000xxxh to
FFFFFxxxh = 4KB-4GB)
• With limit specifying 1 MB segments and G=1 (i.e. 4K multiplier): Max Segment size = 4K
x 1 MB = 4 GB
Examples
00H 00H
01H
00H
0H
FFH FFH
7
5
3
1
6
4
2
0
0 D O
A
V
Start = 01000000H
Limit = 0FFFFH
End = 0100FFFFH
Examples
00H 00H
00H
28H
0H
00H 10H
7
5
3
1
6
4
2
0
1 D O
A
V
Start = 00280000H
Limit =
End =
00010H000
00390000H
Requested Privilege Level
Highest
Lowest
Hardware
Privilege
ComparatorDPL
(in descriptor)
RPL
(In Seg Reg)
RPL  DPL
Allow
Access
to segment
00: Highest Privilege
01
10
11: Lowest Privilege
Protected Mode: Segmentation Examples
CPU 1007H 00000088H
CS EBX
0001 0000 0000 0111
index
RPLTI
00019212000000FF 00002510000001FF
…
…
…
…
LDT GDT
Protected Mode: Segmentation Examples
CPU 1007H 00000088H
CS EBX
0001 0000 0000 0111
index
RPLTI
00019212000000FF
…
…
LDT
< +
Trap: addressing error
limit base
yes
no
Physical memory
00120000
00120088
00000000
FFFFFFFF
Access rights byte=92h
1001 0010
P=1: all is valid
DPL=00; you better have high privileges!
S=1: this is code or data (not a system routine)
E=0: compliments S, it is data (not code)
ED=0: it is data not stack data, so increment data
pointers upward when applicable
W=1: Data may be written
A=0: The segment is free, go for it!
Data Segment
Protected Mode: Segmentation Examples
Logical address = 1234:11223344
Segment selector = 1234
Base address = 00000000 (from descriptor table)
Then linear address = base address + offset = 0 + 11223344 = 11223344
Paging
• Paging is used for virtual memory multitasking operating system.
• Through paging to the hard disk drive and paging to the memory
through the memory paging unit, any Windows application can be
executed.
• In the paging memory-management scheme, the operating system
retrieves data from secondary storage in same-size blocks called
pages.
• The Paging unit organizes the physical memory in terms of pages of
4kbytes size each.
• Paging unit works under the control of the segmentation unit, i.e.
each segment is further divided into pages.
The paging unit is controlled by the microprocessors control
registers:
• CR4, controls extensions to the basic architecture provided in the Pentium
or newer microprocessor.
• CR0 contains the system control flags.
• CR3 contains the page directory base or root address.
• CR2 contains the Page Fault linear address code
• Page Fault interrupt signal enable.
• (PG) bit, enables paging when placed at a logic 1 level.
- If PG=1, then linear address transferred into physical address
- If PG=0, then linear address is physical address
• The PCD and PWT bits, control the operation of the PCD and PWT pins on
the microprocessor.
• The page directory base address, locates the directory for the page
translation unit, contains 1024 directory entries of 4 bytes.
The format for the linear address
• Only one page directory in the system.
• The page directory contains 1024 doubleword
addresses that locate up to 1024 page tables.
• Page directory and each page table are 4K bytes in
length
• Each entry in the page directory corresponds to 4M
bytes of physical memory.
• Each entry in the page table repages 4K bytes of
physical memory.
END
BLOCK DIAGRAM OF PAGING MECHANISM WITH 4KB EACH PAGE
offset
01112212231
Page Table entryDirectory
Page Directory
entry(PDE) table
1024 PDEs
PDE
Page Table
1024 PTEs
PTE
Physical Page
4KB
Physical Address
1210
10
CR3(PDBAR)
Page table
base address
20bit
Page base address 20bit
Page directory
table base address
32bit
32bit
32bit
Linear address
PDBAR-Page Directory Base Address Register
PDE--Page directory entry ,32 bits
PTE --Page Table entry,32 bits
CR3 -- control register3
(1024x4B)=4KB Page Directory
(1024x4B) =4KB each Page Table
1024x4KB=4MB for all Page Tables
4MB+4KB for page directory and page tables
Each of PDE and PTE is 32bits control structure that consist of:
base address that indicates in PDE start address ofpage table,in
PTE start address of physical page
and any flags: P(present), A(accessed), O(over page from RAM to
HD), PS(Page Size) , PSE(Page size Extention)

More Related Content

What's hot

Assembly language programming
Assembly language programmingAssembly language programming
Assembly language programminghimhk
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesFellowBuddy.com
 
A Role of Lexical Analyzer
A Role of Lexical AnalyzerA Role of Lexical Analyzer
A Role of Lexical AnalyzerArchana Gopinath
 
Compiler construction tools
Compiler construction toolsCompiler construction tools
Compiler construction toolsAkhil Kaushik
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler designSudip Singh
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2Dr.MAYA NAYAK
 
SOC Processors Used in SOC
SOC Processors Used in SOCSOC Processors Used in SOC
SOC Processors Used in SOCA B Shinde
 
UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTSai_praneeth
 
Intel 64bit Architecture
Intel 64bit ArchitectureIntel 64bit Architecture
Intel 64bit ArchitectureMotaz Saad
 

What's hot (20)

Assembly language programming
Assembly language programmingAssembly language programming
Assembly language programming
 
ARM lab programs
ARM  lab programs  ARM  lab programs
ARM lab programs
 
Intel IA 64
Intel IA 64Intel IA 64
Intel IA 64
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture Notes
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Macro Processor
Macro ProcessorMacro Processor
Macro Processor
 
A Role of Lexical Analyzer
A Role of Lexical AnalyzerA Role of Lexical Analyzer
A Role of Lexical Analyzer
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Pci express technology 3.0
Pci express technology 3.0Pci express technology 3.0
Pci express technology 3.0
 
Input buffering
Input bufferingInput buffering
Input buffering
 
Assemblers
AssemblersAssemblers
Assemblers
 
Compiler construction tools
Compiler construction toolsCompiler construction tools
Compiler construction tools
 
Type checking in compiler design
Type checking in compiler designType checking in compiler design
Type checking in compiler design
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
 
SOC Processors Used in SOC
SOC Processors Used in SOCSOC Processors Used in SOC
SOC Processors Used in SOC
 
Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)Communication Protocols (UART, SPI,I2C)
Communication Protocols (UART, SPI,I2C)
 
UART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPTUART(universal asynchronous receiver transmitter ) PPT
UART(universal asynchronous receiver transmitter ) PPT
 
Intel 64bit Architecture
Intel 64bit ArchitectureIntel 64bit Architecture
Intel 64bit Architecture
 
I2C Protocol
I2C ProtocolI2C Protocol
I2C Protocol
 
Input-Buffering
Input-BufferingInput-Buffering
Input-Buffering
 

Similar to Protected addressing mode and Paging

Pentium protected mode.ppt
Pentium protected mode.pptPentium protected mode.ppt
Pentium protected mode.pptPramodBorole2
 
32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptx32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptxYuvraj994432
 
Electronics product design companies in bangalore
Electronics product design companies in bangaloreElectronics product design companies in bangalore
Electronics product design companies in bangaloreAshok Kumar.k
 
Microprocessor Unit -1 SE computer-II.pptx
Microprocessor  Unit -1 SE computer-II.pptxMicroprocessor  Unit -1 SE computer-II.pptx
Microprocessor Unit -1 SE computer-II.pptxakshathsingh2003
 
Blackfin Processor Core Architecture Part 2
Blackfin Processor Core Architecture Part 2Blackfin Processor Core Architecture Part 2
Blackfin Processor Core Architecture Part 2Premier Farnell
 
INTEL 80386 MICROPROCESSOR
INTEL  80386  MICROPROCESSORINTEL  80386  MICROPROCESSOR
INTEL 80386 MICROPROCESSORAnnies Minu
 
Arm cortex-m4 programmer model
Arm cortex-m4 programmer modelArm cortex-m4 programmer model
Arm cortex-m4 programmer modelMohammed Gomaa
 
Advanced Microprocessors
Advanced MicroprocessorsAdvanced Microprocessors
Advanced MicroprocessorsBuddiesSairamit
 
Introducing OMAP-L138/AM1808 Processor Architecture and Hawkboard Peripherals
Introducing OMAP-L138/AM1808 Processor Architecture and Hawkboard PeripheralsIntroducing OMAP-L138/AM1808 Processor Architecture and Hawkboard Peripherals
Introducing OMAP-L138/AM1808 Processor Architecture and Hawkboard PeripheralsPremier Farnell
 
Pai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadPai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadYogesh Deshpande
 
EC 8691 Microprocessor and Microcontroller.pptx
EC 8691 Microprocessor and Microcontroller.pptxEC 8691 Microprocessor and Microcontroller.pptx
EC 8691 Microprocessor and Microcontroller.pptxGobinathAECEJRF1101
 

Similar to Protected addressing mode and Paging (20)

Protected mode memory addressing 8086
Protected mode memory addressing 8086Protected mode memory addressing 8086
Protected mode memory addressing 8086
 
Pentium protected mode.ppt
Pentium protected mode.pptPentium protected mode.ppt
Pentium protected mode.ppt
 
Architecture of pentium family
Architecture of pentium familyArchitecture of pentium family
Architecture of pentium family
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Al2ed chapter3
Al2ed chapter3Al2ed chapter3
Al2ed chapter3
 
32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptx32- bit Microprocessor-Indtel 80386.pptx
32- bit Microprocessor-Indtel 80386.pptx
 
Electronics product design companies in bangalore
Electronics product design companies in bangaloreElectronics product design companies in bangalore
Electronics product design companies in bangalore
 
Microprocessor Unit -1 SE computer-II.pptx
Microprocessor  Unit -1 SE computer-II.pptxMicroprocessor  Unit -1 SE computer-II.pptx
Microprocessor Unit -1 SE computer-II.pptx
 
Blackfin Processor Core Architecture Part 2
Blackfin Processor Core Architecture Part 2Blackfin Processor Core Architecture Part 2
Blackfin Processor Core Architecture Part 2
 
Lecture9
Lecture9Lecture9
Lecture9
 
Segmentation
SegmentationSegmentation
Segmentation
 
INTEL 80386 MICROPROCESSOR
INTEL  80386  MICROPROCESSORINTEL  80386  MICROPROCESSOR
INTEL 80386 MICROPROCESSOR
 
x86_1.ppt
x86_1.pptx86_1.ppt
x86_1.ppt
 
Arm cortex-m4 programmer model
Arm cortex-m4 programmer modelArm cortex-m4 programmer model
Arm cortex-m4 programmer model
 
Dsp ajal
Dsp  ajalDsp  ajal
Dsp ajal
 
Advanced Microprocessors
Advanced MicroprocessorsAdvanced Microprocessors
Advanced Microprocessors
 
Introducing OMAP-L138/AM1808 Processor Architecture and Hawkboard Peripherals
Introducing OMAP-L138/AM1808 Processor Architecture and Hawkboard PeripheralsIntroducing OMAP-L138/AM1808 Processor Architecture and Hawkboard Peripherals
Introducing OMAP-L138/AM1808 Processor Architecture and Hawkboard Peripherals
 
Introduction to 80386
Introduction to 80386Introduction to 80386
Introduction to 80386
 
Pai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_uploadPai unit 1_l1-l2-l3-l4_upload
Pai unit 1_l1-l2-l3-l4_upload
 
EC 8691 Microprocessor and Microcontroller.pptx
EC 8691 Microprocessor and Microcontroller.pptxEC 8691 Microprocessor and Microcontroller.pptx
EC 8691 Microprocessor and Microcontroller.pptx
 

More from marada0033

Modern face recognition with deep learning Script
Modern face recognition with deep learning ScriptModern face recognition with deep learning Script
Modern face recognition with deep learning Scriptmarada0033
 
Intelligent Agents
Intelligent AgentsIntelligent Agents
Intelligent Agentsmarada0033
 
Modern face recognition with deep learning
Modern face recognition with deep learningModern face recognition with deep learning
Modern face recognition with deep learningmarada0033
 
Neural network
Neural networkNeural network
Neural networkmarada0033
 
Introduction to Computer Engineering. Motherboard.
Introduction to Computer Engineering. Motherboard.Introduction to Computer Engineering. Motherboard.
Introduction to Computer Engineering. Motherboard.marada0033
 
Dos & Ddos Attack. Man in The Middle Attack
Dos & Ddos Attack. Man in The Middle AttackDos & Ddos Attack. Man in The Middle Attack
Dos & Ddos Attack. Man in The Middle Attackmarada0033
 
Audio spotlight
Audio spotlightAudio spotlight
Audio spotlightmarada0033
 
Babəkin Başçılığı Altında Azadlıq Hərəkatı
Babəkin Başçılığı Altında Azadlıq HərəkatıBabəkin Başçılığı Altında Azadlıq Hərəkatı
Babəkin Başçılığı Altında Azadlıq Hərəkatımarada0033
 
Wireless Power Transmission
Wireless Power TransmissionWireless Power Transmission
Wireless Power Transmissionmarada0033
 

More from marada0033 (10)

Modern face recognition with deep learning Script
Modern face recognition with deep learning ScriptModern face recognition with deep learning Script
Modern face recognition with deep learning Script
 
Intelligent Agents
Intelligent AgentsIntelligent Agents
Intelligent Agents
 
Modern face recognition with deep learning
Modern face recognition with deep learningModern face recognition with deep learning
Modern face recognition with deep learning
 
Neural network
Neural networkNeural network
Neural network
 
Introduction to Computer Engineering. Motherboard.
Introduction to Computer Engineering. Motherboard.Introduction to Computer Engineering. Motherboard.
Introduction to Computer Engineering. Motherboard.
 
Dos & Ddos Attack. Man in The Middle Attack
Dos & Ddos Attack. Man in The Middle AttackDos & Ddos Attack. Man in The Middle Attack
Dos & Ddos Attack. Man in The Middle Attack
 
Audio spotlight
Audio spotlightAudio spotlight
Audio spotlight
 
Java J2ME
Java J2MEJava J2ME
Java J2ME
 
Babəkin Başçılığı Altında Azadlıq Hərəkatı
Babəkin Başçılığı Altında Azadlıq HərəkatıBabəkin Başçılığı Altında Azadlıq Hərəkatı
Babəkin Başçılığı Altında Azadlıq Hərəkatı
 
Wireless Power Transmission
Wireless Power TransmissionWireless Power Transmission
Wireless Power Transmission
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
(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
 
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
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
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
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
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
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
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
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
(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...
 
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
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
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
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
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
 

Protected addressing mode and Paging

  • 1. Protected Addressing Mode and Paging Presented by Rauf
  • 2. Protected Addressing Mode • It allows system software to use features such as virtual memory, paging, and multi- tasking designed to increase an operating system's control over application software. Also real mode code is never in 32 bits whereas protected mode code can be 16 bits or 32 bits. Every x86 CPU starts in real mode. Protected mode starts after OS sets up several descriptor tables and enables the Protection Enable (PE) bit in the control register 0. • Allows access to data and programs located within and above the first 1M byte of memory. • Addressing this extended section of the memory system requires a change to the segment plus an offset addressing scheme used with real mode memory addressing. • Protected mode is where Windows operates. • Used by Windows NT, 2000, XP, Linux
  • 3. Logical to Physical Address Translation in Pentium • CPU generates Logical address and it is given to SEGMENTATION UNIT • SU produces Linear address and it is given to PAGING UNIT • PU converts linear address into Physical and stores it in the main memory • If no paging is used Linear address = Physical address
  • 4. Intel Pentium Segmentation In place of a segment address, the segment register contains a selector that selects a descriptor from a descriptor table. The descriptor describes the memory segment’s location, length, and access rights. - it selects one of 8192 descriptors from one of two tables of descriptors Descriptors are placed in descriptor tables in main memory Protection is provided by restricting access to memory segments through: - Privilege levels, - and Access rights Logical address 32-bit16-bit Segment register Offset
  • 5. 16 bits segment register = 13 bit descriptor selector + 1 bit descriptor table selector + 2-bit requested privilege
  • 6. Descriptor Tables (Segment Table) • each descriptor is 8 bytes in length • Each table holds 8192 descriptors • Table can range in size from 8 bytes to 64KB (8192 descriptor requires 8*8192=64kb of memory) (213 x 23) (3 bits are implied as descriptor size is fixed) • Global descriptors contain segment definitions that apply to all programs. • Local descriptors are usually unique to an application. – a global descriptor might be called a system descriptor, and local descriptor an application descriptor
  • 7. • Limit – specifies the length of the segment • Base– specifies start address of the segment • Access rights– controls access to the segment -Defines how the segment will function
  • 9. DPL will be compared with the request privilege level (RPL) in the segment register specifying this segment. Allow access to the segment only if RPL has higher or equal privilege to the DPL, subject to the state of C bit if applicable TYPE of segment
  • 10. =1 32-bit =0 16-bit AVL=1: segment is available (e.g. not being accessed by another thread) AVL=0: segment is NOT available
  • 11. Descriptor Tables (Segment Table) • The G, or granularity bit allows a segment length of 4K to 4G bytes in steps of 4K bytes. – G = 0, the limit is from 1 to 1MB in length – G = 1, the limit is multiplied by 4K bytes (appended with 000H). So segment length is 4K to 4G bytes in steps of 4K bytes – G=granularity bit: • G=0: limit is 1B-1MB (00000h to FFFFFh) • G=1: limit is multiplied by 4K (00000xxxh to FFFFFxxxh = 4KB-4GB) • With limit specifying 1 MB segments and G=1 (i.e. 4K multiplier): Max Segment size = 4K x 1 MB = 4 GB
  • 12. Examples 00H 00H 01H 00H 0H FFH FFH 7 5 3 1 6 4 2 0 0 D O A V Start = 01000000H Limit = 0FFFFH End = 0100FFFFH
  • 13. Examples 00H 00H 00H 28H 0H 00H 10H 7 5 3 1 6 4 2 0 1 D O A V Start = 00280000H Limit = End = 00010H000 00390000H
  • 14. Requested Privilege Level Highest Lowest Hardware Privilege ComparatorDPL (in descriptor) RPL (In Seg Reg) RPL  DPL Allow Access to segment 00: Highest Privilege 01 10 11: Lowest Privilege
  • 15.
  • 16. Protected Mode: Segmentation Examples CPU 1007H 00000088H CS EBX 0001 0000 0000 0111 index RPLTI 00019212000000FF 00002510000001FF … … … … LDT GDT
  • 17. Protected Mode: Segmentation Examples CPU 1007H 00000088H CS EBX 0001 0000 0000 0111 index RPLTI 00019212000000FF … … LDT < + Trap: addressing error limit base yes no Physical memory 00120000 00120088 00000000 FFFFFFFF Access rights byte=92h 1001 0010 P=1: all is valid DPL=00; you better have high privileges! S=1: this is code or data (not a system routine) E=0: compliments S, it is data (not code) ED=0: it is data not stack data, so increment data pointers upward when applicable W=1: Data may be written A=0: The segment is free, go for it! Data Segment
  • 18. Protected Mode: Segmentation Examples Logical address = 1234:11223344 Segment selector = 1234 Base address = 00000000 (from descriptor table) Then linear address = base address + offset = 0 + 11223344 = 11223344
  • 19. Paging • Paging is used for virtual memory multitasking operating system. • Through paging to the hard disk drive and paging to the memory through the memory paging unit, any Windows application can be executed. • In the paging memory-management scheme, the operating system retrieves data from secondary storage in same-size blocks called pages. • The Paging unit organizes the physical memory in terms of pages of 4kbytes size each. • Paging unit works under the control of the segmentation unit, i.e. each segment is further divided into pages.
  • 20.
  • 21. The paging unit is controlled by the microprocessors control registers:
  • 22. • CR4, controls extensions to the basic architecture provided in the Pentium or newer microprocessor. • CR0 contains the system control flags. • CR3 contains the page directory base or root address. • CR2 contains the Page Fault linear address code • Page Fault interrupt signal enable. • (PG) bit, enables paging when placed at a logic 1 level. - If PG=1, then linear address transferred into physical address - If PG=0, then linear address is physical address • The PCD and PWT bits, control the operation of the PCD and PWT pins on the microprocessor. • The page directory base address, locates the directory for the page translation unit, contains 1024 directory entries of 4 bytes.
  • 23. The format for the linear address
  • 24. • Only one page directory in the system. • The page directory contains 1024 doubleword addresses that locate up to 1024 page tables. • Page directory and each page table are 4K bytes in length • Each entry in the page directory corresponds to 4M bytes of physical memory. • Each entry in the page table repages 4K bytes of physical memory.
  • 25. END
  • 26. BLOCK DIAGRAM OF PAGING MECHANISM WITH 4KB EACH PAGE offset 01112212231 Page Table entryDirectory Page Directory entry(PDE) table 1024 PDEs PDE Page Table 1024 PTEs PTE Physical Page 4KB Physical Address 1210 10 CR3(PDBAR) Page table base address 20bit Page base address 20bit Page directory table base address 32bit 32bit 32bit Linear address PDBAR-Page Directory Base Address Register PDE--Page directory entry ,32 bits PTE --Page Table entry,32 bits CR3 -- control register3 (1024x4B)=4KB Page Directory (1024x4B) =4KB each Page Table 1024x4KB=4MB for all Page Tables 4MB+4KB for page directory and page tables Each of PDE and PTE is 32bits control structure that consist of: base address that indicates in PDE start address ofpage table,in PTE start address of physical page and any flags: P(present), A(accessed), O(over page from RAM to HD), PS(Page Size) , PSE(Page size Extention)