Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Consider an SMP system similar to the one shown in Figure 1.6. Illustrate wit

ID: 669331 • Letter: 1

Question

1) Consider an SMP system similar to the one shown in Figure 1.6. Illustrate with an example how data residing in memory could in fact have a different value in each of the local caches. 2) What is the purpose of interrupts? How does an interrupt differ from a trap? Can traps be generated intentionally by a user program? If so, for what purpose? 3) How could a system be designed to allow a choice of operating systems from which to boot? What would the bootstrap program need to do? 4) Describe three general methods for passing parameters to the operating system 5) What are the two models communication? What are the strengths and weaknesses of the two approaches? 6) Why is the separation of mechanism and policy desirable? 7) What are the advantages of using loadable kernel modules?

Explanation / Answer

1) The figure required for the question is not available. Please add the figure.

2 ) Purpose of an interrupt- Interrupt is generated by the processor to show that some event requires immediate attention. It is a high priority condition that requires interruption of the current execution. Once the interrupt is handled execution returns to the earlier executing process.

An interrupt is a hardware generated alert whereas traps are software generated alerts.
interrupts must preserve earlier state of the CPU whereas a trap doesnot save the previous state of CPU.


Yes a trap can be generated intentionally by user programs to call the OS routines ,facilitate debugging or to find arithmetic errors.


3) A program called boot mananger runs during startup and provides the choice of operating system to the user. Depending on the choice that operating system is booted. Both operating system exist on the disk.

4) a) the simple approach would be to pass parameters using registers.
b) other approach would be to store the parameter in the main memory and the address of this memory space is stored in a register,which is then passes to the OS.
c) Store the parameters on the stack using a program and operating system can pop off the parameters from the stack.

5)
Two models of interprocess communication are: -
a) Message passing
b) Shared Memory

Advantage of Message passing is that program structure is maintained and they are well seperated.
Disadvantage is that message passing is slow.

Advantage of shared memory is that it is fast and direct as compared to message passing.
Disadvantage - there may be unexpected results in case program wrongly acceses a shared memory.


6) Policy and machanism should be separate to make the system easily modifiable.Each intallation is operating system specific in its needs. Keeping policy and mechanism ensures that the policy may change without disturbing the mechanism providing a flexible system.

7) A kernel module is a piece of code that adds functionnalities to the kernel without needing to recompile or reboot the system.
The loadable kernel module saves memory as it is not saved directly into base kernel,and functions as a base kernel including take control or monitor the running system,create or intercept system calls, etc.