Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS604 Operating Systems Assignment No.2 Solution Spring Semester 2013
#1


CS604 Operating Systems Assignment No.2 Solution Spring Semester 2013


Question: [Marks 20]
Write a simple C language program. Program has following main tasks to be performed.
Parent process creates child process using fork ().
Perform an IPC between related processes using pipe ().
Now specifically child process will do following.(1 mark on each step)
1. Child process should display its PID (process ID)
2. Child process should display its parent’s PID
3. Child process should take a string as input from user which would be its VU id.
4. Child should write this test string (VU student ID) using write () system call in IPC pipe.

5. Child process should take any value from 0 to 255 from user. After that child process exits and returns to the parent process.
Now specifically parent will perform following tasks .(1 mark on each step)
1. Parent process should display its PID (process ID).
2. Child process value returned to its parent by fork () and show return value.
3. Parent process wait for child process to complete its tasks
4. Parent process should read the message (VU student ID) written by child process and display it on screen.
5. Parent process should print length of string entered by student.
Sample output is given below. .(1 mark on each main step)
SAMPLE OUTPUT
CHILD: I am the child process!
CHILD: Here’s my PID: 5667
CHILD: My parent’s PID is: 5666
CHILD: Enter your student id: bc12345678
CHILD: Student id is: bc12345678
CHILD: I am writing VU student to pipe…
CHILD: Enter any value from 0 to 255: 104
CHILD: Goodbye!
PARENT: I am the parent process!
PARENT: Here’s my PID: 5666
PARENT: Value returned by child code is: 104
PARENT: I am reading VU student id from pipe bc12345678
PARENT: Length of VU student ID is: 10
PARENT: Good work child!
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 output displayed by your program.
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 have to provide are given below.
I) Screen shots of your complete 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.
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.

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
  ACC501 Business Finance Assignment No.1 Fall Semester 28th November 2012 Vuhelper 1 1,976 03-28-2020, 02:07 AM
Last Post: ArleneKline
  CS615-Software Project Management Assignment no 4 -5th Feb 2016 Vuhelper 0 1,675 02-05-2016, 10:11 PM
Last Post: Vuhelper
  Eng301 Business Communication Assignment No 3 due date 11 FEB,2016 Vuhelper 0 1,577 02-05-2016, 09:49 PM
Last Post: Vuhelper
  MGT111 Assignment No.2 Assignment Solution Due date 3rd Feb 2016 Vuhelper 0 1,835 02-03-2016, 05:37 PM
Last Post: Vuhelper
  FIN630 - Investment Analysis & Portfolio Management Solution 3rd Feb 2016 Vuhelper 0 2,251 02-03-2016, 05:34 PM
Last Post: Vuhelper
  MGT101 Financial Accounting Assignment no 2 solution 20th January 2016 Vuhelper 1 3,464 01-23-2016, 05:14 PM
Last Post: Vuhelper
  MCM101 Introduction to Mass Communication Assignment #3 January 2016 Vuhelper 1 1,951 01-23-2016, 05:13 PM
Last Post: Vuhelper
  mcm311 Reporting and subediting Assignment no 3 January 2016 Vuhelper 0 7,441 01-23-2016, 05:09 PM
Last Post: Vuhelper
  MGT602 assignment no 2 Solution due date 25th January 2016 Vuhelper 0 1,655 01-23-2016, 03:53 PM
Last Post: Vuhelper
  MGT602 Assignment no 2 Solution 20th January 2016 Vuhelper 0 7,545 01-20-2016, 06:53 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)