You are on page 1of 2

Page 1 of 2

FOUNDATION UNIVERSITY ISLAMABAD


RAWALPINDI CAMPUS
DEPARTMENT OF SOFTWARE ENGINEERING (DSE)
TERMINAL EXAMINATION (SPRING 2020)
Course Code: CSC 211 L Subject: Operating Systems Lab
Class: BCSE 4 A, B and Repeaters Semester: Spring 2020
Exam Type: Terminal Instructor: Umar Mahmud
Maximum Time: 180 minutes Maximum Marks: 35
Roll Number: ________________ Examination Month: 045 August 2020
Note
• Attempt all questions and all parts. Provide sound reasoning and supporting examples where necessary.
• If required, state your assumptions and do not give false arguments which may result in negative impact.
• You will only be graded for what you have committed to paper.
• What your thoughts are; cannot be quantified. What cannot be quantified; cannot be graded.
• You may use any tool to create your design, the outcome of complete exam must be in the form of a
single pdf file uploaded on LMS within the maximum time of 5 hours since start of exam.
• This is an open book exam
• There are 2 pages of the examination paper.
• Return the question paper with the answer book.
• Remember ‘A picture is worth a thousand words’
Q1 LINUX (5)

How can CPU information and RAM information be printed on screen in Linux? Write
appropriate commands and paste outcome screens here

Q2 THREADS (20)
Create a shared variable that keeps your roll number as an integer/long. Create three threads.
First thread will generate square of the shared variable and stores it back in the shared variable.
the second thread will generate the cube of latest value and stores it back in the shared variable.
The third thread will generate positive square root of the latest value. All values are shown on
screen in their correct order. The outcome should be properly formatted, and threads must be
scheduled.
You must copy paste code (formatted and commented) and outcome screens. Choice of
language and platform is totally left to you.

Terminal Examination – OS Lab – Spring 2020


Page 2 of 2

Q3 FORK IN LINUX (10)

Create the Process Tree using fork command in C Language over Linux as shown in Figure 1.

All processes print their own PID. You must copy paste code (formatted and commented) and

outcome screens.

Parent

Child 1 Child 2

Child Child
21 22

Child
221

Figure 1: Process Tree

THE END

Terminal Examination – OS Lab – Spring 2020

You might also like