18-ch8_part3__ch9_part1
18-ch8_part3__ch9_part1
Fall Semester
Operating Systems
Dr. Wafaa Samy
Dr. Hanaa Eissa
Background
Contiguous Memory Allocation
Segmentation
Paging
Swapping
The base and limit registers can be loaded only by the operating system.
• The instructions to loading the base and limit registers are privileged
(i.e. can be executed only in kernel mode).
Operating System Concepts – 10th Edition
Silberschatz, Galvin and Gagne ©2018 8.14 Modified by Dr. Wafaa Samy
Address Binding
Programs on disk as a binary executable files, 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.
• Most systems allow a user process to reside in any part
of the physical memory. The first address of the user
process need not be 0000.
• How can it not be? How the OS places a process in
physical memory?
Dynamic
relocation
using a
relocation
register.
For example, if the base is at 14000, then an attempt by the user to address
location 0 is dynamically relocated to location 14000; an access to location
346 is mapped to location 14346.
Operating System Concepts – 10th Edition
Silberschatz, Galvin and Gagne ©2018 8.22 Modified by Dr. Wafaa Samy
Memory-Management Unit (Cont.)
The user program never accesses the real physical addresses.
• The program can create a pointer to location 346, store it in memory,
manipulate it, and compare it with other addresses—all as the number
346.
• Only when it is used as a memory address (in an indirect load or store,
perhaps) it is relocated relative to the base register.
The user program deals with logical addresses; it never sees the real
physical addresses.
• The memory mapping hardware converts logical addresses into physical
addresses. Logical address bound to physical addresses.
This form of execution-time binding.
• Execution-time binding occurs when reference is made to location in
memory.
The final location of a referenced memory address is not determined
until the reference is made.