Mid1 Revision

12
Mid#1 Revision

description

 

Transcript of Mid1 Revision

Page 1: Mid1  Revision

Mid#1 Revision

Page 2: Mid1  Revision

Quick Revision

Page 3: Mid1  Revision

CH1 Mind map

Page 4: Mid1  Revision

Ch2 Mind map

Page 5: Mid1  Revision

Sample Exam

Page 6: Mid1  Revision

Types of Questions

• Short Answers (essay)

• True/False

• MCQ

• Problems

• Code to trace

Page 7: Mid1  Revision

Short Answer

• Q: what is the benefit of using the TOP command?– it is useful for showing which processes are

consuming the most OS resources at any time.

• Q: What is the difference between heap and stack?– Stack: for keeping track of subroutine calls.– Heap: for Intermediate data computation.

Page 8: Mid1  Revision

Short Answers

• Define a monolithic kernel and compare it to a microkernel?

• A monolithic kernel essentially is designed to have all the system services encapsulated in one module with a tight communication and sharing of structures between the individual OS components. As opposed to a microkernel which takes the different tact of providing a set of minimal functions in the kernel and implement higher level OS features in other modules (running either in user mode or kernel mode). As monolithic kernel if it can be made bug free can on average perform better than a microkernel system that has some additional communication overhead between components.

Page 9: Mid1  Revision

Short Answers

• What is the purpose of interrupts? What are the differences between a trap and an interrupt? Can traps be generated intentionally by a user program? If so, for what purpose? (from your textbook)

• Answer: An interrupt is a hardware-generated change-of-flow within the system. An interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction. A trap is a software-generated interrupt. An interrupt can be used to signal the completion of an I/O to obviate the need for device polling. A trap can be used to call operating system routines or to catch arithmetic errors.

Page 10: Mid1  Revision

True or False

• Process scheduler selects an available process for program execution on the CPU. The operating system uses short term scheduler to schedule processes for the first few hours after booting a machine. Afterwards, it uses the long term scheduler. The specific durations to use the short term and long term scheduler can be configured while building the kernel. True or False?

Page 11: Mid1  Revision

MCQ

• Which context switch is faster?– Between threads.– Between processes.

• A process created by using the fork() system call in UNIX– Shares its address space with its parent.– Gets an identical copy of the address space

of its parent.

Page 12: Mid1  Revision

Problems

• In a short-term scheduler it takes 10ms to decide to execute a process for 50ms, what percent of the CPU time is being wasted by scheduling time?

• 10/(50+10)=6 %

• Code to Trace - similar to what has been covered in the Tutorial.