Question: , Question 2 [ 2 0 Marks ] ( a ) In our kemel, context switching begins when the current running process calls tswitch (
Question Marks
a In our kemel, context switching begins when the current running process calls tswitch which changes the execution to a new process. Some people refer to this as a coroutine call, not a complete context switching. To soothe such critics, we may implement tswitch as
tswitch:
INT
ret
When the x CPU executes the INT instruction, it first saves the CPU's FLAG CSmathrmPC registers onto the current stack. Then, it loads the contents of the memory locations into CPU's PC CS causing it to execute from the newly loaded PC CS Corresponding to INT the instruction IRET pops items into the CPU's PC CS FLAG registers. If the memory contents of SAVEx Then, after INT the CPU would execute SAVE in our kernel.
Justify whether it is necessary to implement context switching this way,
b Assume that a process P has executed the following function calls:
Draw a diagram showing the stack contents of P when execution is at the label HERE in function Clearly show the stack frames of each function together with locations of FP and SP
Question Marks
Assume: In our kernel, P is a Casanova process, which hops from segment to segment. Initially, P runs in the segment times By a hop u segment syscall, it enter kemel to change segment. When it returns to Umode, it returns to an IDENTICAL Umode image but in a different segment, egtimes
a Devise an algorithm for the hop syscall.
b When a Casanova process tries to change its Umode segment, the target segment may already be occupied by another process. If so the original process must be evicted to make room for the Casanova process. Devise a technique that would allow the Casanova process to move into a segment without destroying the original process in that segment.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
