Sale!

COP 4600 Homework 1 Solved

Original price was: $40.00.Current price is: $35.00. $29.75

Category:

Description

5/5 - (1 vote)

 Introduction to Operating Systems

Q1.  What are the three main purposes of an operating system? (1 point)

Answer:

 

 

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

 

Answer:

 

 

 

Q3. Describe the actions taken by a kernel to context-switching between processes. (1 point)

 

Answer:

 

 

 

Q4. What are the benefits and the disadvantages of each of the following?  (3 points)

  1. Synchronous and asynchronous buffering

 

Answer:

 

 

  1. Automatic and explicit buffering

 

Answer:

 

 

 

 

 

  1. Fixed-sized and variable-sized messages

 

Answer:

 

 

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

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

 

#include<stdio.h>

main()

{

int m=10, n=5,count=1, mult=1;

while(count <3)

{

if(m != 0)

{

m = fork(); n = n+25;

}

else

{

m = fork(); n = n+20; mult = mult*n;

}

printf(“ n = %d       mult  = %d”, n, mult);

count =count + 1;

}

}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

What is total number of processes?  Show your work.

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