Page 202 - DCAP103_Principle of operating system
P. 202
Unit 5: Memory Management
Memory-Management Unit (MMU): The run-time mapping from virtual to physical addresses Notes
is done by a hardware device.
Relocation: One solution to the external-fragmentation problem is compaction. Compaction
involves shifting a program in memory without the program noticing the change. This
consideration requires that logical addresses be relocated dynamically, at execution time. If
addresses are relocated only at load time, we cannot compact storage.
Secondary Memory: This memory holds those pages that are not present in main memory.
Translation Look-Aside Buffer (TLB): Standard solution to this problem is to use a special,
small, fast look up hardware cache.
5.15 Review Questions
1. Describe how the Swap( ) instruction can be used to provide mutual exclusion that satisfies
the bounded-waiting requirement.
2. Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order),
how would each of the first-fit, best-fit, and worst-fit algorithms place processes of 212
KB, 417 KB, 112 KB, and 426 KB (in order)?Which algorithm makes the most efficient use
of memory?
3. Most systems allow programs to allocate more memory to its address space during
execution. Data allocated in the heap segments of programs is an example of such
allocated memory. What is required to support dynamic memory allocation in the
following schemes:
(a) contiguous-memory allocation
(b) pure segmentation
(c) pure paging
4. On a system with paging, a process cannot access memory that it does not own; why?
How could the operating system allow access to other memory? Why should it or should
it not?
5. Compare paging with segmentation with respect to the amount of memory required
by the address translation structures in order to convert virtual addresses to physical
addresses.
6. Why are segmentation and paging sometimes combined into one scheme?
7. Explain why it is easier to share a reentrant module using segmentation than it is to do
so when pure paging is used.
8. Consider the following segment table:
Segment Base Length
0 219 600
1 2300 14
2 90 100
3 1327 580
4 1952 96
What are the physical addresses for the following logical addresses?
LOVELY PROFESSIONAL UNIVERSITY 195