Introduction to Operating Systems

COP 4600

Homework #1

Due date: 09/25/2016 at 11:59 pm

Instructions:

HW must be submitted on typed pdf or word document.

You must do your work on your own. Late work will be not accepted.

Q1. What is the main advantage for an operating-system designer of using virtual-machine architecture? What is the main advantage for a user?(1 points)

Answer:

The system is easier to debug, and security problems are easier to solve. Virtual machines also provide a better platform for operating system research since many different operating systems may run on one physical system and system bugs will not crash machine and cause downtime.

Q2. Describe the similarities and differences between Unix and Linux OSs(3 points)

Answer:

Linux is open source and community based where Unix is more commercial based. Unix is mainly for servers where Linux is for end users as well. Overall Linux is more flexible in hardware and software vs closed Unix.

Q3. What are the benefits and the disadvantages of the automatic and explicit buffering? (1 point)

Answer:

Benefit of automatic buffering: It provides a queue with indefinite length, to ensure you wont have the block while waiting to copy a message. The disadvantage is there is no specific scheme on how much memory is buffered which may reserve a large portion which is then wasted.

Explicit Buffering specifies how big the buffer is, and they sender may be blocked while waiting for available space in the queue. The benefit is that you are less likely to waste memory.

Q4. Assume that the following program contains no syntax errors. As it executes it will create one or more processes. (3 points)

Simulate the execution of this program and show how processes are created

What is total number of processes? Show your work.

What will this program print on the screen when it executes?

A new process is created for each fork call until the count becomes 3, when “m” is not 0 a new process is created. When m is 0 then a new process is created and n is set to 50.

Total Number of Processes: 6

Program Output:

n= 30 mult =1

n= 30 mult =1

n=55 mult =1

n=55 mult =1

n=50 mult =50

n=50 mult =50

6.The CPU and I/O times for 2 processes are shown below. Assume that PI gets to the ready queue just before P2 and the scheduling algorithm used by the OS is Round Robin with a time slice of 4 time units. Assume that the I/Os for the processes are different so that there is no I/O queue. Assume also that an interrupt from a completed I/O for process "X" will place process "X" in the ready queue BEHIND the process that was just interrupted. (2 points)

a.Using the first empty graph, describe how the CPU will be assigned to each process and for how long.

b.Use the second empty graph to show ALL the states that P1 goes through and the amount of time it has remained in that state until it has halted.