$Id: review-os.txt,v 1.2 2006/04/11 20:02:06 locasto Exp $ Spring 2006 COMS1001 ---------------------------------------------------------------------- 0) What is a kernel? A kernel is the core of any operating system: it contains the code that is responsible for interfacing between applications and the hardware. Two major parts of the kernel are the process manager and the memory manager. 1) What are the major responsibilities of the OS? a) resource management * memory management * process management b) protection * of the hardware from users * of the OS from applications/users * of other user's data and programs from each other 2) Given the following jobs that all arrive at the same time: Job ID | Job Length | --------------------- A 10 B 25 C 40 D 100 Z 10 what is the: a) turnaround time b) wait time for each job under the following scheduling policies: 1) FCFS, no context switch time 2) SJN, no context switch time 3) RR, no context switch time 4) FCFS, 5ms total context switch time 5) SJN, 5ms total context switch time 6) RR, 5ms total context switch time Which algorithm is the most fair? Why? 3) Define PAS and diagram it. PAS is the process address space. It is a portion of memory that is associated with every process. Every process has its own PAS. Every PAS in a system has the same layout (although the boundaries of the stack and heap vary at any given time). The PAS contains 4 major parts: Text - the text segment contains the code or actual instructions of the program that is being executed Data - this section contains space for all the data and local variables that the program knows about before it is executed. This includes constants, string literals, etc. Stack - the stack is an area that keeps track of the control flow of the program at the functional level Heap - the heap is an area that provides storage for dynamically allocated variables +-----------------------+ | text | | | | | +-----------------------+ | data | +-----------------------+ | | | stack | +-----------------------+ | | | | \ / | | * | | | | . free mem | | /_\ | | | | +-----------------------+ | | | heap | +-----------------------+ There are as many PAS existing in memory as there are processes in the system. Each process has its own PAS. The OS is responsible for storing them in physical memory and mapping references from them to physical memory. 4) Diagram the graph that represents the process lifecycle. Why do processes have to be 'zombie' before they can be completely cleaned up (removed from the system)? Processes must be in a zombie state so that their parent process (if needed) wants to check the return status, they can do so.