Vous êtes sur la page 1sur 5

SOUTH EASTERN UNIVERSITY OF SRI LANKA

FOURTH EXAMINATION IN APPLIED SCIENCES – 2005/2006 SPECIAL DEGREE IN COMPUTER SCIENCE

SEMESTER – I, SEPTEMBER/ OCTOBER 2007

CSS 303 – OPERATING SYSTEMS THEORY AND SYSTEM PROGRAMMING

Answer All Questions

Time Allowed: TWO (2) Hours

No. of Questions: 04 No. of Pages: 05

Important Instructions to the Candidates

* If a page or a part of this question paper is not printed, please inform the Supervisor immediately.

* Enter your Index Number on all pages of the answer script.

* At the end of the examination, attach all answer sheets together.

1

Q1

 

(a)

Write short notes on following features of operating systems, giving one practical example each of an operating system having the feature. (i). 16 bit and 32 bit operating systems (ii). Real time property (iii). Virtual machine concept (iv). Multi tasking property

(b)

Draw the 3-state, process state transition diagram for a multi-tasking kernel. Clearly show process transitions.

(c)

Explain what is meant by the user context; the register context and the system context of a process.

Q2

 

(a)

A certain computer system has a CPU with a 32 bit address and a 24 bit word length. It has a 4 GB hard disk and 1 GB of main memory.

 

(i). What is the size of one virtual memory of the machine? (ii). In a page table entry of virtual memory (VM) to physical memory (PM) address, mapping, what is the ratio of number of bits of VM address that maps to the number of bits of PM address, if the page size is 1 MB.

 

(b)

(i). What is meant by demand paging? (ii). What policies can be used to replace an existing page in page table for a new incoming page?

(c)

(i). What is meant by a “page fault”? (ii). What actions are performed by the operating system process manager when a page fault occurs?

2

Q3

 

(a)

In DOS based operating systems, the file system uses a 16-bit or a 32-bit FAT. Suppose the hard disk is 1 GB, and an 8 MB file is to be stored. How many file blocks are required to store the file on a 16-bit FAT and on a 32-bit FAT?

(b)

(i). Explain how the UNIX I-Node file system identifies file blocks for given file. (ii). What advantages do I-Node system has over FAT?

(c)

Briefly explain the function of each of the UNIX commands:

 

(i)

ls

(ii)

ps

(iii)

pwd

(iv)

cd /home

 

(d)

Write short notes on the following:

 

(i).

hierarchical file system of UNIX

(ii).

distributed file system for UNIX

(iii).

’User’, ‘group’ and ‘other’ based three level file permission approach.

Q4

 

(a)

A source file named myfile.c uses a function named calc() which is implemented in a source file named calculate.c. Descibe the changes that occur when the files myfile.c and calculate.c are first individually compiled, and then linked.

3

(b)

(c)

Describe the outcome of the following source code fragment:

main() { int i, pid; for (i =1; i<2; i++) { pid = fork();

}

printf("Done\n");

exit(0);

}

Describe the operation of the following source code:

#include <stdio.h> #include <signal.h>

main() { int i; signal(SIGINT,myfunc);

for ( ; ; );

}

void myfunc(int s)

{

signal(SIGINT,myfunc); printf("Sorry. This interrupt is disabled.\n");

}

4

(d) Outline the outcomes of following statements:

(i).

signal(SIGQUIT, SIG_IGN);

(ii).

execl( "/bin/ls", "ls", "-l" , 0);

(iii).

fd1= creat("tempfile",0644);

(iv).

nread = read(fd,bufptr,4);

(v).

nwrote = write(fd2, bufptr,4);