HW #2

1.  What characteristic is common to traps, interrupts, system calls,
    and subroutine calls?

2.  What characteristic is common to traps, interrupts, and system
    calls, but different in subroutine calls?

3.  What characteristic do subroutine calls and systems calls have,
    but traps and interrupts do not?

4.  Which of the following instructions should be privileged (can only
    be accessed in kernel mode?)  Explain why or why not in a sentence 
    or two.
	a) change memory management registers
	b) write the program counter
	c) read the time-of-day clock
	d) set the time-of-day clock

5.  For each of the following transitions between process states,
    indicate whether the transition is possible.  If it is possible, 
    give an example of one thing that would cause it.
	a) Running --> Ready
	b) Running --> Waiting
	c) Running --> Swapped-blocked
	d) Waiting --> Running
	e) Running --> Terminated

6.  For the processes listed below, draw a Gantt chart illustrating
    their execution using:  a) FCFS, b) SJF, c) SRTF, d) RR (q=2), 
    e) RR (q=1).  For each scheduling algorithm, give the average 
    turnaround time and the average wait time.

     process  arrival  CPU
        id     time   burst
     ----------------------
	P1	0	3
	P2	1	6
	P3	4	4
	P4	6	2