Homework #7Assigned: April 16
Due: April 22, 3:00pm, in class
- (2+3=5 points) Consider the following process
for generating binaries. A compiler is used to
generate the object code for individual modules,
and a linkage editor is used to combine multiple
object modules into a single program executable.
How does the linkage editor change the binding of
instructions and data to memory addresses? What
information needs to be passed from the compiler to
the linkage editor to facilitate the memory binding
tasks from the linkage editor?
- (4+2=6 points) Given five fixed memory
parititons of 100k, 500k, 200k, 300k, and 600k (in
order), how would each of the first-fit, best-fit,
and worst-fit algorithms place processes of
(p1) 212k, (p2) 417k,
(p3) 112k, and (p4) 426k (in
order)? Which algorithm makes the most efficient
use of memory?
- (2+2+2=6 points) Compare the main memory
organization schemes of contiguous-memory
allocation, pure paging, and pure segmentation with
respect to the following issues:
- external fragmentation
- internal fragmentation
- ability to share code across processes
- (1+2+2=5 points) Program binaries in many
systems are typically structured as follows
(consult the diagram we have discussed often in
class). Code is stored starting with a small fixed
virtual address such as 0. The code segment is
followed by the data segment which is used for
storing the program variables. When the program
starts executing, the stack is allocated at the
other end of the virtual address space and is
allowed to grow today the lower virtual addresses.
What is the significance of the above structure on
the following memory management schemes:
- contiguous-memory allocation
- pure paging
- pure segmentation
- (2+3=5 points) Consider a paging system with
the page table stored in main memory.
- If a memory reference takes 200 ns, how
long does a paged memory reference take?
- If we add a TLB, and 75% of all page-table
references are found in the TLB, what is the
effective memory reference time? You may assume
that finding a page-table entry in the TLB
takes zero time if the entry is present (an
unrealistic assumption).
- (1+1+1+1+1=5 points) 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?
- 0,430
- 1,10
- 2,500
- 3,400
- 4,112
-
|