CS604 Assignment No 1 Fall 2017
Dear Students, CS604 - Operating Systems Assignment Solution has been added. Here you can read or Download CS604 Assignment No 1 Solution and Discussion of Semester Fall 2017. Assignment Due Date is 13 November, 2017. Total Marks are 20. We are here to facilitate your learning and we do not appreciate the idea of copying or replicating solutions. Previously we shared CS604 Assignment No 1 Spring 2017.CS604 Assignment No 1 Solution Fall 2017 |
CS604 Assignment Instructions:
Please read the following instructions carefully before submitting assignment:- You should submit your assignment before or on due date on VULMS.
- Your assignment should be your own work in your own words. It should not be copied from Internet, handouts or books.
- Assignment sent via Email will not be replied and accepted.
- If the submitted assignment does not open or file is corrupt, it will not be marked and hence awarded zero marks.
CS604 Assignment Objectives:
- To know about how to create processes and terminate processes in Linux.
- To learn how to use inter process communication tools.
- To learn how to write, compile and execute basic program in C using gcc.
CS604 Assignment Question
Problem Statement: [Marks 20 ]You are required to write a simple C language program to:
- Create a process using fork call
- Get and print status information of the running processes
- Use pipe call for inter-process communication between processes
- Terminate process
- Compile & run C program on Linux Operating system.
In the main() function, first of all you will establish a channel for processes to communicate through pipe system call. After successful creation of pipe, you will create child process through fork() system call.
In the child process, you will have to display your own student Id through the pipe or channel established between processes. In the parent process, you will have to display your own student name through the pipe or channel established between processes.
You will also print the status information of Parent and Child process by using user-defined function printInfo(). The status information includes Process Id and Parent Id in case of Child process and Process ID and Child Id in case of Parent process.
Compilation & Execution of Program:
You will compile your file with your student ID. For example, if your student ID is BC123456789 then you will compile the code according to following screenshot.
Please Note: File name other than your Student ID will not get marks.
You will write code and paste following two screenshots in word file.
1) You will take screenshot of compiling command that you will issue.
2) Then you will run your executable and take its screenshot.
Sample Output for program
CS604 Assignment No 1 Sample output of Program |
Tools to Solve CS604 Assignment
To solve the assignment you have to install Linux on your system. To install the Linux first you have to install virtual Box in your system.
Follow the tutorial to download Virtual Box form the following link:
https://vulms.vu.edu.pk/Courses/CS604/Downloads/CS604-VirtualBox.mp4
Then download Ubuntu Linux from the following link
http://de.releases.ubuntu.com/16.10/ubuntu-16.10-desktop-i386.iso
Then follow these tutorials to install Ubuntu Linux in Virtual Box
1 - https://vulms.vu.edu.pk/Courses/CS604/Downloads/CS604-Virtual%20Machine.mp4
2 - https://www.lifewire.com/run-ubuntu-within-windows-virtualbox-2202098
Please Note: You have to send only Word file which contains C code and screenshots of output. File other than Word file will not be accepted.
CS604 Assignment No 1 Solution Fall 2017
You can read and Download Assignment Solution idea below:CS604 Assignment Solution Idea
#include <stdio.h>
#include <sys/types.h>
int main()
{
int virtualstudysolutions[2];
pid_t pid;
pipe(virtualstudysolutions);// creating pipe
pid=fork(); // child process
if(pid==0){
printf("Student ID: VirtualStudySolutions123\n");
printinfo("child Process");
printf("Student Name: Virtual Study Solutions\n");close(virtualstudysolutions[0]); // Termenating the child process.
}
else {
printinfo("Parent Process");
}
}
void printinfo(char pname[])
{
printf("Process name: %s\n",pname);
printf("My process ID : %d\n", getpid());
printf("My parent's ID: %d\n", getppid());
}
CS604 Assignment Solution Download Link
Assignment Solution File Link will be updated Soon. if You want to Receive Assignment Solution in your Mail box as soon as we update it. Please Subscribe us below.
Download [ Please Wait - Link Not Updated Yet ]
We Hope it was helpful. Please Share it with your friends. You can also like our Facebook Page or Subscribe Us below for Updates. Thank You.
Download [ Please Wait - Link Not Updated Yet ]
We Hope it was helpful. Please Share it with your friends. You can also like our Facebook Page or Subscribe Us below for Updates. Thank You.
Post a Comment