100% found this document useful (1 vote)
557 views

Os Lab - Terminal Exam - Spring 2021

This 3-page document is an examination for an Operating System Lab course. It contains 3 questions worth a total of 25 marks. Question 1 involves creating a folder hierarchy using Linux commands and shell scripting. Question 2 involves allocating processes of different sizes to memory slots using different allocation algorithms. Question 3 involves writing a C program to create 2 processes, one to check if a number is prime and the other to calculate the sum of even and odd numbers in an array, and explaining why processes need synchronized access to shared resources.

Uploaded by

Maaz Chauhann
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
557 views

Os Lab - Terminal Exam - Spring 2021

This 3-page document is an examination for an Operating System Lab course. It contains 3 questions worth a total of 25 marks. Question 1 involves creating a folder hierarchy using Linux commands and shell scripting. Question 2 involves allocating processes of different sizes to memory slots using different allocation algorithms. Question 3 involves writing a C program to create 2 processes, one to check if a number is prime and the other to calculate the sum of even and odd numbers in an array, and explaining why processes need synchronized access to shared resources.

Uploaded by

Maaz Chauhann
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

TERMINAL EXAMINATION

Course Code: CSC 211 L Subject: Operating System Lab


Class: BCSE-4 Semester: Spring 2021
Exam Type: Online Instructors: Fauzia Khan
Maximum Time: 3 Hours including upload Maximum Marks: 25
Examination Date: 25 June 2021 Viva: 25
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.
 There are 4 pages of the examination paper.
 Remember ‘A picture is worth a thousand words.’
 Submit your solution in soft format on LMS portal within 3 hours of start of exam. Any submission
after the prescribed 3 hours will not be entertained.
 You can also submit your work via email. However, emails received after 3 hours will not be
entertained. Email can be sent on [email protected]
 All submissions will be subject to plagiarism check via Turnitin. Plagiarized submission will be
rejected.
 Write your full name and roll number in the footer of each page.
Question # 01 (a): (3 Marks)

Make a hierarchy of folders on linux desktop as shown in diagram by using commands on


Linux terminal.

Question #1 (b): (2 Marks)


Solve the above question using shell scripting. Run it and display the output. Also write step
by step procedure form making shell file to run it. Also paste screen shot of full window for
both parts.
Question # 02: (10 Marks)
Suppose there is memory slot available in table shown below:
Whereas process are:
P1=5 K
P2=500 K
P3=200 K
P4= 14 K
P5= 25 K
P6= 600 K
P7=10 K
Fill up the memory using First, Next, Best, Worst Fit algorithm and calculate internal
fragmentation for each algorithm separately.
Note: Block shown in red are occupied by some processes.
You have solve this question by hand.

18 K

Last Two Digits of Your roll number

Last two Digital of Your roll number *10

(Last two Digital of Your roll number *10)/2


100 K

Reverse the last digitals your roll number +13

Reverse the last digitals your roll number


+500

180 K

Reverse your roll number *10

Example Table:
Suppose your roll number is 023, Consider the above table will be filled as:
18 K

23

23 *10=230

230/2=165 (if answer is in decimal discard


fractional part)

100 K

32 +13=45

32 +500=532
180 K
32 *10=320
Question #03 (a): (7 Marks)
Write a code which creates two processes:
1. Parent process takes a number and calculates whether its prime number or not.
2. Child process calculates the sum of odd numbers and even numbers of an array.

Note: Also paste code and screenshots for code and output here.

Question #03 (b): (3 Marks)


Why is it necessary that processes should access shared resources in a synchronized manner?
What could be possible solutions to make processes execute in a synchronized way to access
the shared resources in a synchronized way? Explain in your own words by hand.

--------------------------------------Good Luck---------------------------------

You might also like