Assignment

Contents:

  • Overview
  • Internet Requirements
  • Practice Problems
  • Problems to be Submitted
  • Extra Credit

  • Overview

    Topic: Operating Systems
    Related Reading: Ch. 10
    Due:

    Internet Requirements

    You will not need an Internet connection for completing the assignment, other than for submission.

    Practice Problems

  • Exercise 41 of Ch. 10 (p. 346); answer in back of text

  • Exercise 4 of Ch. 10 (p. 342); answer in back of text

  • Exercise 10 of Ch. 10 (p. 342); answer in back of text

  • Exercise 24 of Ch. 10 (p. 343); answer in back of text

  • Exercise 25 of Ch. 10 (p. 343); answer in back of text

  • Exercise 27 of Ch. 10 (p. 344); answer in back of text

  • Exercise 32 of Ch. 10 (p. 345); answer in back of text

  • Problems to be Submitted (20 points)

    1. (5 points)
      Exercise 42 of Ch. 10 (p. 346)

      You are asked to draw a Gantt chart. If you cannot easily mimic the diagrams from the text, please feel free to report the same information in whatever way you choose. For example, Exercise 41 of the text is a practice problem with the answer in the back of the text. I might choose to typeset that same answer in a table form, such as:

      From     To     CPU Runs
      ------------------------
        0      120       p1
      120      180       p2
      180      360       p3
      360      410       p4
      410      710       p5
      

    2. (5 points)
      Exercise 43 of Ch. 10 (p. 346)

    3. (4 points)
      If, in a dynamic-partition memory management system, the current value of the base register is 58712 in decimal, and the current value of the bounds register is 1587, compute the physical addresses that correspond to the following logical addresses:

      1. 509

      2. 808

      3. 1422

      4. 2535

    4. (3 points)
      Assume that dynamic partitioning is used for memory management and that currently there are six empty blocks with respective sizes 38, 85, 51, 99, 77, 27. A new job arrives requiring 52 blocks of main memory. Which size block would be used be each of the following partition selection approaches:

      1. first fit

      2. best fit

      3. worst fit

    5. (3 points)
      In a paged memory-management system, the frame size is 1024 and the following page map table applies to the currently executing process,
      Page01234
      Frame642287155
      Compute the physical addresses that correspond to the following logical addresses (<page, offset>):

      1. <3, 297>

      2. <1, 888>

      3. <4, 502>
    Overall, please type your answers to all of the problems in a single document to be submitted electronically. Please see details about the submission process.

    Extra Credit (2 points)

    All of the CPU scheduling examples given in the text involve the simpler case when all jobs "arrive" into the system at time 0. In this problem, we wish to examine the more general case which is when jobs arrive at differing times.

    Consider the following situation:

    JobArrival TimeService Time
    p1040
    p2020
    p3105
    p4111

    As described in the book, the Shortest Job Next (SJN) CPU scheduling algorithm is non-preemptive. Therefore, it produces the following Gantt chart (for simplicity, I'm typesetting the "chart" as the following table):

    fromtoCPU runs
    020p2
    2021p4
    2126p3
    2660p1
    Notice that at time 0, processes p3 and p4 have not yet arrived, and so of those processes which are ready, p2 is the shortest. It runs from time 0 to time 20. At time 20, when the scheduler decides on the next job, p1, p3, and p4 are available, and so p4 is the next to run as it is the shortest. After that job finishes, then p3 runs, and finally p1.

    What is interesting to note is that SJN is non-preemptive. That is, at time 10, when job p3 arrives, p3 is even shorter than the job which is currently running. However, the SJN scheduling algorithm lets p2 complete. Similarly when p4 arrives.

    A common preemptive variant of this is one which is called Shorest Remaining Processing Time (SRPT). With this scheme, if a new job arrives with a service time even less than the currently running job's remaining processing time, then the current job is preempted in favor of the new job. When any job completes, the scheduler will next give the CPU to the ready job with the smallest remaining processing time. So on the above example, the SRPT algorithm produces the following schedule:

    fromtoCPU runs
    010p2
    1011p3
    1112p4
    1216p3
    1626p2
    2660p1


    Your extra credit task is the following.
    Please give the Gantt chart which results from running the SRPT scheduling algorithm on the following set of jobs:

    JobArrival TimeService Time
    p1015
    p2020
    p3101
    p41213
    p5145
    p6244


    Last modified: 5 November 2002