How To Exam?

a knowledge trading engine...


M.Sc-M.Sc Computer Science 2nd Sem CS - 202 : Unix Internals(University of Pune, Pune-2013)

Friday, 28 November 2014 12:35Nitha

                                  M.Sc. (Semester - II)


SEAT No. :

[Total No. of Pages : 4


COMPUTER SCIENCE

CS - 202 : Unix Internals

(2008 Pattern)

Time :3 Hours]                                                                                                 [Max. Marks :80

Instructions to the candidates:

Neat diagram must be drawn wherever necessary. Figures to the right indicate full marks. All questions carry equal marks.

Assume suitable data, if necessary. All questions are compulsory.


Q1) Attempt all of the following:                                                              [8 × 2 = 16]

List any four fields of uarea.

When the kernel releases an inode, what happens if reference count drops

to zero?

Give the syntax of mount system call. When does unmount call fail?

List the steps for a context switch.

Write any four functions of clock interrupt handler?

What is a protection fault? When does a process incur a protection fault?

What do you mean by Clists?

What is the significance of following, kill (pid,signum);

where i) pid is -l ii) pid is 0

P.T.O.

Q2) State whether the following statements are true or false. Justify your answer

(any four):                                                                                                    [4 × 4 = 16]

 

The kernel can lock and unlock an allocated inode independent of the value of the reference count.

No process can preempt another process executing in the kernel.

The contents of inode will change only when file contents are modified.

In the link system call, the kernel must release the source file's inode after incrementing its link count.

The kernel invokes growreg algorithm to increase the size of shared region that is already attached to several processes.


Q3) Attempt any four of the following :                                                            [4 × 4 = 16]

a)       Why does kernel lock the file during the system call read? What would

happen if it does not lock it?

b)       Which are the actions taken by kernel for releasing a buffer?

c)       What happens if a process executing wait ( ) has :

i)        no zombie child ii)             one zombie child

iii)      child processes but none are zombie.

d)       In sleep algorithm, why does kernel raises processor execution level to block

all interrupts? How it handles cases of interruptible and not interruptible sleep?

e)       Discuss swap in function of swapper process.

Q4) Attempt any four of the folloiwng:                                                             [4 × 4 = 16]

a)       Write a program to accept a file name from user using command line argument

and create a file write the string UNIX at every 800th byte 10 times. Close the file Reopen the file in readmode and print the string stored at every 800th byte. Use lseek system call.

[4339]- 22                                                     2

 

Write and explain program in C, that checks the access time of a file every

minute and prints a message if the file had been accessed.

Explain the behaviour of following program.

# include <stdio.h>

main ( )

{

int p[2], j, pid; char msg [20];

pipe (p);

pid = getpid ( );

fork ( ) ; fork ( ) ;

if (pid = = getpid ( ) )

{

for, (j = 0, j<3 ; j ++)

wait ((int*)0);

for (j = 0; j<3 ; j++)

{

read (p[0], msg, 12); printf("%s\n", msg);

}}

else

write (p[1], "hello world", 12);

}

Write a program which is ready to catch a signal generated by pressing

cntr1 + c. The program should display message "you have pressed cntr1+c". The process should catch the cntr1+c signal five times, display same message and should not terminate. The process will terminate when it catches the cntr1+c signal 6th time.

[4339]- 22                                                     3

e) Explain the behaviour of following program.

# include < fcntl. h>

main ( )

{

int i, j;

char but 1 [512], but 2[512] ;

i = open("/etc/ passwd",O_RDONLY);

j = dup (i);

read (i,but 1, sizeof (but 1 )); read (j, but2, sizeof (but 2));

close (i);

read(j, but2, sizeof (but 2));

}

Q5) Attempt any four of the following:                                                  [ 4 × 4 = 16]

 


Give and explain logical format of an executable file.

Write a short note on page stealer process.

List the sequence of operations taken by kernel for handling the interrupt.

What do you mean by interrupt vector?

Explain the race condition arised in unlink system call.

What are the components of register level context?

+++++++



( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER M.Sc-M.Sc Computer Science 2nd Sem CS - 202 : Unix Internals(University of Pune, Pune-2013)