Question
Q1. Consider the paging scheme. All numbers shown below and in your answer are in decimal. Assume that logical and physical addresses use 13 bits.
Q1. Consider the paging scheme. All numbers shown below and in your answer are in decimal. Assume that logical and physical addresses use 13 bits.
The page size is 1024 bytes.
Process 5 has 3 pages. It is loaded in a contiguous area of physical memory, starting at byte 4096. The bytes of the process appear in the same order in the physical memory as they are in the logical address space.
Show the complete page table of process 5 including all pages possible in this machine beyond the 3 pages. Show only two columnsthe page frame number and the Valid bit. Don't write the row numbers along the table.
Explain how you arrived at this table, in less than 50 words. Be careful. There are no partial credits for getting the table partially correct.
Q2. Consider a paging scheme.
Suppose the page frame size is 64 bytes. Suppose all of process A is currently loaded in memory.
Assume the page i of process A is loaded in page frame 3i for any page i of the process.
In process A, there is an array B[0..100]. Assume that each element of B occupies 4 bytes.
The physical address of the beginning byte of B[50] i.e., the byte 0 of B[50] is 1390.
Compute the physical address of B[100]. Show your calculations. Clearly write down the final answer in one place.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Consider the following solutions to the critical section problem with two processes i and j. The given code is for process i; the code of process j is symmetrical unless stated otherwise.
In each question, for each of the following properties, state whether it is satisfied or not YES or NO. In case your answer is YES, give an explanation . In case the answer is NO, give an appropriate example that proves your answer. In either case, your answer should be in 100 words or less.
a mutual exclusion b liveness c fairness
Q3. /*This is a minor modification of Peterson's Solution lines L1 and L2 have been reversed*/
Global code:
bool flag[i]=false, flag[j]=false; int turn=i;
Code of process i, enter_cs
L1: L2: L3:
turn= i; flag[i]= true; while flag[j] and turn== i;
Code of process i, exit_cs L4: flag[i]= false;
Q4.
This is a modification of Peterson's Solution see line L3.
Global code:
boolean flag[i]= false, flag[j]= false; int turn=i;
Code of process i, enter_cs
L1: flag[i]= true; L2: turn= i; L3: if turn==i
while flag[j];
Code of process i, exit_cs
L4: flag[i]= false;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started