Question Format s3
Question Format s3
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.
Examiner 2
Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
b.Write a shell program to check whether the given number is Armstrong or not.
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
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:
Write a c program for banker's algorithm, can the current resource allocation satisfy all the students'
requirements without resulting in a deadlock.
Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
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
Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
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.
Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
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.
Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
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.
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
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
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.
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
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.
Signature of EXAMINER
(Name of the Faculty with TTS NO.)
SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
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
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
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
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.
Signature of EXAMINER
(Name of the Faculty with TTS NO.)