Computer Sience

|                     |2010                                 |
|                     |                                     |
|                     |                                     |
|                     |                                     |

|[Ass# 2]                                                                                                                       |
|                                                                                                                               |

Course: CS 330

Student Name: Sara Al Shehri

ID# 207410089

Introduction to Operating Systems - CS330

Assignment 2

1. What is the main advantage of the layered approach to system design?

The main advantage of the layer approach is simplicity of construction and debugging. The layer are selected so that each uses functions and services of only lower levels layers. This approach simplifies debugging and system verification.

2. What is the purpose of the command interpreter? Why is it usually separate from the kernel?
  The purpose of the command interpreter is to get and execute the next user specified command.

  3. Describe the actions a kernel takes to context switch between processes.

When a context switch occurs, the kernel saves the context of the old process in its PCB and load the saved context of the new scheduled to run. Context-switch time is pure overhead, because the system does no useful work while switching.

  4. Explain precisely how a new process is created in UNIX?

In UNIX, each process is identified by its process identifier, wich is a unique integer. A new process is created by the fork () system call. The new process consists of a copy of the address space of the original process. This mechanism allows the parent process to communicate easily with its chilled process. Both process (parent and chilled) continue execution at the instruction after the fork(), with one difference: the return code for the fork() is...