Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views11 pages

Question Format s3

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

Question Format s3

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

SCHOOL OF COMPUTING

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

10211CS304 - OPERATING SYSTEMS LABORATORY

END SEMESTER PRACTICAL EXAMINATION

1.Practice on UNIX Commands. CO1


a.Alice is organizing her files on a Unix system and wants to create a new directory to store her
photos. She wants to name the directory "Photos". How can Alice create the "Photos" directory.
c.Alice has been working on a Unix server remotely and wants to safely log out from the server to end
her session. How can Alice log out from the Unix server

b.In a Unix system, a new user named Bob has just created a directory named "Reports" and a file named
"sales.txt" inside it. Bob wants to know the default access permissions set for the "Reports" directory and the
"sales.txt" file at the time of creation. What are the default access permissions for these newly created files and
directories.

2. Use of semaphores to control access to a shared device between process. CO2


Write a C program to solve producer and consumer problem using semaphores.

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
Examiner 1

Examiner 2

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

10211CS304 - OPERATING SYSTEMS LAB

MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1. Interpret Shell programming CO1


Bob is a system administrator who needs to perform various tasks using shell programming.

a.Write a shell program to find greatest of three numbers.

b.Write a shell program to check whether the given number is Armstrong or not.

2. Write a C program to implement CPU Scheduling algorithms to allocate resources among


competing processes. CO2
a.For FCFS scheduling algorithm, read the three processes P1, P2 and P3 that are competing for CPU
burst times. The scheduling is performed on the basis of arrival time of each processes irrespective of
their other parameters. Each process arrives at different times and has a different burst time. The user
employs the FCFS scheduling algorithm to determine the order in which these processes are executed.
Calculate the waiting time and turnaround time of each of the processes accordingly.

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
10211CS304 - OPERATING SYSTEMS LAB
MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1.Illustrate System calls of UNIX operating system (fork, exec, getpid, exit, wait, close). CO1
Thara is a programmer working on a Unix operating system and needs to understand and illustrate the
usage of various system calls. Thara wants to write a program that creates a child process, executes a
different program within the child process, and then waits for the child process to complete before
exiting. Additionally, she wants to obtain the process ID of the child process and display it.

2. Apply Bankers Algorithm to avoid Deadlock that tests for safety by simulating the allocation
for predetermined maximum possible amounts of all resources. CO3
In a computer laboratory, there are five students, each working on their programming projects. The
students are named Alice, Bob, Charlie, David, and Eve. They require access to the lab's resources,
which include computer systems, printers, and external hard drives. The available resources in the lab
are as follows: Computer systems: 10,Printers: 3,External hard drives: 4.Each student/application has
a maximum resource requirement as follows:

Students Allocation MAX


Computer System External Computer System External
printer hard disk printer hard disk
Alice 1 1 0 2 1 1
Bob 2 0 0 3 1 0
Charlie 1 1 1 2 2 2
David 1 0 1 1 0 1
Eve 2 1 1 3 1 1

Write a c program for banker's algorithm, can the current resource allocation satisfy all the students'
requirements without resulting in a deadlock.

Performance in Conducting Result and


Viva Voce (5) Total (25)
Experiment (15) Analysis (5)
EXAMINER 1

MARK IN WORDS : --------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

10211CS304 - OPERATING SYSTEMS LAB

MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1. Interpret I/O System calls of UNIX operating system (open, read, write, etc). CO1
Adlin is a programmer working on a Unix operating system and needs to understand and interpret the
I/O system calls available.

Alice is developing a program that reads data from a file, performs some computations, and writes the
results to another file. She wants to utilize the I/O system calls to accomplish this task.
a.Create the file name” compter.txt” using create function and assign a variable to it. If the value of
the variable is less then print file cannot be created, otherwise print file is created.
b. Perform read operation in the “computer.txt” file and print it on screen

2. Apply Disk scheduling algorithms to schedule I/O requests arriving for the disk using Disk
Scheduling.
Consider a disk with 200 tracks numbered from 0 to 199. The disk scheduling algorithm being used is
the Shortest Seek Time First (SSTF) algorithm. The disk head is initially positioned at track 100. The
following track requests are received in the order given:45, 87, 90, 178, 32, 55, 60.Using a suitable
disk scheduling visualization tool or simulator, visualize and determine the sequence of disk
movements and the total head movement distance required to process the given track requests using
the SSTF algorithm. Using the tool determine the distance covered by arm in following situations.
a)Service the request closest to current head position.
b)Wrap the requests in a circular manner from last cylinder to first one.
c)How is the above method implemented generally so that seek time is reduced? CO5

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

10211CS304 - OPERATING SYSTEMS LAB

MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1.Inter-Process Communication (using shared memory, pipes or message queues). CO1

a) Alice and Bob are two processes running on a Unix operating system. Alice wants to send a
message to Bob using inter-process communication. They decide to use shared memory for
communication. Bob will read the message from the shared memory and print it on the
console.

b) Demonstrate of Inter-Process Communication using Shared Memory:

2. Write a C program to implement CPU Scheduling algorithms to allocate resources among


competing processes.
For SJF scheduling algorithm, read the four processes/jobs P1, P2, P3 and P4 in the system, arriving
at the ready queue in the following order: P1, P2, P3, P4. The burst time (execution time) for each
process is as follows: P1:6ms, P2:3ms, P3:8ms and P4:4ms Then calculate the waiting time and
turnaround time of each of the processes accordingly

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

10211CS304 - OPERATING SYSTEMS LAB

MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1.Use of semaphores to control access to a shared device between process. CO2


Thara and Carle are both working on separate projects and frequently need to print their files. They
want to ensure that only one of them can use the printer at a time to avoid conflicts. They decide to
implement a semaphore-based solution to control access to the printer.

How can thara and carle use semaphores to control access to the printer between their processes.

2. Interpret I/O System calls of UNIX operating system (open, read, write, etc). CO1
Write a c program to create a file named as “vtucse.txt” copy content from “computer.txt”, write into
it and display the content of “vtucse.txt” file in display.

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

10211CS304 - OPERATING SYSTEMS LAB

MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
Summer Timing :8.45am to 10.35am Date : 4.4.2024

1. Write a C program to implement CPU Scheduling algorithms to allocate resources among


competing processes. CO2
a.For FCFS scheduling algorithm, read the three processes P1, P2 and P3 that are competing for CPU
burst times. The scheduling is performed on the basis of arrival time of each processes irrespective of
their other parameters. Each process arrives at different times and has a different burst time. The user
employs the FCFS scheduling algorithm to determine the order in which these processes are executed.
Calculate the waiting time and turnaround time of each of the processes accordingly.

b. For SJF scheduling algorithm, read the four processes/jobs P1, P2, P3 and P4 in the system,
arriving at the ready queue in the following order: P1, P2, P3, P4. The burst time (execution time) for
each process is as follows: P1:6ms, P2:3ms, P3:8ms and P4:4ms Then calculate the waiting time and
turnaround time of each of the processes accordingly.

1.Practice on UNIX Commands. CO1


a.Alice is organizing her files on a Unix system and wants to create a new directory to store her
photos. She wants to name the directory "Photos". How can Alice create the "Photos" directory.
c.Alice has been working on a Unix server remotely and wants to safely log out from the server to end
her session. How can Alice log out from the Unix server

b.In a Unix system, a new user named Bob has just created a directory named "Reports" and a file named
"sales.txt" inside it. Bob wants to know the default access permissions set for the "Reports" directory and the
"sales.txt" file at the time of creation. What are the default access permissions for these newly created files and
directories.
Performance in Conducting Result and Viva Total
Experiment (15) Analysis (5) Voce (5) (25)

EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
10211CS304 - OPERATING SYSTEMS LAB
MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1.Apply Bankers Algorithm to avoid Deadlock that tests for safety by simulating the allocation
for predetermined maximum possible amounts of all resources. CO3
In a computer laboratory, there are five students, each working on their programming projects. The
students are named Alice, Bob, Charlie, David, and Eve. They require access to the lab's resources,
which include computer systems, printers, and external hard drives. The available resources in the lab
are as follows: Computer systems: 10,Printers: 3,External hard drives: 4.Each student/application has
a maximum resource requirement as follows:
Students Allocation MAX
Computer System External Compute System External
printer hard disk r printer hard
disk
Alice 1 1 0 2 1 1
Bob 2 0 0 3 1 0
Charlie 1 1 1 2 2 2
David 1 0 1 1 0 1
Eve 2 1 1 3 1 1

a.Write a c program for banker's algorithm, can the current resource allocation satisfy all the students'
requirements without resulting in a deadlock.

2. Interpret Shell programming CO1


Bob is a system administrator who needs to perform various tasks using shell programming.
a.Write a shell program to find greatest of three numbers.
b.Write a shell program to check whether the given number is Armstrong or not.

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis (5)
(5) (25)
(15)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
10211CS304 - OPERATING SYSTEMS LAB
MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1.Interpret Memory allocation schemes for dynamically allocate portions of memory to programs
at their request. Implement following memory allocation policies with given data: Consider a five
memory partitions of 200kb, 400kb, 600kb, 800kb (in order), how the first-fit, best-fit would and
worst fit algorithm place the processes of 216kb, 418kb, 113kb and 428kb. CO4

2.Illustrate System calls of UNIX operating system (fork, exec, getpid, exit, wait, close). CO1
Thara is a programmer working on a Unix operating system and needs to understand and illustrate the
usage of various system calls. Thara wants to write a program that creates a child process, executes a
different program within the child process, and then waits for the child process to complete before
exiting. Additionally, she wants to obtain the process ID of the child process and display it.

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

10211CS304 - OPERATING SYSTEMS LAB

MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1.Apply Disk scheduling algorithms to schedule I/O requests arriving for the disk using Disk
Scheduling.
Consider a disk with 200 tracks numbered from 0 to 199. The disk scheduling algorithm being used is
the Shortest Seek Time First (SSTF) algorithm. The disk head is initially positioned at track 100. The
following track requests are received in the order given:45, 87, 90, 178, 32, 55, 60.Using a suitable
disk scheduling visualization tool or simulator, visualize and determine the sequence of disk
movements and the total head movement distance required to process the given track requests using
the SSTF algorithm. Using the tool determine the distance covered by arm in following situations.
a)Service the request closest to current head position.
b)Wrap the requests in a circular manner from last cylinder to first one.
c)How is the above method implemented generally so that seek time is reduced? CO5

2. Interpret I/O System calls of UNIX operating system (open, read, write, etc). CO1
Adlin is a programmer working on a Unix operating system and needs to understand and interpret the
I/O system calls available.

a. Alice is developing a program that reads data from a file, performs some computations, and writes
the results to another file. She wants to utilize the I/O system calls to accomplish this task.
a.Create the file name” compter.txt” using create function and assign a variable to it. If the value of
the variable is less then print file cannot be created, otherwise print file is created.
b. Perform read operation in the “computer.txt” file and print it on screen

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
10211CS304 - OPERATING SYSTEMS LAB
MODEL LAB PRACTICAL EXAMINATION

Faculty Name :Dr. S.AMUTHA SLOT : L13


Faculty Co-ordinator :Dr.G.Nallasivan Semester : WS23-24
SUMMER Timing :8.45am to 10.35am Date : 4.4.2024

1. Consider a computer system with a physical memory size of 4 frames and a virtual memory
size of 8 pages. The system is using the Least Recently Used (LRU) page replacement
algorithm. The following sequence of page requests is received:1, 2, 3, 4, 1, 5, 6, 2, 7, 8, 7, 8,
3, 4, 5 .Using a suitable page replacement algorithm visualization tool or simulator, visualize
and determine the sequence of page faults and the final page allocation status after
processing the page requests. CO4

2.Inter-Process Communication (using shared memory, pipes or message queues). CO1

a) Alice and Bob are two processes running on a Unix operating system. Alice wants to send a
message to Bob using inter-process communication. They decide to use shared memory for
communication. Bob will read the message from the shared memory and print it on the
console.

Performance in Result and


Viva Voce Total
Conducting Experiment Analysis
(5) (25)
(15) (5)
EXAMINER 1

MARK IN WORDS : ---------------------------------------------------------------------------------------------

Signature of EXAMINER
(Name of the Faculty with TTS NO.)

You might also like