You are on page 1of 2

Department of Computer Science

1411352: Operating Systems Section: 11


Homework # 1 Spring 2016-17 CRN: 21156
Given Date: 6/3/17 Deadline: 16/3/17

Name: __________________ ID: ____________________

Name: __________________ ID: ____________________

IMPORTANT NOTE:

1. The homework may be done in groups, consisting not more than TWO students.
2. The homework must be submitted both in soft form using Black Board and in printed form to
the instructor.
3. The title page (this page) must be submitted along with the homework.
4. For programming problems, 75% marks will be assigned to code correctness and modularity
whereas 25% marks will be assigned to the output snapshots of the programs.

Homework Assessment
Assessment
Assessment Criteria Max. Marks Marks Obtained
Item
Code correctness + modularity
Q1. (10 marks) 15
Output using ps utility (5 marks)
Q2. Logical correctness + clarity 10

Total 20
Department of Computer Science
1411352: Operating Systems Section: 11
Homework # 1 Spring 2016-17 CRN: 21156
Given Date: 6/3/17 Deadline: 16/3/17

Name: __________________ ID: ____________________

Name: __________________ ID: ____________________


Q1. Write a program for the following problems. It is recommended that the programs should be written and
run on Ubuntu environment using C/C++. However, students can also use other tools to accomplish the
following tasks, such as using Java on Win32 API, etc. Each program must be submitted with the output
screen snapshot.

a) Create a (child) process that may or may not copy the parent address space and then make the child
as a zombie process. Use ps utility to demonstrate that the zombie has been created. Please note that
the zombie process will be depicted as <defunct>.
b) Use the procedure followed in 1(a) to make the child process as orphan. Using ps utility to show that
the orphan process has been handed over to the init process whose pid is 1.
c) Create a child process that execute the following commands from the command line. You can use the
exec() family of system calls.
a. ls (with switches/parameters, such as > ls -l)
b. echo (with a string parameter, such as > echo this is OS class and echo $PATH)
c. pwd

Hints: you can use manual pages to learn about ps utility in Ubuntu by using command, man ps.

Q2.

a) Differentiate between multiprogramming, multitasking and multiprocessing.

b) Why system calls are used, i.e. the purpose of system calls? How they are different than the
library functions.
c) What is context switch? Describe in brief, what are the actions the kernel needs to take in
order to context switch between running processes.
d) What are the advantages of separating a mechanism from policy?

You might also like