Operating Systems

On Chapter 03
Problem 1 (Writing assignment, 30 points): Virtual Address
Suppose that a machine has 42-bit virtual addresses and 32-bit physical addresses.
a. How much RAM can the machine support (each byte of RAM must be
addressable)?
b. What is the largest virtual address space that can be supported for a process?
c. If pages are 2 KB, how many entries must be in a single-level page table?
d. If pages are 2 KB and we have a two-level page table where the first

level is
indexed by 15 bits, then how many entries does the first-level page table have?
e. With the same setup as part {d}, how many entries are in each second-level page
table?
f. What is the advantage of using a two-level page table over single-level

page table?
Problem 2 (Programming assignment, 70 points): Process Scheduling
Our CPU is currently idle and the current time is labeled time 0. Four processes arrive to
the ready queue at the following times and with the following required run time:
Process–Arrival Time–Run Time
A– 0 — 10
B– 1– 29
C– 2 — 8
D– 3 — 4
Write a program that simulates the process scheduling and execution under the FCFS,
SJF, and SRTN scheduling algorithms. Indicate each scheduling decision, and calculate
the turnaround time for each process. Also calculate the average turnaround time for each
scheduling algorithm. A (rough) sample solution for FCFS is given below to give an idea
of the format for your answer:
FCFS:
At time 0, proc A arrives and is scheduled to run since the queue is empty
At time 1, proc B arrives but is put on the queue [B] since A is running
At time 2, proc C arrives but is put on the queue [B,C]
At time 3, proc D arrives but is put on the queue [B,C,D]
At time 10, proc A completes (turnaround is 10), and proc B starts [C,D]
etc.Note that the ready queue is given in brackets [] after each step. Also note that you only
need to specify points of interest. I didn’t say, at time 4 process A continues to run, at
time 5 process A continues to run, etc. Don’t forget to indicate the turnaround time for
each process and the average turnaround time for each algorithm.
Instructions:
1. Your programs MUST compile and run. Otherwise, you will lose significant
points.
2. Submit solution for each problem in a separate zipped (or tar/similar)
archive file through Moodle. Email me your work ONLY IF Moodle is not
working.
3. Name each archive file as HW2_YourFirstName_YourLastName_X, where X is
the problem number.
4. All work must be your own. This is not a team assignment.
5. The submission deadline is firm. Start early and submit on time.

© 2020 customphdthesis.com. All Rights Reserved. | Disclaimer: for assistance purposes only. These custom papers should be used with proper reference.