In: Computer Science
1)Given that main memory is composed of only three page frames for public use and that a seven-page program (with pages a, b, c, d, e, f, g) that requests pages in the following order: a, b, c, b, d, a, e, f, b, e, d, f a)Using the FIFO page removal algorithm, indicate the movement of the pages into and out of the available page frames (called a page trace analysis) indicating each page fault with an asterisk (*). Then compute the failure ratio and success ratio. b)Using FIFO again, increase the size of memory so it contains four page frames for public use. Using the same page requests as above, do another page trace analysis and compute the failure and success ratios.
2)Given the following Segment Map Tables for two jobs:
SMT for Job 1 Segment Number |
Memory Location |
0 |
4096 |
1 |
6144 |
2 |
9216 |
3 |
2048 |
4 |
7168 |
SMT for Job 2 Segment Number |
Memory Location |
0 |
2048 |
1 |
6144 |
2 |
9216 |
a. Which segments, if any, are shared between the two jobs?
b. If the segment now located at 7168 is swapped out and later reloaded at 8192, and the segment now at 2048 is swapped out and reloaded at 1024, what would the new segment tables look like?
(1)
Number of page frames available = 3
Order of the page requests = a, b, c, b, d, a, e, f, b, e, d, f
Algorithm used: FIFO
Page Trace Analysis :
Page Request | a | b | c | b | d | a | e | f | b | e | d | f |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Page Fault | * | * | * | * | * | * | * | * | * | |||
Page Frame 1 | a | a | a | a | d | d | d | f | f | f | f | f |
Page Frame 2 | b | b | b | b | a | a | a | b | b | b | b | |
Page Frame 3 | c | c | c | c | e | e | e | e | d | d |
Note that the oldest page or First in page which needs to be swapped is shown in Bold.
The Order is a*, b*, c*, b, d*, a*, e*, f*, b*, e, d*, f
Failure Ratio = 9/12 = 0.75 or 75%
Success Ratio = 3/12 = 0.25 or 25%
(b)
Number of page frames available = 4
Order of the page requests = a, b, c, b, d, a, e, f, b, e, d, f
Algorithm used: FIFO
Page Trace Analysis :
Page Request | a | b | c | b | d | a | e | f | b | e | d | f |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Page Fault | * | * | * | * | * | * | * | |||||
Page Frame 1 | a | a | a | a | a | a | e | e | e | e | e | e |
Page Frame 2 | b | b | b | b | b | b | f | f | f | f | f | |
Page Frame 3 | c | c | c | c | c | c | b | b | b | b | ||
Page Frame 4 | d | d | d | d | d | d | d | d |
The Order is a*, b*, c*, b, d*, a, e*, f*, b*, e, d, f
Failure Ratio = 7/12 = 0.583 or 58.3%
Success Ratio = 5/12 = 0.416 or 41.6%
(2)
(a)
From the given Segment Map Tables for Job1 and Job2,
The following segments which are located at memory location 2048, 6144 and 9216 are shared by Job1 and Job2.
(b)
New SMT for Job1:
Segment Number | Memory Location |
---|---|
0 | 4096 |
1 | 6144 |
2 | 9216 |
3 | 1024 |
4 | 8192 |
New SMT for Job 2:
Segment Number | Memory Location |
---|---|
0 | 1024 |
1 | 6144 |
2 | 9216 |