Assignment 3 (Physics for Scientists & Engineers , By/ Serway, 6th ... - DOC - DOC by HC120522192356

VIEWS: 4 PAGES: 5

									       University of Palestine
   College of Applied Engineering
         & Urban Planning
  Software Engineering Department



     Operating Systems

   Report Title Name




        Prepared By :

Ramy Yousef Baraka.
  No: 120070596.

      Supervised By :

 Mr Ahmed AlAstal

  Der El-Balah City, Gaza, Palestine,
         Mobile: 0599288081
 Email: ramy_eng2008@hotmail.com
 Chapter 2:


Q2.1. What are three objectives of an OS design?

 • Convenience: An OS makes a computer more convenient to use.
 • Efficiency: An OS allows the computer system resources to be used in an
 efficient manner.
 • Ability to evolve: An OS should be constructed in such a way as to permit the
 effective development, testing, and introduction of new system functions without
 interfering with service.



Q2.2. What is the kernel of an OS?

  Portion of operating system that is in main memory and contains most frequently
  used functions and also called the nucleus


Q2.3. What is multiprogramming?

     Multiprogramming is the technique of running several programs at a time
     using timesharing. It allows a computer to do several things at the same time.
     Multiprogramming creates logical parallelism. The concept of
     multiprogramming is that the operating system keeps several jobs in memory
     simultaneously. The operating system selects a job from the job pool and starts
     executing a job, when that job needs to wait for any i/o operations the CPU is
     switched to another job. So the main idea here is that the CPU is never idle.

Q2.4. What is a process?

     A program in execution.
     An instance of a program running on a computer.
     The entity that can be assigned to and executed on a processor.
     A unit of activity characterized by a single sequential thread of execution, a
     current state, and an associated set of system resources.
 Chapter 3:


Q3.2. What common events lead to the creation of a process?

     New batch job : The OS is provided with a batch job control stream, usually
     on tape or disk. When the OS is prepared to take on new work, it will read the
     next sequence of job control commands.

     Interactive logon : A user at a terminal logs on to the system.

     Created by OS to provide a service : The OS can create a process to perform
     a function on behalf of a user program, without the user having to wait (e.g., a
     process to control printing.)

     Spawned by existing process : For purposes of modularity or to exploit
     parallelism, a user program can dictate the creation of a number of processes.

Q3.4. What does it mean to preempt a process?

     The term preemption: is defined to be the reclaiming of a resource from a
     process before the process is finished using it. In this case, the resource is the
     processor itself. The process is executing and could continue to execute, but is
     preempted so that another process can be executed.

Q3.5. What is swapping and what is its purpose?

Swapping: When none of the processes in main memory is in the Ready state, the OS
swaps one of the blocked processes out onto disk into a suspend queue. This is a queue
of existing processes that have been temporarily kicked out of main memory, or
suspended queue, or it honors newly arrived process.

Purpose: The OS needs to release sufficient main memory to bring in a process that is
ready to execute.
Q3.6. Why does Figure 3.9b have two blocked states?

• Blocked →Blocked/Suspend: If there are no ready processes, then at least one
blocked process is swapped out to make room for another process that is not blocked.
This transition can be made even if there are ready processes available, if the OS
determines that the currently running process or a ready process that it would like to
dispatch requires more main memory to maintain adequate performance.
• Blocked/Suspend → Ready/Suspend: A process in the Blocked/Suspend state is
moved to the Ready/Suspend state when the event for which it has been waiting occurs.
Note that this requires that the state information concerning suspended processes must
be accessible to the OS.

Q3.9. List three general categories of information in a process control block.

     • Process identification
     • Processor state information
     • Process control information
Q3.11. What are the steps performed by an OS to create a new process?

     1. Assign a unique process identifier to the new process.
     2. Allocate space for the process.
     3. Initialize the process control block.
     4. Set the appropriate linkages.
     5. Create or expand other data structures.

 Problems: 3.2

Consider a computer with N processors in a multiprocessor configuration.
  a. How many processes can be in each of the Ready, Running, and Blocked
     states at one time?

  Ready (Many), Running (N), and Blocked (Many) states at one time

b. What is the minimum number of processes that can be in each of the Ready,
Running, and Blocked states at one time?

  Ready (0), Running (0), and Blocked (0) states at one time
Chapter 4:
Q4.5. What resources are typically shared by all of the threads of a process?


     Thus, all of the threads of a process share the state and resources of that
     process. They reside in the same address space and have access to the same
     data.
     When one thread alters an item of data in memory, other threads see the results
     if and when they access that item. If one thread opens a file with read
     privileges, other threads in the same process can also read from that file.

								
To top