0% found this document useful (0 votes)
37 views25 pages

TYBSc Computer Science Practical Exam Slip

Uploaded by

omdeore640
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views25 pages

TYBSc Computer Science Practical Exam Slip

Uploaded by

omdeore640
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Savitribai Phule Pune University

T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb


(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a program that demonstrates the use of nice() system call. After a
child process is started using fork(), assign higher priority to the child
using nice() system call.
( 15 Marks )
2. Write the program to simulate None-preemptive Shortest Job
First(SJF)-scheduling. The arrival time and first CPU-burst for different n
number of processes should be input to the algorithm. Assume the fixed
IO waiting time(2 units). The next CPU-burst should be generated
randomly. The output should giv Gantt chart, turnaround time and waiting
time for each process. Also find the average waiting time and turnaround
time.
( 15 Marks )

3..Viva ( 5 Marks )

1
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘count’ as
a. myshell$ count c filename: It will display the number of characters in
given file
b. myshell$ count w filename: It will display the number of words in
given
file
c. myshell$ count l filename: It will display the number of lines in given
file

( 15 Marks )

2. Write the simulation program to implement demand paging and show the
page scheduling and total number of page faults for the following given
page reference string. Give input n as the number of memory frames.

Reference String : 12,15,12,18,6,8,11,12,19,12,6,8,12,15,19,8


1) Implement LRU
( 15 Marks )

2
3..Viva

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘count’ as
a. myshell$ typeline n filename: It will display first n lines of the file.
b. myshell$ typeline -n filename: It will display last n lines of the file.
c. myshell$ typeline a filename: It will display all the lines of the file
( 15 Marks )
2. Write the program to simulate Round Robin (RR) scheduling. The arrival
time and first CPU-burst for different n number of processes should be
input to the algorithm. Also give the time quantum as input. Assume the
fixed IO waiting time (2 units). The next CPU-burst should be generated
randomly. The output should give Gantt chart, turnaround time and
waiting time for each process. Also find the average waiting time and
turnaround time.
( 15 Marks )

3..Viva

3
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Implement the C program to accept n integers to be sorted. Main function


creates child process using fork system call. Parent process sorts the
integers using bubble sort and waits for child process using wait system
call. Child process sorts the integers using insertion sort.
(Marks 15)
2. Write the program to simulate FCFS CPU-scheduling. The arrival time
and first CPU- burst for different n number of processes should be input
to the algorithm. Assume that the fixed IO waiting time (2 units). The
next CPU-burst should be generated randomly. The output should give
Gantt chart, turnaround time and waiting time for each process. Also find
the average waiting time and turnaround time.

(Marks 15)

3. Viva
(Marks 5)

4
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘list’ as
a. myshell$ list f dirname: It will display filenames in a given directory.
b. myshell$ list n dirname: It will count the number of entries in a given
directory.
c. myshell$ list i dirname: It will display filenames and their inode number
for the files in a given directory.
(Marks 15)
2. Write the program to simulate Preemptive Shortest Job First (SJF)
-scheduling. The arrival time and first CPU-burst for different n number
of processes should be input to the algorithm. Assume the fixed IO
waiting time (2 units). The next CPU-burst should be generated
randomly. The output should give Gantt chart, turnaround time and
waiting time for each process. Also find the average waiting time and
turnaround time.
(Marks 15)
3. Viva
(Marks 5)

5
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the


command prompt ‘myshell$’. It accepts the command, tokenize the
command line and execute it by creating the child process. Also
implement the additional command ‘list’ as
a. myshell$ list f dirname: It will display filenames in a given directory.
b. myshell$ list n dirname: It will count the number of entries in a given
directory.
c . myshell$ list i dirname: It will display filenames and their inode
number

for the files in a given directory.

(Marks 15)
2. Write the simulation program to implement demand paging and show
the page scheduling and total number of page faults for the following
given page reference string. Give input n as the number of memory
frames.

Reference String : 12,15,12,18,6,8,11,12,19,12,6,8,12,15,19,8

1) Implement FIFO
(Marks 15)

6
3. Viva
(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Implement the C program to accept n integers to be sorted. Main


function creates child process using fork system call. Parent process
sorts the integers using bubble sort and waits for child process using
wait system call. Child process sorts the integers using insertion sort
(Marks 15)
2. Write the simulation program to implement demand paging and show
the page scheduling and total number of page faults for the following
given page reference string. Give input n as the number of memory
frames.

Reference String : 12,15,12,18,6,8,11,12,19,12,6,8,12,15,19,8

1) Implement LFU
(Marks 15)
3. Viva
(Marks 5)

7
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Implement the C program to accept n integers to be sorted. Main


function creates child process using fork system call. Parent process
sorts the integers using bubble sort and waits for child process using
wait system call. Child process sorts the integers using insertion sort
(Marks 15)
2. Write the simulation program to implement demand paging and show
the page scheduling and total number of page faults for the following
given page reference string. Give input n as the number of memory
frames.

Reference String : 12,15,12,18,6,8,11,12,19,12,6,8,12,15,19,8

1) Implement OPT
(Marks 15)
3. Viva
(Marks 5)

8
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write the simulation program to implement demand paging and show


the page scheduling and total number of page faults for the following
given page reference string. Give input n as the number of memory
frames.
Reference String: 2,5,2,8,5,4,1,2,3,2,6,1,2,5,9,8

1) Implement MFU
(Marks 15)
2. Write the program to simulate Preemptive Priority scheduling. The
arrival time and first CPU-burst and priority for different n number of
processes should be input to the algorithm. Assume the fixed IO
waiting time (2 units). The next CPU-burst should be generated
randomly. The output should give Gantt chart, turnaround time and
waiting time for each process. Also find the average waiting time and
turnaround time
(Marks 15)
3. Viva
(Marks 5)

9
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the


command prompt ‘myshell$’. It accepts the command, tokenize the
command line and execute it by creating the child process. Also
implement the additional command ‘list’ as
a. myshell$ list f dirname: It will display filenames in a given
directory.
b. myshell$ list n dirname: It will count the number of entries in a
given directory.
c. myshell$ list i dirname: It will display filenames and their inode
number for the files in a given directory.
(Marks 15)
2. Write the program to simulate Preemptive Priority scheduling. The
arrival time and first CPU-burst and priority for different n number of
processes should be input to the algorithm. Assume the fixed IO
waiting time (2 units). The next CPU-burst should be generated
randomly. The output should give Gantt chart, turnaround time and
waiting time for each process. Also find the average waiting time and
turnaround time
(Marks 15)
10
3. Viva
(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write the program to simulate Round Robin (RR) scheduling. The arrival
time and first CPU-burst for different n number of processes should be
input to the algorithm. Also give the time quantum as input. Assume the
fixed IO waiting time (2 units). The next CPU-burst should be generated
randomly. The output should give Gantt chart, turnaround time and
waiting time for each process. Also find the average waiting time and
turnaround time.
(Marks 15)
2. Write the simulation program to implement demand paging and show the
page scheduling and total number of page faults for the following given
page reference string. Give input n as the number of memory frames.
Reference String: 2,5,2,8,5,4,1,2,3,2,6,1,2,5,9,8
1) Implement FIFO
(Marks 15)
3. Viva
(Marks 5)

11
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program to illustrate the concept of orphan process. Parent


process creates a child and terminates before child has finished its task.
So child process becomes orphan process. (Use fork(), sleep(), getpid(),
getppid()).
(Marks 15)
2. Write the simulation program to implement demand paging and show the
page scheduling and total number of page faults for the following given
page reference string. Give input n as the number of memory frames.
Reference String: 2,5,2,8,5,4,1,2,3,2,6,1,2,5,9,8
1) Implement LRU
(Marks 15)
3. Viva
(Marks 5)

12
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘search’ as
a. myshell$ search f filename pattern : It will search the first occurrence
of pattern in the given file
b. myshell$ search a filename pattern : It will search all the occurrence of
pattern in the given file
c. myshell$ search c filename pattern : It will count the number of
occurrence of pattern in the given file
(Marks 15)
2. Write the program to simulate Preemptive Priority scheduling. The arrival
time and first CPU-burst and priority for different n number of processes
should be input to the algorithm. Assume the fixed IO waiting time (2
units). The next CPU-burst should be generated randomly. The output
should give Gantt chart, turnaround time and waiting time for each
process. Also find the average waiting time and turnaround time

13
(Marks 15)

3.Viva

(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Implement the C Program to create a child process using fork(), Using


exec() system call, child process will execute the program specified in Set
A(1) and parent will continue by printing message “I am parent “.
(Marks 15)
2. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘Prime’ as
myshell$ Prime n : It will give the prime number of given number
(Marks 15)

3.Viva

(Marks 5)

14
Savitribai Phule Pune University
T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘count’ as
a. myshell$ count c filename: It will display the number of characters in
given file
b. myshell$ count w filename: It will display the number of words in
given file
c. myshell$ count l filename: It will display the number of lines in given
file
(Marks 15)
2. Write the simulation program to implement demand paging and show the
page scheduling and total number of page faults for the following given
page reference string. Give input n as the number of memory frames.

15
Reference String : 12,15,12,18,6,8,11,12,19,12,6,8,12,15,19,8

1) Implement LRU

(Marks
15)

3.Viva

(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write the simulation program to implement demand paging and show the
page scheduling and total number of page faults for the following given
page reference string. Give input n as the number of memory frames.

Reference String: 2,5,2,8,5,4,1,2,3,2,6,1,2,5,9,8

1) Implement MRU
(Marks 15)
2. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘Prime’ as
myshell$ Prime n : It will give the prime number of given number
(Marks 15)

16
3.Viva

(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write the program to simulate Round Robin (RR) scheduling. The


arrival time and first CPU-burst for different n number of processes
should be input to the algorithm. Also give the time quantum as input.
Assume the fixed IO waiting time (2 units). The next CPU-burst
should be generated randomly. The output should give Gantt chart,
turnaround
time and waiting time for each process. Also find the average waiting
time and turnaround time
(Marks 15)
3. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘factorial’ as

17
myshell$ factorial n : It will give the factorial number of given number
(Marks 15)

3.Viva

(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program that behaves like a shell which displays the command
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘print’ as
a. myshell$ print n filename: It will display first n lines of the file.
b. myshell$ print -n filename: It will display last n lines of the file.
c. myshell$ print a filename: It will display all the lines of the file.
(Marks 15)
2. Write the program to simulate Non-preemptive Priority scheduling. The
arrival time and first CPU-burst and priority for different n number of
processes should be input to the algorithm. Assume the fixed IO waiting
time (2 units). The next CPU-burst should be generated randomly. The

18
output should give Gantt chart, turnaround time and waiting time for each
process. Also find the average waiting time and turnaround time
(Marks 15)

3.Viva

(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write the program to simulate Preemptive Shortest Job First (SJF)


-scheduling. The arrival time and first CPU-burst for different n number
of processes should be input to the algorithm. Assume the fixed IO
waiting time (2 units). The next CPU-burst should be generated
randomly. The output should give Gantt chart, turnaround time and
waiting time for each process. Also find the average waiting time and
turnaround time.
(Marks 15)
2. Write the simulation program to implement demand paging and show the
page scheduling and total number of page faults for the following given
page reference string. Give input n as the number of memory frames.

19
Reference String : 1,2,1,4,5,6,4,3,2,6,7,12,3,4,5,6,1

1) Implement OPT
(Marks 15)

3.Viva

(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write the program to simulate FCFS CPU-scheduling. The arrival


time and first CPU- burst for different n number of processes should
be input to the algorithm. Assume that the fixed IO waiting time (2
units). The next CPU-burst should be generated randomly. The output
should give Gantt chart, turnaround time and waiting time for each
process. Also find the average waiting time and turnaround time

(Marks 15)

2. Write a C program that behaves like a shell which displays the


command prompt ‘myshell$’. It accepts the command, tokenize the
command line and execute it by creating the child process. Also
implement the additional command ‘list’ as

20
a. myshell$ list f dirname: It will display filenames in a given
directory.
b. myshell$ list n dirname: It will count the number of entries in a
given directory.
c. myshell$ list i dirname: It will display filenames and their inode
number for the files in a given directory.
(Marks 15)

3.Viva

(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write the program to simulate Round Robin (RR) scheduling. The arrival
time and first CPU-burst for different n number of processes should be
input to the algorithm. Also give the time quantum as input. Assume the
fixed IO waiting time (2 units). The next CPU-burst should be generated
randomly. The output should give Gantt chart, turnaround time and
waiting time for each process. Also find the average waiting time and
turnaround time.
(Marks 15)
2. Write a C program that behaves like a shell which displays the command

21
prompt ‘myshell$’. It accepts the command, tokenize the command line
and execute it by creating the child process. Also implement the
additional command ‘Prime’ as
myshell$ Prime n : It will give the prime number of given number
myshell$ prime n m : It will give the prime number from n to m.
(Marks 15)
3. Viva
(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Implement the C program to accept n integers to be sorted. Main


function creates child process using fork system call. Parent process
sorts the integers using bubble sort and waits for child process using
wait system call. Child process sorts the integers using insertion sort
(Marks 15)
2. Write the simulation program to implement demand paging and show
the page scheduling and total number of page faults for the following

22
given page reference string. Give input n as the number of memory
frames.

Reference String : 12,15,12,18,6,8,11,12,19,12,6,8,12,15,19,8

1) Implement second chance algorithm


(Marks 15)
3. Viva
(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a program that demonstrates the use of nice() system call. After
a child process is started using fork(), assign higher priority to the
child using nice() system call.
(Marks 15)
2. Write a C program that behaves like a shell which displays the
command prompt ‘myshell$’. It accepts the command, tokenize the

23
command line and execute it by creating the child process. Also
implement the additional command ‘search’ as
a. myshell$ search f filename pattern : It will search the first
occurrence of pattern in the given file
b. myshell$ search a filename pattern : It will search all the
occurrence of pattern in the given file
c. myshell$ search c filename pattern : It will count the number of
occurrence of pattern in the given file

(Marks 15)
3. Viva
(Marks 5)

Savitribai Phule Pune University


T.Y.B.Sc.(Computer Science) Practical examination, Jan/Feb
(2019 Pattern)
CS-357 Lab Course-I –Operating System I
Duration:3 Hours Maximum Marks:35

1. Write a C program to illustrate the concept of orphan process. Parent


process creates a child and terminates before child has finished its task.
So child process becomes orphan process. (Use fork(), sleep(), getpid(),
getppid()).
(Marks 15)
2. Write the simulation program to implement demand paging and show the
page scheduling and total number of page faults for the following given
page reference string. Give input n as the number of memory frames.

24
Reference String : 12,15,12,18,6,8,11,12,19,12,6,8,12,15,19,8

1) FIFO

(Marks 15)
3. Viva
(Marks 5)

25

You might also like