Homework 5
cs550 Operating Systems
5 points EXTRA CREDIT
Due Wednesday, Dec. 10, 2014 at midnight
1. (1 point) Assume you are given the following memory, with
addresses below shown in bytes. Processes must be provided
with a single allocation of contiguous memory, but may placed
non-contiguously with respect to other processes. Where would
process P6 be placed, assuming it requires 300 bytes of memory,
given the following memory placement policies?
0
500 1000
1500 2100
3000 3400
3600 10000
+---------------------------------------------------------------+
| P1 | empty | P2 | empty
| P3 | empty | P4 |
empty |
+---------------------------------------------------------------+
a) Best Fit
b) First Fit
c) Worst Fit
2. (1 point) Using the page replacement policies listed below,
indicate show how the pages would be replaced for each page for both
of the following page utilization lists for both parts a) and b):
<3, 2, 5, 6, 8, 2, 4, 9, 1, 3>
<4, 5, 9, 9, 2, 3, 4, 8, 2, 1, 4, 8>
Assume only 4 pages may be in memory at any given time.
a) Least Recently Used
b) First In First Out
3. (1 point) Review and run the code at the following link on either LittleFe or the BCCD
virtual machine. What does it do? Describe what happens
when running the program.
4. (2 points) Modify the code to use different keys in place of Ctrl-C, Ctrl-Z, Ctrl-/, and the
regular kill
<pid> command.
Use window resizing in place of the kill command, use SIGABRT in place of Ctrl-C (hint: check
the following website http://en.wikipedia.org/wiki/Unix_signal,
and use the option -SIGABRT
with kill to
test this), Ctrl-T
in place of Ctrl-Z,
and SIGSEGV in
place of Ctrl-/
Be aware that you will have to open an additional terminal window
and use ps -fu
username to find the process name and kill it when you are
finished using the following command:
kill -9 <pid>
where <pid>
is the process identifier of your process.