SlideShare a Scribd company logo
5
Most read
6
Most read
9
Most read
Operating System 32
Logical versus physical address
Prof Neeraj Bhargava
Vaibhav Khanna
Department of Computer Science
School of Engineering and Systems Sciences
Maharshi Dayanand Saraswati University Ajmer
Memory Management
‱ How to utilize memory optimally by manipulating objects in
the memory is referred to as memory management.
‱ Program must be brought (from disk) into memory and
placed within a process for it to be run
‱ Main memory and registers are only storage CPU can
access directly
‱ Memory unit only sees a stream of addresses + read
requests, or address + data and write requests
‱ Register access in one CPU clock (or less)
‱ Main memory can take many cycles, causing a stall
‱ Cache sits between main memory and CPU registers
‱ Protection of memory required to ensure correct operation
Base and Limit Registers
‱ A pair of base and
limit registers define
the logical address
space
‱ CPU must check
every memory access
generated in user
mode to be sure it is
between base and
limit for that user
Hardware Address Protection
Binding
‱ Assigning an address to an instruction or data/variable is known as
binding.
‱ The addresses assigned to high level language program components
residing on a secondary storage device are symbolic addresses, viz.
variable names, function names etc.
‱ When this program is compiled, the addresses are translated into
relative addresses in the object program.
‱ Another translation of the relative addresses into relocatable
addresses (relocatable address is an address that can be reassigned
to a different physical location) takes place when this object code is
linked and loaded into the memory.
‱ Thus each binding is a mapping from one address space to another
address space.
‱ The responsibility of these address translations is basic
responsibility of operating systems.
Address Binding
‱ Programs on disk, ready to be brought into memory to execute form an input
queue
– Without support, must be loaded into address 0000
‱ Inconvenient to have first user process physical address always at 0000
– How can it not be?
‱ Further, addresses represented in different ways at different stages of a program’s
life
– Source code addresses usually symbolic
– Compiled code addresses bind to relocatable addresses
‱ i.e. “14 bytes from beginning of this module”
– Linker or loader will bind relocatable addresses to absolute addresses
‱ i.e. 74014
– Each binding maps one address space to another
Binding of Instructions and Data to Memory
‱ Address binding of instructions and data to memory
addresses can happen at three different stages
– Compile time: If memory location known a priori, absolute
code can be generated; must recompile code if starting
location changes
– Load time: Must generate relocatable code if memory
location is not known at compile time
– Execution time: Binding delayed until run time if the
process can be moved during its execution from one
memory segment to another
‱ Need hardware support for address maps (e.g., base and limit
registers)
Multistep Processing of a User Program
Logical vs. Physical Address Space
‱ The concept of a logical address space that is bound to a
separate physical address space is central to proper
memory management
– Logical address – generated by the CPU; also referred to as
virtual address
– Physical address – address seen by the memory unit
‱ Logical and physical addresses are the same in compile-
time and load-time address-binding schemes; logical
(virtual) and physical addresses differ in execution-time
address-binding scheme
‱ Logical address space is the set of all logical addresses
generated by a program
‱ Physical address space is the set of all physical addresses
generated by a program
Memory-Management Unit (MMU)
‱ Hardware device that at run time maps virtual to physical
address
‱ Many methods possible, covered in the rest of this
chapter
‱ To start, consider simple scheme where the value in the
relocation register is added to every address generated
by a user process at the time it is sent to memory
– Base register now called relocation register
– MS-DOS on Intel 80x86 used 4 relocation registers
‱ The user program deals with logical addresses; it never
sees the real physical addresses
– Execution-time binding occurs when reference is made to
location in memory
– Logical address bound to physical addresses
Dynamic relocation using a relocation register
ïź Routine is not loaded until it is
called
ïź Better memory-space utilization;
unused routine is never loaded
ïź All routines kept on disk in
relocatable load format
ïź Useful when large amounts of
code are needed to handle
infrequently occurring cases
ïź No special support from the
operating system is required
ïŹ Implemented through program
design
ïŹ OS can help by providing libraries
to implement dynamic loading
Dynamic relocation using a relocation register
Dynamic Linking
‱ Static linking – system libraries and program code
combined by the loader into the binary program image
‱ Dynamic linking –linking postponed until execution time
‱ Small piece of code, stub, used to locate the appropriate
memory-resident library routine
‱ Stub replaces itself with the address of the routine, and
executes the routine
‱ Operating system checks if routine is in processes’
memory address
– If not in address space, add to address space
‱ Dynamic linking is particularly useful for libraries
‱ System also known as shared libraries
‱ Consider applicability to patching system libraries
– Versioning may be needed
Assignment
‱ Explain the concept and need of Memory
Management
‱ Explain Address Binding
‱ What Logical vs. Physical Address Space and
explain role of Memory Management Unit.

More Related Content

PPT
Memory allocation (4)
PPTX
Os unit 3
PPT
Assembly Language Basics
PPTX
Mass Storage Structure
PPTX
Memory management
PPTX
System programming
PPTX
Introduction of Memory Management
PDF
OS Memory Management
Memory allocation (4)
Os unit 3
Assembly Language Basics
Mass Storage Structure
Memory management
System programming
Introduction of Memory Management
OS Memory Management

What's hot (20)

PPTX
Inter Process Communication
PPT
Thrashing allocation frames.43
PPTX
CPU Scheduling in OS Presentation
PPTX
Difference Program vs Process vs Thread
PPTX
INTER PROCESS COMMUNICATION (IPC).pptx
 
PPTX
Deadlock ppt
PPTX
Dead Lock in operating system
PPTX
System calls
PPTX
Coding and testing in Software Engineering
PPT
The process states
PPTX
File concept and access method
PPT
Operating system services 9
PPT
Memory Management in OS
PDF
Deadlock Avoidance - OS
PPTX
Lecture 14 run time environment
PPTX
Deadlocks in operating system
PPT
Kernel mode vs user mode in linux
PPTX
File system structure
PPTX
Virtual memory management in Operating System
PPTX
Inter Process Communication
Thrashing allocation frames.43
CPU Scheduling in OS Presentation
Difference Program vs Process vs Thread
INTER PROCESS COMMUNICATION (IPC).pptx
 
Deadlock ppt
Dead Lock in operating system
System calls
Coding and testing in Software Engineering
The process states
File concept and access method
Operating system services 9
Memory Management in OS
Deadlock Avoidance - OS
Lecture 14 run time environment
Deadlocks in operating system
Kernel mode vs user mode in linux
File system structure
Virtual memory management in Operating System
Ad

Similar to Operating system 32 logical versus physical address (20)

PPTX
Memory management
PDF
Memory management
PDF
Memory Management Strategies - I.pdf
PDF
Memory Management(MM) in operating system
DOCX
Main memoryfinal
PPTX
Lecture-7 Main Memroy.pptx
DOCX
Mainmemoryfinal 161019122029
PDF
Operating Systems - memory management
PPTX
Operating Systems Module 4_Memory Management.pptx
PPT
Lecture20-21-22.ppt
PPTX
HW29kkkkkkkkkkkkkkkkkkkmmmmkkmmkkk454.pptx
PPTX
Operating System_2.1_Memory Management.pptx
PPT
Ios103 ios102 iv-operating-system-memory-management_wk4
DOCX
Mainmemoryfinalprefinal 160927115742
PPTX
CSE2010- Module 4 V1.pptx
PPT
Os7 2
 
PPTX
Memory Managment(OS).pptx
PPT
operationg systemsdocumentmemorymanagement
PPT
OS-unit-3 part -1mxmxmxmmxmxmmxmxmxmxmxmmxmxmmx.ppt
PPT
Memory management principles in operating systems
Memory management
Memory management
Memory Management Strategies - I.pdf
Memory Management(MM) in operating system
Main memoryfinal
Lecture-7 Main Memroy.pptx
Mainmemoryfinal 161019122029
Operating Systems - memory management
Operating Systems Module 4_Memory Management.pptx
Lecture20-21-22.ppt
HW29kkkkkkkkkkkkkkkkkkkmmmmkkmmkkk454.pptx
Operating System_2.1_Memory Management.pptx
Ios103 ios102 iv-operating-system-memory-management_wk4
Mainmemoryfinalprefinal 160927115742
CSE2010- Module 4 V1.pptx
Os7 2
 
Memory Managment(OS).pptx
operationg systemsdocumentmemorymanagement
OS-unit-3 part -1mxmxmxmmxmxmmxmxmxmxmxmmxmxmmx.ppt
Memory management principles in operating systems
Ad

More from Vaibhav Khanna (20)

PPTX
Information and network security 47 authentication applications
PPTX
Information and network security 46 digital signature algorithm
PPTX
Information and network security 45 digital signature standard
PPTX
Information and network security 44 direct digital signatures
PPTX
Information and network security 43 digital signatures
PPTX
Information and network security 42 security of message authentication code
PPTX
Information and network security 41 message authentication code
PPTX
Information and network security 40 sha3 secure hash algorithm
PPTX
Information and network security 39 secure hash algorithm
PPTX
Information and network security 38 birthday attacks and security of hash fun...
PPTX
Information and network security 37 hash functions and message authentication
PPTX
Information and network security 35 the chinese remainder theorem
PPTX
Information and network security 34 primality
PPTX
Information and network security 33 rsa algorithm
PPTX
Information and network security 32 principles of public key cryptosystems
PPTX
Information and network security 31 public key cryptography
PPTX
Information and network security 30 random numbers
PPTX
Information and network security 29 international data encryption algorithm
PPTX
Information and network security 28 blowfish
PPTX
Information and network security 27 triple des
Information and network security 47 authentication applications
Information and network security 46 digital signature algorithm
Information and network security 45 digital signature standard
Information and network security 44 direct digital signatures
Information and network security 43 digital signatures
Information and network security 42 security of message authentication code
Information and network security 41 message authentication code
Information and network security 40 sha3 secure hash algorithm
Information and network security 39 secure hash algorithm
Information and network security 38 birthday attacks and security of hash fun...
Information and network security 37 hash functions and message authentication
Information and network security 35 the chinese remainder theorem
Information and network security 34 primality
Information and network security 33 rsa algorithm
Information and network security 32 principles of public key cryptosystems
Information and network security 31 public key cryptography
Information and network security 30 random numbers
Information and network security 29 international data encryption algorithm
Information and network security 28 blowfish
Information and network security 27 triple des

Recently uploaded (20)

PDF
Understanding Forklifts - TECH EHS Solution
PPTX
ai tools demonstartion for schools and inter college
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
System and Network Administration Chapter 2
PPTX
history of c programming in notes for students .pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Nekopoi APK 2025 free lastest update
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Online Work Permit System for Fast Permit Processing
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
AI in Product Development-omnex systems
PPT
Introduction Database Management System for Course Database
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Softaken Excel to vCard Converter Software.pdf
Understanding Forklifts - TECH EHS Solution
ai tools demonstartion for schools and inter college
Odoo POS Development Services by CandidRoot Solutions
How to Choose the Right IT Partner for Your Business in Malaysia
System and Network Administration Chapter 2
history of c programming in notes for students .pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Nekopoi APK 2025 free lastest update
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Design an Analysis of Algorithms I-SECS-1021-03
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Online Work Permit System for Fast Permit Processing
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
AI in Product Development-omnex systems
Introduction Database Management System for Course Database
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PTS Company Brochure 2025 (1).pdf.......
Wondershare Filmora 15 Crack With Activation Key [2025
Softaken Excel to vCard Converter Software.pdf

Operating system 32 logical versus physical address

  • 1. Operating System 32 Logical versus physical address Prof Neeraj Bhargava Vaibhav Khanna Department of Computer Science School of Engineering and Systems Sciences Maharshi Dayanand Saraswati University Ajmer
  • 2. Memory Management ‱ How to utilize memory optimally by manipulating objects in the memory is referred to as memory management. ‱ Program must be brought (from disk) into memory and placed within a process for it to be run ‱ Main memory and registers are only storage CPU can access directly ‱ Memory unit only sees a stream of addresses + read requests, or address + data and write requests ‱ Register access in one CPU clock (or less) ‱ Main memory can take many cycles, causing a stall ‱ Cache sits between main memory and CPU registers ‱ Protection of memory required to ensure correct operation
  • 3. Base and Limit Registers ‱ A pair of base and limit registers define the logical address space ‱ CPU must check every memory access generated in user mode to be sure it is between base and limit for that user
  • 5. Binding ‱ Assigning an address to an instruction or data/variable is known as binding. ‱ The addresses assigned to high level language program components residing on a secondary storage device are symbolic addresses, viz. variable names, function names etc. ‱ When this program is compiled, the addresses are translated into relative addresses in the object program. ‱ Another translation of the relative addresses into relocatable addresses (relocatable address is an address that can be reassigned to a different physical location) takes place when this object code is linked and loaded into the memory. ‱ Thus each binding is a mapping from one address space to another address space. ‱ The responsibility of these address translations is basic responsibility of operating systems.
  • 6. Address Binding ‱ Programs on disk, ready to be brought into memory to execute form an input queue – Without support, must be loaded into address 0000 ‱ Inconvenient to have first user process physical address always at 0000 – How can it not be? ‱ Further, addresses represented in different ways at different stages of a program’s life – Source code addresses usually symbolic – Compiled code addresses bind to relocatable addresses ‱ i.e. “14 bytes from beginning of this module” – Linker or loader will bind relocatable addresses to absolute addresses ‱ i.e. 74014 – Each binding maps one address space to another
  • 7. Binding of Instructions and Data to Memory ‱ Address binding of instructions and data to memory addresses can happen at three different stages – Compile time: If memory location known a priori, absolute code can be generated; must recompile code if starting location changes – Load time: Must generate relocatable code if memory location is not known at compile time – Execution time: Binding delayed until run time if the process can be moved during its execution from one memory segment to another ‱ Need hardware support for address maps (e.g., base and limit registers)
  • 8. Multistep Processing of a User Program
  • 9. Logical vs. Physical Address Space ‱ The concept of a logical address space that is bound to a separate physical address space is central to proper memory management – Logical address – generated by the CPU; also referred to as virtual address – Physical address – address seen by the memory unit ‱ Logical and physical addresses are the same in compile- time and load-time address-binding schemes; logical (virtual) and physical addresses differ in execution-time address-binding scheme ‱ Logical address space is the set of all logical addresses generated by a program ‱ Physical address space is the set of all physical addresses generated by a program
  • 10. Memory-Management Unit (MMU) ‱ Hardware device that at run time maps virtual to physical address ‱ Many methods possible, covered in the rest of this chapter ‱ To start, consider simple scheme where the value in the relocation register is added to every address generated by a user process at the time it is sent to memory – Base register now called relocation register – MS-DOS on Intel 80x86 used 4 relocation registers ‱ The user program deals with logical addresses; it never sees the real physical addresses – Execution-time binding occurs when reference is made to location in memory – Logical address bound to physical addresses
  • 11. Dynamic relocation using a relocation register ïź Routine is not loaded until it is called ïź Better memory-space utilization; unused routine is never loaded ïź All routines kept on disk in relocatable load format ïź Useful when large amounts of code are needed to handle infrequently occurring cases ïź No special support from the operating system is required ïŹ Implemented through program design ïŹ OS can help by providing libraries to implement dynamic loading
  • 12. Dynamic relocation using a relocation register
  • 13. Dynamic Linking ‱ Static linking – system libraries and program code combined by the loader into the binary program image ‱ Dynamic linking –linking postponed until execution time ‱ Small piece of code, stub, used to locate the appropriate memory-resident library routine ‱ Stub replaces itself with the address of the routine, and executes the routine ‱ Operating system checks if routine is in processes’ memory address – If not in address space, add to address space ‱ Dynamic linking is particularly useful for libraries ‱ System also known as shared libraries ‱ Consider applicability to patching system libraries – Versioning may be needed
  • 14. Assignment ‱ Explain the concept and need of Memory Management ‱ Explain Address Binding ‱ What Logical vs. Physical Address Space and explain role of Memory Management Unit.