Vous êtes sur la page 1sur 1

CMPE3001- OPERATING SYSTEMS

HOMEWORK I
Assigned Date : March 30th 2011 18:00
Due Date : April 18th 2011 17:00

This homework involves the following topics: Operating System Concepts and
Structures, Processes, Threads, CPU Scheduling, Process Synchronization and
Deadlocks.

Answer all of the questions. Try to give clear and detailed explanations where necessary.

1- What are the main purposes of operating systems.


2- Define the terms kernel mode and user mode. How does the distinction between kernel
mode and user mode function as a rudimentary form of protection (security) system?
3- Define multiprogramming, time-shared and real-time systems. Give examples for each
category.
4- Given the following arrival and burst times for processes,
Process Arrival Burst
P1 0.0 2
P2 0.5 4
P3 0.2 5
P4 1.0 1
P5 4.0 2
a. What is the turnaround and waiting time for each process using FCFS scheduling?
Draw the Gantt chart.
b. What is the turnaround and waiting time for each process using SJF scheduling?
Draw the Gantt chart.
c. What is the turnaround and waiting time for each process if we wait for 1.0 unit of
time and than start SJF scheduling? Draw the Gantt chart.
d. What is the turnaround and waiting time for each process if we use Round Robin
with time quantum q = 2.0? Draw the Gantt chart.
5- Explain the difference between threads and processes. What are the advantages/
disadvantages of using threads over processes.
6- Write a program that implements an alarm clock that causes the calling program wait
for a specified number of time units (ticks). Assume you have a real hardware clock
which invokes a tick function in your monitor.
7- Implement the producer-consumer problem using semaphores. Assume the producer
produces items one by one, while the consumer consumes two items at once.
8- System Calls
a. What is a system call? Give a detailed description. Give examples.
b. Find a system call tracer(tracker) software/command, install it. Trace the
system call for running a simple application program (e.g. Notepad). Take
screenshot of the system call trace and add it to your homework.
9- Can a system detect that some of its processes are starving? If you answer “yes,”
explain how it can. If you answer “no,” explain how the system can deal with the
starvation problem.

Vous aimerez peut-être aussi