Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS604 Operating System Assignment No. 2 Semester Fall 2012
#1


CS604 Operating System Assignment No. 2 Semester Fall 2012


Assignment No. 02
SEMESTER Fall 2012
CS604- Operating System
Total Marks: 20
Due Date:
Monday 19th
November 2012
Instructions
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
o The assignment is submitted after due date.
o The submitted assignment does not open or file corrupt.
o The assignment is copied.
o There is not mentioned the student Id in the assignment File or
name of file is other than student ID.
GOOD LUCK
Marks: 20
Question : [Marks 20]
Use C language to write a program. In that program main process creates a child process by using fork( ). Child
process should perform the following tasks.
1) Take VU student id from user and then display the VU student id
2) Child process should display its PID(process ID)
3) Child process should display its parent's PID
4) Child process should display value of its childpid variable (childpid is used to store the value returned by
fork( ))
5) Child process should take any value from 0 to 255 from user. After that child process exits and returns
that value to the parent process.
Parent process should perform the following tasks
1) Parent process should display its PID(process ID)
2) Parent process should display value of copy of its childpid variable (childpid is used to store the value
returned by fork( ))
3) When child process terminates then parent process receives a value from 0 to 255 from child process and
then parent process displays it.
Sample out put is given below.
SAMPLE OUTPUT
PARENT: I am the parent process!
PARENT: Here's my PID: 2861
PARENT: The value of my copy of childpid is 2862
PARENT: I will now wait for my child to exit.
CHILD: Enter your student id: bc12356487
CHILD: Student id is: bc12356487
CHILD: I am the child process!
CHILD: Here's my PID: 2862
CHILD: My parent's PID is: 2861
CHILD: The value of my copy of childpid is: 0
CHILD: Sleeping for 1 second...
CHILD: Enter any value from 0 to 255: 35
CHILD: Goodbye!
PARENT: Value returned by child code is: 35
PARENT: Goodbye!
Execute your program in Linux Ubuntu. Take screen shots of your program that you write in C, Commands that
you used to run your program in Linux Ubuntu and the out put displayed by your program. After taking screen
shots, send these screen shots to me properly in your assignment.
Note:
1) Do not write your program in other languages like Java, C++ etc. Write your program only in C language.
2) Do not execute your program in other operating systems like Windows, Mac etc. Execute your program only
in Linux Ubuntu flavor.
3) You should provide three screen shots. Required three screen shots that you should provide are given below.
i) Screen shots of your compete program that you write in C. Your screen shots should display your complete
program code that you write in C.
ii) Screen shot of Commands that you used to run your program in Linux Ubuntu.
iii) Screen shot of final output of your program shown.
4) If you will copy your assignment then you will get zero marks with no leniency.
5) Each student should display his own complete VU student ID and not the VU student ID of any other student.
6) In your program’s output, each student should indicate the execution of parent and child processes codes by
using the words PARENT: and CHILD: in the output display as shown in the sample output.
Uploading Instructions:
Paste your screen shots in word file and then Upload your assignment as a word file. It should have name
[YourRollNo.doc]
Deadline
Your assignment must be uploaded/submitted at or before Monday 19th November 2012


Attached Files
.pdf   cs604.pdf (Size: 80.98 KB / Downloads: 135)

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  CS301 Assignment # 4 Due Date: 02-Feb-2016 Vuhelper 0 2,319 02-03-2016, 05:38 PM
Last Post: Vuhelper
  CS703 – Advanced Operating Systems Assignment No.3 solution January 2016 Vuhelper 0 5,904 01-23-2016, 09:58 PM
Last Post: Vuhelper
  CS601 Data Communication Assignment No. 03 Solution 23rd January 2016 Vuhelper 1 1,924 01-23-2016, 06:09 PM
Last Post: Vuhelper
  CS403 Assignment No. 03 Solution 23rd January 2016 Vuhelper 2 1,159 01-23-2016, 03:18 PM
Last Post: Vuhelper
  CS506 Web Design and Development Assignment no 3 Solution 3rd January 2016 Vuhelper 0 2,237 01-23-2016, 03:16 PM
Last Post: Vuhelper
  CS724 Software Process Improvement Assignment No 01 Solution 20th January 2016 Vuhelper 0 1,962 01-20-2016, 06:26 PM
Last Post: Vuhelper
  CS711 Software Design Assignment No 01 Solution Due Date Feb 12, 2016 Vuhelper 0 1,658 01-20-2016, 06:24 PM
Last Post: Vuhelper
  CS709 Formal Methods for Software Engineering Assignment No 01 Solution January 2016 Vuhelper 0 1,792 01-20-2016, 06:22 PM
Last Post: Vuhelper
  cs703 assignment no 3 Solution 20th January 2016 Vuhelper 0 1,695 01-20-2016, 06:20 PM
Last Post: Vuhelper
  CS704 Assignment No. 01 Solution January 2016 Vuhelper 0 4,793 01-20-2016, 06:19 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)