Student Name:_____SOLUTION_____________________________ Student ID:____________________
LE/EECS 3221 – Operating System Fundamentals
Fall 2019 – Section A
Midterm Exam (October 29, 2019)
Duration: 120 Minutes Start Time: 19:15
This examination paper includes 6 pages (including this cover page and printed both sides).
Please count the pages and inform the invigilator immediately if there is an issue. There
m
er as
are 39 questions in the exam.
co
eH w
Please read the following instructions carefully:
•
o.
Write your name and/or ID on each page of this exam booklet.
• rs e
You must answer on the answer booklet provided to you.
ou urc
• You must return the exam booklet with the answer booklet.
• Use of any calculator is allowed. Sharing is not permitted. Phone calculators are not
o
permitted.
aC s
• Please write clearly.
vi y re
• Try to answer as briefly as possible.
• If you have confusion regarding any question statement, write your assumptions and
ed d
answer accordingly. Make sure your assumptions are logically correct.
ar stu
Section Total Score Student Score
sh is
Th
A 14
B 20
C 20
Total 54
Winter 2019 LE/EECS 3221
https://www.coursehero.com/file/74272162/EECS-3221-F19-MainM-Solutionpdf/
1
, Student Name:_____SOLUTION_____________________________ Student ID:____________________
Section A
1. What is the purpose of strace utility? [1 Mark]
It traces system calls invoked by a process
2. Name different segments of memory area allocated to a process. Also mention their purpose.
[2 Marks]
Text section: contains program code
Stack: containing temporary data such as function parameters, return addresses, local variables
Data section containing global variables
Heap containing memory dynamically allocated during run time
m
er as
(0.25 per name, 0.25 per description [ignore minor issues in description])
co
3. When context switching happens, what is the most important information that must be updated in the
eH w
PCB of outgoing process so that it’s execution can be successfully resumed later? Mention at least two
o.
items.
rs e [1 Mark]
ou urc
Program Counter, Registers, Memory Limits, Open Files [Any two is correct, 0.5 per item]
4. Describe cascading termination. [1 Mark]
o
If a process terminates, all of its children processes will be terminated. [Don’t look for precise
aC s
vi y re
wording]
5. If a process has multiple threads, can we execute those threads in parallel on a single processor single
core system? [1 Mark]
ed d
No
ar stu
6. Describe Data Parallelism with the help of an example. [1 Mark]
Distribute subsets of the same data across multiple cores/CPUs/machines/processors, to
perform same operation on each such task [0.5 mark]
sh is
For example, to search k in a huge list, a portion of list is passed to each
Th
core/CPU/machine/processor so that it can search k in that portion [0.5 mark; other examples
with similar sense are possible]
7. How different threads of the same process can communicate with each other inside the process space?
Mention at least one mechanism. [1 Mark]
Shared or global variables (1 mark) or Files(0.5)
8. Name the two approaches used for Thread cancellation. [1 Mark]
Deferred, Asynchronous (0.5 per item)
9. What is the purpose of clone() system call? [1 Mark]
Creates a thread or child task
Winter 2019 LE/EECS 3221
https://www.coursehero.com/file/74272162/EECS-3221-F19-MainM-Solutionpdf/
2
LE/EECS 3221 – Operating System Fundamentals
Fall 2019 – Section A
Midterm Exam (October 29, 2019)
Duration: 120 Minutes Start Time: 19:15
This examination paper includes 6 pages (including this cover page and printed both sides).
Please count the pages and inform the invigilator immediately if there is an issue. There
m
er as
are 39 questions in the exam.
co
eH w
Please read the following instructions carefully:
•
o.
Write your name and/or ID on each page of this exam booklet.
• rs e
You must answer on the answer booklet provided to you.
ou urc
• You must return the exam booklet with the answer booklet.
• Use of any calculator is allowed. Sharing is not permitted. Phone calculators are not
o
permitted.
aC s
• Please write clearly.
vi y re
• Try to answer as briefly as possible.
• If you have confusion regarding any question statement, write your assumptions and
ed d
answer accordingly. Make sure your assumptions are logically correct.
ar stu
Section Total Score Student Score
sh is
Th
A 14
B 20
C 20
Total 54
Winter 2019 LE/EECS 3221
https://www.coursehero.com/file/74272162/EECS-3221-F19-MainM-Solutionpdf/
1
, Student Name:_____SOLUTION_____________________________ Student ID:____________________
Section A
1. What is the purpose of strace utility? [1 Mark]
It traces system calls invoked by a process
2. Name different segments of memory area allocated to a process. Also mention their purpose.
[2 Marks]
Text section: contains program code
Stack: containing temporary data such as function parameters, return addresses, local variables
Data section containing global variables
Heap containing memory dynamically allocated during run time
m
er as
(0.25 per name, 0.25 per description [ignore minor issues in description])
co
3. When context switching happens, what is the most important information that must be updated in the
eH w
PCB of outgoing process so that it’s execution can be successfully resumed later? Mention at least two
o.
items.
rs e [1 Mark]
ou urc
Program Counter, Registers, Memory Limits, Open Files [Any two is correct, 0.5 per item]
4. Describe cascading termination. [1 Mark]
o
If a process terminates, all of its children processes will be terminated. [Don’t look for precise
aC s
vi y re
wording]
5. If a process has multiple threads, can we execute those threads in parallel on a single processor single
core system? [1 Mark]
ed d
No
ar stu
6. Describe Data Parallelism with the help of an example. [1 Mark]
Distribute subsets of the same data across multiple cores/CPUs/machines/processors, to
perform same operation on each such task [0.5 mark]
sh is
For example, to search k in a huge list, a portion of list is passed to each
Th
core/CPU/machine/processor so that it can search k in that portion [0.5 mark; other examples
with similar sense are possible]
7. How different threads of the same process can communicate with each other inside the process space?
Mention at least one mechanism. [1 Mark]
Shared or global variables (1 mark) or Files(0.5)
8. Name the two approaches used for Thread cancellation. [1 Mark]
Deferred, Asynchronous (0.5 per item)
9. What is the purpose of clone() system call? [1 Mark]
Creates a thread or child task
Winter 2019 LE/EECS 3221
https://www.coursehero.com/file/74272162/EECS-3221-F19-MainM-Solutionpdf/
2