CSE 330  Operating Systems Spring 2020
Assignment: #1
Due date: Feb 10

Note: You may choose to do this HW in groups of 2 or do it individually. Your choice, but if done in a group submit only 1 copy with two names.

1.      What are the differences between a trap (aka software interrupt) and an interrupt (hardware interrupt)? What is the use of each function?

 

2.      What is kernel mode (same as privileged mode)? Which of the following instructions should be privileged?

a.      Change from some mode to user mode.

b.      Write into monitor memory.

c.       Turn off interrupt

d.      Switch from user to monitor mode

3.      What is the purpose of system calls? How are they implemented?

 

For the questions below that involve Gantt charts, you can draw them approximately specially for round robin that is for RR you do not have to show every context switch.

4.      Consider the following set of processes, with only 1 CPU burst. The length of the CPU-burst time given in some unit t:

  

Process

Burst Time (t)

Priority

P1

10

3

P2

1

1

P3

2

3

P4

1

4

P5

5

2

 

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.

 

a.     Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, a non-preemptive priority scheduling (a smaller priority number implies a higher priority), and RR (quantum = 1t).

b.     What is the turnaround time of each process for each of the scheduling algorithms in part a?

5.      The following processes have 4 CPU burst and 3 I/O bursts each. They are all of the same priority and they arrive in the order P1, P2, P3 at time 0.

  

CPU

I/O

CPU

 

CPU

I/O

CPU

P1

10

10

10

10

10

10

10

P2

5

5

5

5

5

5

5

P3

5

10

5

10

5

10

5

 

a.           Draw three Gantt charts illustrating the execution of these processes using FCFS, SJF, and RR (quantum = 1t) scheduling.

 

b.           What is the turnaround time of each process for each of the scheduling algorithms in part (a)?

 

Submission: Upload to canvas as one .doc or .pdf file. If you choose to handwrite, or use hand-drawn diagrams, take a picture of these material and embed them into the .doc or .pdf file. Make sure your name(s) are on the document.