How is the logical address space generated by the CPU?

  • Thread starter Thread starter Peon666
  • Start date Start date
  • Tags Tags
    cpu Space
Click For Summary
SUMMARY

The logical address space is generated by the CPU using a pair of base and limit registers, defining the logical address space for each user process. The set of logical addresses used by a program constitutes its logical address space, while the corresponding physical addresses define its physical address space. The Memory Management Unit (MMU) facilitates the mapping of logical addresses to physical addresses, employing a relocation register to prevent address collisions among multiple processes. This dynamic relocation scheme ensures that logical addresses are translated to physical addresses at runtime, enhancing memory management efficiency.

PREREQUISITES
  • Understanding of CPU architecture and memory management concepts.
  • Familiarity with base and limit registers in memory management.
  • Knowledge of Memory Management Unit (MMU) functionality.
  • Concept of logical versus physical addresses in computing.
NEXT STEPS
  • Research the role of the Memory Management Unit (MMU) in modern CPUs.
  • Explore dynamic memory allocation techniques in operating systems.
  • Learn about virtual memory and its implementation in operating systems.
  • Study the implications of address space layout randomization (ASLR) for security.
USEFUL FOR

Computer science students, systems programmers, and software engineers interested in understanding memory management and CPU architecture.

Peon666
Messages
107
Reaction score
0
I do understand that logical address space/memory is generated by the CPU for the program and physical memory is the one on-to which the logical address space is mapped and which is on the physical memory. Plus, physical memory is not directly accessible to the user.

Now, my question is (I don't know whether this makes sense or not):

1- How is the logical address space generated by the CPU? And is this randomly generated?

2- Why do we need a "relocation register" to map it on the physical memory? Why can't it be directly mapped on the physical memory?

Thanks.
 
Computer science news on Phys.org
First, we must note that the concept of a logical address space bound to some physical address space is of central role in order to have proper memory management.

Peon666 said:
1- How is the logical address space generated by the CPU? And is this randomly generated?

A pair of base and limit registers are used to define the logical address space. We must note here that main memory and registers are the only storage that can be accessed by CPU directly. Also, we talk about the logical address space per program or better stated, per user process.

Now, the set of all logical addresses used by a program defines its logical address space, and the set of all corresponding physical addresses defines its physical address space.
Addresses which are bound at compile time or load time have identical logical and physical addresses.
Addresses created at execution time have different logical and physical addresses. In this case, the logical address is also known as virtual address.

Peon666 said:
2- Why do we need a "relocation register" to map it on the physical memory? Why can't it be directly mapped on the physical memory?

The run time mapping of logical to physical addresses is handled by the MMU (Memory Management Unit), which is the hardware that supports the mapping of virtual memory addresses to physical memory addresses. In modern microcomputers it is built into the CPU chip. For run time mapping, the base register is named relocation register. In the usual dynamic relocation scheme that we talk about here - which is used in order to avoid collisions among multiple processes running simultaneously, relocation register value is added to every memory request at the hardware level. So, MMU adds the value of the relocation register to a logical address in order to form a physical address.
 
  • Like
Likes   Reactions: Greg Bernhardt

Similar threads

Replies
10
Views
4K
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 14 ·
Replies
14
Views
6K
Replies
19
Views
3K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K