Introduction
เคเคฌ เคเฅเค program run เคนเฅเคคเคพ เคนเฅ, เคคเฅ เคเคธเฅ memory เคเฅ เคเคฐเฅเคฐเคค เคนเฅเคคเฅ เคนเฅเฅค
เคฒเฅเคเคฟเคจ เคฏเคนเคพเค เคเค important เคฌเคพเคค เคนเฅ:
Program เคเคฟเคธ address เคเฅ use เคเคฐเคคเคพ เคนเฅ ,
เคเคฐ actual memory (RAM) เคฎเฅเค เคเฅ address เคนเฅเคคเคพ เคนเฅ
เคฏเฅ เคฆเฅเคจเฅเค same เคจเคนเฅเค เคนเฅเคคเฅ
เคเคธเฅ difference เคเฅ เคธเคฎเคเคจเฅ เคเฅ เคฒเคฟเค เคนเคฎ เคชเคขเคผเคคเฅ เคนเฅเค:
- Logical Address
- Physical Address
Logical Address เคเฅเคฏเคพ เคนเฅเคคเคพ เคนเฅ
Logical Address เคตเคน address เคนเฅเคคเคพ เคนเฅ เคเฅ CPU เคฏเคพ program generate เคเคฐเคคเคพ เคนเฅเฅค
เคฏเคน address user program เคเฅ เคฆเคฟเคเคพเค เคฆเฅเคคเคพ เคนเฅ
Physical Address เคเฅเคฏเคพ เคนเฅเคคเคพ เคนเฅ
Physical Address เคตเคน actual address เคนเฅเคคเคพ เคนเฅ เคเฅ main memory (RAM) เคฎเฅเค เคนเฅเคคเคพ เคนเฅเฅค
เคฏเคนเฅ address memory hardware use เคเคฐเคคเคพ เคนเฅ
Simple Definition
Logical Address = CPU เคฆเฅเคตเคพเคฐเคพ generate เคเคฟเคฏเคพ เคเคฏเคพ address
Physical Address = Memory เคฎเฅเค actual address
Main Difference
| Logical Address | Physical Address |
|---|---|
| CPU generate เคเคฐเคคเคพ เคนเฅ | Memory เคฎเฅเค actual เคนเฅเคคเคพ เคนเฅ |
| Virtual เคนเฅเคคเคพ เคนเฅ | Real เคนเฅเคคเคพ เคนเฅ |
| User เคเฅ เคฆเคฟเคเคคเคพ เคนเฅ | User เคเฅ directly เคจเคนเฅเค เคฆเคฟเคเคคเคพ |
Address Translation
Logical address เคเฅ physical address เคฎเฅเค convert เคเคฟเคฏเคพ เคเคพเคคเคพ เคนเฅ
เคฏเคน เคเคพเคฎ เคเคฐเคคเคพ เคนเฅ: MMU (Memory Management Unit)
Working
- Program logical address generate เคเคฐเคคเคพ เคนเฅ
- MMU เคเคธเฅ convert เคเคฐเคคเคพ เคนเฅ
- Physical address เคฎเคฟเคฒเคคเคพ เคนเฅ
- Memory access เคนเฅเคคเฅ เคนเฅ
Example
เคฎเคพเคจ เคฒเฅ:
- Program address = 100 (logical)
- Base address = 1000
เคคเฅ:
Physical address = 100 + 1000 = 1100
Important Concept: Address Space
1. Logical Address Space
- เคธเคญเฅ logical addresses เคเคพ set
2. Physical Address Space
- เคธเคญเฅ physical addresses เคเคพ set
Types of Mapping
1. Compile Time Binding
Address เคชเคนเคฒเฅ เคนเฅ fix เคนเฅ เคเคพเคคเคพ เคนเฅ
2. Load Time Binding
Program load เคนเฅเคจเฅ เคชเคฐ address fix เคนเฅเคคเคพ เคนเฅ
3. Execution Time Binding
Run time เคชเคฐ address change เคนเฅ เคธเคเคคเคพ เคนเฅ
เคธเคฌเคธเฅ flexible เคฏเคนเฅ เคนเฅเคคเคพ เคนเฅ
Real Life Analogy
Logical Address = Map เคฎเฅเค location
Physical Address = Real เคเคเคน
Map เคเคฐ real location เค เคฒเค เคนเฅ เคธเคเคคเฅ เคนเฅเค
Why Important
- Memory protection เคฆเฅเคคเคพ เคนเฅ
- Program relocation เคเคธเคพเคจ เคฌเคจเคพเคคเคพ เคนเฅ
- Multi-programming possible เคฌเคจเคพเคคเคพ เคนเฅ
Key Points
- Logical vs Physical address
- MMU role
- Address translation
- Binding types
Conclusion
Logical เคเคฐ Physical Address Space memory management เคเคพ base concept เคนเฅเฅค
เคฏเคน เคธเคฎเคเคจเคพ เคเคฐเฅเคฐเฅ เคนเฅ เคเคฟ program address เคเคฐ actual memory address เค
เคฒเค เคนเฅเคคเฅ เคนเฅเค เคเคฐ MMU เคเคจเฅเคนเฅเค map เคเคฐเคคเคพ เคนเฅเฅค