Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Operating System (CS604)

Assignment # 02
Spring 2021

 

Total marks 20                                                                              

 

Deadline Date
03/06/2021

 

 

Please carefully read the following instructions before attempting the assignment.

 

RULES FOR MARKING

It should be clear that your assignment would not get any credit if:

  • The assignment is submitted after the due date.
  • The submitted assignment does not open or the file is corrupt.
  • Strict action will be taken if the submitted solution is copied from any other student or the internet.

 

You should consult the recommended books to clarify your concepts as handouts are not sufficient.

Assignment Submission:

You are supposed to submit your assignment in .doc or Docx format.

Any other formats like scan images, PDF, zip, rar, ppt, and BMP, etc will not be accepted.

You are required to send question no. 1 as a screenshot displaying the compilation and running of both required programs. Furthermore C code of question no. 1 for both Programs should also be pasted in the same word file after the screenshot. Question No. 2 answer should also be pasted in the same word file

 

OBJECTIVE

The objective of this assignment is to provide hands-on experience of:

  • To learn and understand inter-process communication using FIFOs.
  • SRTF scheduling algorithm

 

Note: Lectures No. 8 to 15 are covered in this assignment.

 

NOTE

 

No assignment will be accepted after the due date via email in any case (whether it is the case of load shedding or internet malfunctioning etc.). Hence refrain from uploading assignments in the last hour of the deadline. It is recommended to upload the solution file at least two days before its closing date.

 

If you find any mistake or confusion in the assignment (Question statement), please consult with your instructor before the deadline. After the deadline, no queries will be entertained in this regard.

 

For any query, feel free to email at:

Cs604@vu.edu.pk

 

 

 

 

 

Question No. 1                                                                                                                         15 Marks      

Write the two C programs named program1 and program2 that perform inter-process communication through FIFO. The functionality of the two programs should be as follows.

  • program1 should create a FIFO as fifo_one by using mknod() system call or through mkfifo() library call. program1 should open the fifo_one for reading purposes through open() system call. Then use the read() system call to read from fifo_one, your name, and VUID that is written by program2 in fifo_one. After reading your name and VUID, program1 should display it on the screen by write() system call.
  • program2 should open the fifo_one for writing purposes through open() system call. Then use the write() system call to write in fifo_one your name and VUID. And finally, close and remove the fifo_one.

Use only read() and write() system call for reading and writing your name and VUID from FIFO and finally writing on the terminal screen. As by default in FIFO both read() and write() system call do the blocking I/O.

As the two programs can’t be run simultaneously in the foreground on the terminal window. So you need to run program1 in the background and subsequently program2 should be run in the foreground.

Following is the sample screenshot of both programs. You need to perform the following steps in the screenshot.

  • In the screenshot firstly you should compile both C programs.
  • Run the program1 in the background. finally,
  • run the program2.

C code of question no. 1 for both programs should also be pasted in the same word file after the screenshot.  Question No. 2 answer should also be pasted in the same word file.

Question No. 2                                                                                                                         05 Marks      

Consider the following three processes, with the Arrival time and CPU burst time, is given in milliseconds:

 

Process

Arrival Time

 Burst Time

P1

0.0

3

P2

1.0

8

P3

3.0

6

 

  1. Draw a Gantt chart showing the execution of three processes using the Shortest Remaining Time First (SRTF) scheduling.
  2. Find the turnaround time of each process for the SRTF Shortest Remaining Time First scheduling algorithm as per the Gantt chart.
  3. Calculate the waiting time for the three processes for the SRTF Shortest Remaining Time First scheduling algorithm as per the Gantt chart?

 

Note: in case you have installed the Virtual Box you can take the screenshot as follows. Go to the view menu and click on Take Screenshot as follow.

 

See the following link for writing and compiling your first program in Linux.

https://vulms.vu.edu.pk/Courses/CS604/Downloads/how%20to%20Write%20...

See the following link for downloading and installing VirtualBox and Ubuntu.

https://vulms.vu.edu.pk/Courses/CS604/Downloads/tutorial_for_instal...

https://vulms.vu.edu.pk/Courses/CS604/Downloads/Guide%20to%20How%20...

See also the following tutorial links at VULMS for downloading and installing VirtualBox.

https://vulms.vu.edu.pk/Courses/CS604/Downloads/CS604-VirtualBox.mp4

Also see the following tutorial at VULMS, and follow the instructions for Installing Ubuntu in VirtualBox

https://vulms.vu.edu.pk/Courses/CS604/Downloads/CS604-Virtual%20Mac...

 

You can work in Linux through chrome web Store, or click at the following link and press the start button Ubuntu will be started.

https://www.onworks.net/runos/create-os.html?os=ubuntu-16.04.6-desk...

 

The End

Spring%202021_CS604_2.docx

Views: 849

Replies to This Discussion

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

CS604 Assignment#02 Solution 

CS604-Assignment-02-Solution-Spring-2021.docx

CS604 Assignment no2 solution | Cs604 assignment Solution | cs604 latest Assignment no2 Solution

CS604 Assignment 2 Solution Spring 2021 || Operating System || 100% Correct Solution

RSS

Looking For Something? Search Below

Latest Activity

Shaaz WahCantt replied to Mr Siren Head's discussion Ning Chats
10 hours ago
Mr Siren Head replied to Mr Siren Head's discussion Ning Chats
11 hours ago
M. Haris left a comment for Sana rajput
15 hours ago
M. Haris left a comment for Sana rajput
15 hours ago
M. Haris liked Sana rajput's profile
15 hours ago
M. Haris liked MUSFIRA's profile
15 hours ago
M. Haris liked MUSFIRA's profile
15 hours ago
MUSFIRA replied to Mr Siren Head's discussion Ning Chats
15 hours ago

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service