0% found this document useful (0 votes)
9 views

Spring 2023 - CS604 - 1

CS604

Uploaded by

Rahmeen Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Spring 2023 - CS604 - 1

CS604

Uploaded by

Rahmeen Shahbaz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Operating System (CS604) Total marks = 20

Assignment # 01 Deadline Date

Spring 2023 23/05/2023

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 the screenshot and C code of Question no. 1 in the same word file.
Furthermore, Linux commands of Question no. 2 should also be pasted in the same Word file.
Assignment No. 1 covers 1-13 Lectures.

OBJECTIVE
The objective of this assignment is to provide hands-on experience in the:
 Inter-Process Communication through pipe System call
 Linux File/Directory management commands.
 System calls and their usage in Linux

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.

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

For any query, feel free to email me at:


Cs604@vu.edu.pk
Questions No 01 15 marks

You are required to create the C program for Inter-process Communication between the
parent and child process. Following are the functionalities to be carried out by your C
program.

 Firstly, parent process creates the pipe through pipe() system call and then creates the
child process through fork() system call.
 In the child code it gets its own process id through getpid() system call and then write
it to pipe through write() system call.
 In the parent code:
a) The parent process read the process Id of child through read() system call and
then parent process prints the process id of child.
b) Finally, parent process gets and prints its own process id through getpid()
system call and printf() function.

The following should be the flow of your program.


 Firstly, compile your C program through command line.
 Run your program.

You are required to send the screenshot along with C Code.


Following is the sample screenshot:
Questions No 02 5 marks

In the following table write the Linux command for the given details.
Detail. Linux Command
Command to list the contents of current
working directory.
Command to change the current working
directory.
Command used to search for a pattern in a
file or files.
Command is used to display the contents of
a file. It can also be used to display the
entire contents of a file or a portion of the
contents, depending on the options used.
Command is used to remove a file or
directory.
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 the installation of Virtual Box and Ubuntu (Linux) on your system.
https://vulms.vu.edu.pk/CourseResources/OpenFile.aspx?
File=tutorial_for_installing_virtualbox_and_ubuntu.mp4

See the following link installing gcc and compiling and runnings your first program in Linux.
https://vulms.vu.edu.pk/CourseResources/OpenFile.aspx?File=How%20to%20install%20gcc
%20on%20Ubuntu%20and%20compile%20a%20C%20program.mp4

The EnD

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy