CSCE 451/851 Homework 1

Assigned: Feb 11, 2020
Due: Feb 25, 2020 midnight
Submit: Upload to Canvas as PDF
100 points total

  1. [2points] Is the operating system hardware or software?

    1. [8 points] What are the two main functions operating systems perform? HINT: from the user and system perspectives
  2. [5 points] Multiprogramming is key to a modern operating system’s operation. Explain why.

  3. [2 points] What do multiprogramming and time-sharing have in common?

    1. [4 points] How are they different?
    2. [4 points] Given the two scenarios below,
Scenario Choose Multiprogramming or Time-Sharing Justify
Multi-user system like the CSE server
Batch Processing System (does not interface with users)
  1. [4 points] What are kernel and user mode?

    1. [2 points] How are they different?
    2. [4 points] Why do we need these two separate modes?
  2. [4 points] Explain the need of a process table in a timesharing system.

    1. [2 points] Do we also need the process table in a UNIX or Windows based personal computer with a single user?
    2. [4 points] Justify your answer.
  3. [5 points] What is a “process image”?

    1. [5 points] Why do we need it?
  4. The following diagram shows three process states. In theory, we could have six transitions with three states (i.e., two transitions between each pair of states). The diagram, however, only includes four transitions. Could either or both of the missing transitions occur? HINT: think of the edge cases also, a possible optimization you can make to scheduler

    Process States
    1. [5 points] Ready to Blocked transition? If so, under which circumstances?
    2. [5 points] Blocked to Running transition? If so, under which circumstances?
  5. [10 points] When running an OS routine to handle an interrupt, why does a computer system often adopt a kernel stack that is separate from the interrupted user process’s user stack? (provide at least two reasons)

  6. [5 points] Including the initial parent process, how many processes are created by the following program?

    #include <studio.h>
    #include <unistd.h>
    
    int main()
    {
        int i; 
        for (i=0; i<3; i++)
            fork();
    
        return 0;
    }
  7. [4 points] What are process (or context) switch and mode switch?

    1. [6 points] How are they different? Give at least two differences.
  8. [6 points] What are short-term, medium-term, and long-term scheduling?

    1. [4 points] How are they different? Provide one reason.