You are on page 1of 5

ANNA UNIVERSITY: CHENNAI 600025 M.C.A.

. DEGREE EXAMINATIONS MAY/JUNE - 2012 Second Semester MC9228 System Software Laboratory ( REGULATIONS 2009 )

Time: 3 Hrs. 1. Write a C program for the design of a Two-Pass Assembler.

Maximum Marks: 100 100

2.

Write a C program to implement Pass1 and Pass2 of a Linking Loader.

100

3.

a. b.

Write a C program to illustrate the handling of different Signals. Write a shell script to determine whether given file exist or not, file name is supplied as command line argument, also check for sufficient number of command line argument.

60 40

4.

a.

Write a C program to illustrate the implementation of Client server using Message Queues.

60

b.

Write a shell script to print given number in reverse order, for eg. If no is 123 it must print as 321.

40

5.

Write a C program to design a Linker for SIC/XE architecture.

100

6.

a.

Write a C program to share a file between parent and child process using System Calls.

60

b.

Write a Shell script to print a particular line which has been repeated more than thrice in a file.

40

7.

Write a C program to design an One pass Load and Go Assembler.

100

8.

Write a C program to illustrate the implementation of Named and Unnamed 100 Pipes.

9.

a.

Write a Shell script to replace every second word of the sentence by the fourth word for the text contained in a given file.

60

b.

Use Command Line arguments for specifying the source and destination files to copy the content. Create an executable copy.out of that copy.c. Use exec system call to load the childs address space with copy.out and execute it. The parent then prints job over when the child exits and then the parent also exits.

40

10. Write a C program to illustrate the creation and usage of a shared memory 100 segment by two processes.

11. a.

Write a C program to utilize Message Queue to sort n numbers using 60 Merge Sort.

b.

Write a Shell script to determine whether the given string is palindrome 40 or not.

12. Write a C program to implement a Sample Text Editor application.

100

13. a.

Write a C program to display the process id, parent-process id and the 60 group-id of the running processes.

b.

Write a Shell script to perform Quick sort for a given set of numbers. 40

14. Write a Shell Script to do the following: a. Accept a file name as input and Count the number of characters, words and lines in it and display each in a separate line with appropriate message. (e.g) the number of characters in the file . is .. the number of words in the file . is .. the number of lines in the file . is .. Modify the above script to accept more than one command line argument and repeat the above for every file given on its command line as an argument c. Accept a word as input and count and print the number of lines that has the given word. d. Count and print the number of occurrences of the given word (note that a line may have more than one occurrence of the given word). 30 20 30

b.

20

15. a.

Write a C program in which both the parent and child writes a line in a file alternatively for ten times. After the child terminates, the parent should write the line Child process terminated to the file.

70

b.

Write a Shell script to delete a given file from the present directory and its sub directories

30

16. a.

Write a shell Script to find the biggest among a set of n numbers. Numbers are supplied as command line argument. Print error if sufficient arguments are not supplied.

50

b.

Write a C program to show the implementation of the following system 50 calls: i) Creation, Opening and closing of files. ii) Moving the contents of one file to another file Write a C program to handle SIGINT and stop the user from quitting 60 through the commands Ctrl + C.

17. a.

b.

Write a C program to establish communication between child and parent 40 processes using Kill() and Signal().

18. a.

Write a C program to catch the SIGALARM signal.

50

b.

Write a C program to establish a two-way communication using Pipes.

50

19. a.

Write a C program to pass five consecutive messages in a prior order 60 from client to server using Message Queue implementation.

b.

Create a text file which consists of three fields such as Serial No., Name 40 and Age. Using Shell script implement the following operations on the text file. i) Translation ii) Removal of duplicate elements iii) Extraction of Similar Patterns and redirecting it to a new file.

20. a.

Write a C program for Producer-Consumer problem using FIFO 60 implementation.

b.

Write a C program to implement the ls command to display the contents 40 of the directory.(Dont make use of the ls shell command directly).

You might also like