You are on page 1of 124

www.vustudents.ning.

com
CS604 - Operating System - Question No: 22 ( M a r k s: 5 )
What are the advantages of Round Robin Scheduling Algorithm?

CS604 - Operating System - Question No: 23 ( M a r k s: 5 )


Analyze the following algorithm to solve the critical section problem and explain
whether it satisfies the Mutual Exclusion Characteristic

Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)

Ans: To prove mutual exclusion, note that Pi enters its critical section only if either

flag[j]=false or turn=i. Also, if both processes were executing in their critical sections at

the same time, then flag[0]= = flag[1]= = true. These two observations suggest that P0
and

P1 could not have found both conditions in the while statement true at the same time,

since the value of „turn‟ can either be 0 or 1. Hence only one process say P0 must have

successfully exited the while statement. Hence mutual exclusion is preserved.

1.Analyze the given algorithm proposed to solve the critical section problem.
Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)
: 5marks

2.List and define the different metrics by which we might evaluate a scheduler
(list at least 4)
5marks

3. How can you differentiate between a library call and a system call? Explain
briefly giving at least one example.
3marks
The library function executes the instruction following trap; interprets the return
values from the kernel and returns to the user process.
www.vustudents.ning.com
The operating system determines which system call is to be carried out by
examining one of the parameters (the call number) passed to it by library routine.

4. Define the terms "Bounded Waiting" and "Progress" with respect to Critical
Section Problem. (3 marks)
Bounded Waiting :
There exists a bound on the number of times that other processes are allowed to enter
their critical sections after a process has made a request to enter its critical section and
before that request is granted.
Progress :
If no process is executing in its critical section and some processes wish to enter their
critical sections, then only those processes that are not executing in their remainder
section can participate in the decision on which will enter its critical section next, and
this selection cannot be postponed indefinitely.

5. How can you differentiate between the fifo and pipe?(2 marks)

6. There are number of commands in Linux/Unix. Write the method through


which these commands can communicate with each other?
(2 marks)
***
3 Questions of 2 marks:
1) What assumptions should be kept in mind while formulating a
solution to critical section problem
2) Differentiate between independent processes and cooperative
processes
3) Differentiate between fifo and pipe

2 Questions of 2 marks:
1) What are the three requirements for the solution of critical
section problems
2) mkfifo() call may fail due to many reason. Describe the situations
in which mkfifo() command will terminate and also describe the
situations in which the mkfifo() command will not terminate

2 Questions of 5 marks:
1) What are the advantages of Round Ribon scheduling algorithm and
what are the disadvantages of this scheduling algorithm
2) Highlight the shortcoming in the following hardware solution
do
{
while(testandset(lock));
critical section
lock=false;
remainder section
}while(1);
www.vustudents.ning.com
__________ integer shows the highest priority of a process in CPU
scheduling.

1. Small
2. Large

The process of switching from one process to another is called latency.


1. True
2. False

Batch programs are usually __________ programs.

1. interactive
2. Non-interactive
3. Fore ground
4. Preemptive

___________ is used in real time operating systems.

1. Non-preemptive scheduling
2. Preemptive scheduling
3. Dispatching scheduling
4. FCFS scheduling

The procedure “The time at which the process finished working MINUS the
arrival time of the process MINUS CPU burst for that process” will help
calculate the _________.

1. Non-preemptive Shortest Job First scheduling


2. Preemptive Shortest Job First scheduling.
3. FCFS
4. RR Scheduling

The priorities of processes in the __________ group remain fixed.

1. Kernel
2. User

First _______ entries in Per Process File Descriptor Table are used as soon
as the process is created.

 1
 2
 3
 4
www.vustudents.ning.com
_____________ is a preemptive scheduling algorithm.

1. First Come First Serve


2. Shortest Job First
3. Round Robin
4. None of these

_______________ scheduling algorithm can be preemptive or non-


preemptive.

1. First Come First Serve


2. Shortest Job First
3. Round Robin
4. Priority

Cooperating processes never share any data, code, memory or state.


1. True
2. False

When process opens its first file explicitly it will get descriptor number _________
 1
 2
 3
 4

Taking the CPU from one process and giving the CPU to another process is termed
as
1. Context switching
2. Dispatching
3. Swapping
4. Tracking

The correct command for compiling C program named program.c in Linux


environment is
1. gcc program.c –o FirstPrgram
2. gcc –o FirstProgram program.c
3. gcc –z FirstProgram program.c
4. gcc program.c –m FirstPrgram

All Threads within a process share the _________ address space.


Select correct option:

Same
Different

The scheduling of _____________ are done by the operating system.


Select correct option:

Kernel threads
www.vustudents.ning.com
User level threads

Both Kernel and User Level thread

None of the give option


Kernel threads are supported directly by the operating system. The kernel performs the
scheduling, creation, and management in

------ Command displays the status of a process.


Select correct option:

ls

ps

gcc

cat

In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:

1. File

2. Screen

3. Printer

4. Scanner
5.

The priority of a process can be changed using __________ command.


Select correct option:

1. nice

2. cmd

3. cat

4. grep

---------displays information about the top processes.


Select correct option:

ls
cs
top
www.vustudents.ning.com
cd
___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.

1. Little’s Formula

2. Deterministic Modeling

3. Queuing Theory

4. Queuing analysis

The process id returned to the child process after successful fork system call
execution is ______.

 0
 1
 2
 3

The nice value helps in assigning ______ to a process.


Select correct option:

Priority

Weight

Time

Scheduling

Round Robin algorithm is similar to _____________ scheduling but preemption is added


to switch between processes.
Select correct option:

Shortest Job First


Shortest Remaining Time First

First Come First Serve


None of these

In Unix/ Linux, by default the standard input file is attached to the ___________
Select correct option:

Mouse

Keyboard

Light pen
www.vustudents.ning.com
Joystick

A major problem with priority scheduling algorithms is _________________.


Select correct option:

Deadlock
Aging
Starvation
None of these

A solution to the critical section problem must satisfy the following three requirements:
Mutual Exclusion
Progress
Bounded Waiting

Question # 9 of 10 ( Start time: 12:06:28 PM ) Total Marks: 1


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

Non-preemptive SJF

Priority Scheduling

Preemptive Shortest Job First

FCFS

When process opens its first file explicitly it will get descriptor number _________
 1
 2
 3
 4
Round Robin algorithm is most suitable for __________.
Time sharing system
Real time systems and batch systems
Running Batch programs
Expert system

If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
1. Pipe
2. Read
3. Write
4. Open

POSIX is a standard developed by ___________


www.vustudents.ning.com

Select correct option:


1. ANSI
2. IEEE
3. ISO
4. ACM

___________ is a solution to the problem of indefinite blockage of low-priority


processes.
1. Starvation
2. Deadlock
3. Aging
4. None of the these

_____ system call is used to write to a file or FIFO or any other IPC channel.
1. read
2. write
3. open
4. fork

_________________ scheduling allows a process to move between queues.

1. Round Robin
2. First Come First Serve
3. Multilevel Feedback Queue
4. Shortest Remaining Time First

MIDTERM
EXAMINATION Spring
2010
CS604- Operating Systems (Session - 3)

Time: 60 min
Marks: 40

Question No: 1 ( Marks: 1 ) - Please choose one


The hardware mechanism that enables a device to notify CPU is called an -------------

► Interrupt
► Signal
► Trap
► Process

Question No: 2 ( Marks: 1 ) - Please choose one


You can display the contents (names of files and directories) of a directory in UNIX/Linux directory
structure with the --------------- command.

►l
l
►s
► ls
► none of the given options
www.vustudents.ning.com
Question No: 3 ( Marks: 1 ) - Please choose one
The -------------- system call suspends the calling process.

► fork
► wait
► exec
► exit

Question No: 4 ( Marks: 1 ) - Please choose one


In ---------addressing, the recipient is not required to name the sender.

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

Question No: 5 ( Marks: 1 ) - Please choose one


-------- command gives a snapshot of the current processes.

► ps
► top
► who
► ls

Question No: 6 ( Marks: 1 ) - Please choose one


--------------command to resume the execution of a suspended job in the foreground

► fg
► bg
► jobs
► kill

Question No: 7 ( Marks: 1 ) - Please choose one


You can use the ------------- command to display the status of suspended and background
processes

► fg
► bg
► jobs
► kill

Question No: 8 ( Marks: 1 ) - Please choose one


You can terminate a foreground process by pressing --------------

► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options

Question No: 9 ( Marks: 1 ) - Please choose one


A time sharing system is

► Multi tasking
► Interactive
► All of these
► Multi user

Question No: 10 ( Marks: 1 ) - Please choose one


The main characteristic of a Real time system is

► Efficiency
► Large Virtual Memory
► Large secondary storage device
► Usability
www.vustudents.ning.com
Question No: 11 ( Marks: 1 ) - Please choose one
Shared libraries and kernel modules are stored in
directory
www.vustudents.ning.com
► /bin
► /dev
► /boot
► /lib

Question No: 12 ( Marks: 1 ) - Please choose one


scheduler selects the process from the job pool and put them in main memory.

► Long term
► Short term
► Medium term
► Swapper

Question No: 13 ( Marks: 1 ) - Please choose one


In indirect inter process communication, a sender mention the name of the recipient.

► do
► do not

Question No: 14 ( Marks: 1 ) - Please choose one


A is an integer variable that, apart from initialization is accessible only through two
standard atomic operations: wait and signal.

► Semaphore
► Monitor
► Critical region
► Critical section

Question No: 15 ( Marks: 1 ) - Please choose one


A semaphore that cause Busy-W aiting is termed as .

► Spinlock
► Monitor
► Critical region
► Critical section

Question No: 16 ( Marks: 1 ) - Please choose one


The execution of critical sections must NOT be mutually exclusive

► True
► False

Question No: 17 ( Marks: 1 ) - Please choose one


The performance of Round Robin algorithm does NOT depends heavily on the size of the time quantum.

► True
► False

Question No: 18 ( Marks: 1 ) - Please choose one


The following requirement for solving critical section problem is known as _. “There exists
a bound on the number of times that other processes are allowed to enter their critical sections after a
process has made a request to enter its critical section and before that request is granted.”

► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region

Question No: 19 ( Marks: 1 ) - Please choose one


The critical section problem can be solved by the following except

► Software based solution


www.vustudents.ning.com

► Firmware based solution


► Operating system based solution
► Hardware based solution

Question No: 20 ( Marks: 1 ) - Please choose one


_ is also called Swapper.

► Swap space
► Medium term scheduler
► Short term scheduler
► Long term scheduler

MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 1 ( Marks: 1 ) - Please choose one
I MB or 1 megabyte is equivalent to----

1024 bytes
10242 bytes (may be this)
10243 bytes
1000000 bytes

Question No: 2 ( Marks: 1 ) - Please choose one

The bottom layer in the layered approach of Operating System is-----------


Hardware

User interface
Hardware
Kernel
None of the given options

Question No: 3 ( Marks: 1 ) - Please choose one

------------has a hierarchical file system structure.

DOS
Windows
UNIX
None of the given options

Question No: 4 ( Marks: 1 ) - Please choose one

You can use the ---------command in UNIX to create a directory.


rmdir
mkdir
cp
gcc

Question No: 5 ( Marks: 1 ) - Please choose one


www.vustudents.ning.com
Files that start with a -------- in UNIX/Linux directory structure are known as hidden
files .

. (dot)
# ( hash )
/ (slash)
~ (tilt)

Question No: 6 ( Marks: 1 ) - Please choose one

The creating process is called a--------------- process while the new processes are
called the -------------- of that process

None of the given options


Children, parent
Parent, children
Zombie, single

Question No: 7 ( Marks: 1 ) - Please choose one

------------buffer places no practical limit on the size of the buffer

Bounded
Unbounded
Both Unbounded & bounded
Bounded
Unbounded
None of the given options

Question No: 8 ( Marks: 1 ) - Please choose one


The ------------ are used for communication between related or unrelated
processes on the same system or unrelated processes on different systems.

Pipes
BSD Sockets
Named pipe (FIFO)
None of the given options

Question No: 9 ( Marks: 1 ) - Please choose one

A ---------------is an abstract key for accessing a file.

File descriptor
Input Redirection
Output Redirection
FIFO

Question No: 10 ( Marks: 1 ) - Please choose one

-------- command gives a snapshot of the current processes.

ps
www.vustudents.ning.com
top
who
ls

Question No: 11 ( Marks: 1 ) - Please choose one


You can display all of the signals supported by your system, along with their
numbers, by using the -----------command

<Ctrl-A>
fg
jobs
kill -l

Question No: 12 ( Marks: 1 ) - Please choose one

The time it takes for the dispatcher to stop one process and start another running
is known as the-----------.

Dispatch latency
Scheduling
Context switching
None of the given options

Question No: 13 ( Marks: 1 ) - Please choose one


First-Come, First-Served (FCFS) is a --------------scheduling algorithm.

preemptive
non-preemptive
both preemptive and non- preemptive none of the given options

Question No: 14 ( Marks: 1 ) - Please choose one

The Shortest-Job-First Scheduling algorithm can be

Preemptive only
non-preemptive only
preemptive or non-preemptive.
None of the given options

Question No: 15 ( Marks: 1 ) - Please choose one

Preemptive ----------------scheduling is sometimes called shortestremaining-time-


first scheduling.

First-Come-First-Served (FCFS)
Round-Robin
Sorted Job First (SJF)
Priority

Question No: 16 ( Marks: 1 ) - Please choose one


The basic purpose of ________________is to help the users to utilize the hardware
resources for completing different tasks in a simplified manner
www.vustudents.ning.com
Operating system
Application software
All Software
All of the given

Question No: 17 ( Marks: 1 ) - Please choose one


OS helps manages the following except

Application software
Bus speed of the system
Memory
Virtual memory

Question No: 18 ( Marks: 1 ) - Please choose one


__________ scheduler selects the process from the job pool and put them in main
memory.

Long term
Short term
Medium term
Swapper

Question No: 19 ( Marks: 1 ) - Please choose one

A parent process calling __________ system call will be suspended until children process
terminates.

wait
fork
exit
exec

Question No: 20 ( Marks: 1 ) - Please choose one

n-process critical section problem can be solved by using

The bakery algorithm


Deterministing modeling
Analytic evaluation
None of above
www.vustudents.ning.com
1. Linux OS can support multiple users at a time
a) True
b) False

2. The Operating system is a layer of software between _________ and ___________.


a) hardware, software application
b) Kernel, hardware
c) Dos, Windows
d) Windows, Kernel

3. The major advantage of multi-programming system is


a) More than one jobs can be processed at a given time
b) CPU utilization can be increased
c) Jobs can be completed quickly
d) All of the options are correct

4. The main characteristic of a Real time system is


a) Efficiency
b) Large Virtual Memory
c) Large secondary storage device
d) Usability

5. Command-line interpreter is also called __________ in some operating systems.


a) Kernel
b) Shell
c) Signal
d) API

6. I/O instructions are Privileged Instructions.


a) True
b) False

7. In Linux directory structure, there is ___________ root directory.


a) 1
b) 2
c) 3
d) 4

8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
b) /boot
c) /lib
d) /sbin

9. rm and rmkdir commands are used to _____________ directory.


a) Create
b) Move
c) Remove
d) Modify

10. You can use the mv file1 file2 command to move ______________
a) file1 to file2.
b) file 2 to file 1
www.vustudents.ning.com
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct

11. Taking the CPU from one process and giving the CPU to another process is termed
as
a) Context Switching
b) Dispatching
c) Swapping
d) Tracking

13. A Process that has finished working, as well as its parent process has also finished its
execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork

14. Bounded Buffer is a buffer of ____________ size


a) variable
b) fixed

15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self

16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not

17. The returned code to the child process after successful fork system call execution is
a) 1
b) 2
c) 3
d) 0

18. If the fork system call fails, it returns


a) 1
b) -1
c) 2
d) 0

19. When a process opens its first file explicitly it will get descriptor number
_________
a) 1
b) 2
c) 3
d) 4
www.vustudents.ning.com
www.vustudents.ning.com
CS604: QUIZES

Question # 1 of 10 ( Start time: 06:17:33 PM ) Total Marks: 1


Linux uses ___________ directory to store system configuration files.
Select correct option:
/bin
/dev
/boot
/etc

Question # 2 of 10 ( Start time: 06:18:01 PM ) Total Marks: 1


OS helps manages the following except
Select correct option:
Application software
Memory
Virtual memory
Bus speed of the system

Question # 3 of 10 ( Start time: 06:18:09 PM ) Total Marks: 1


Linux OS can support multiple users at a time
Select correct option:
True
False

Question # 4 of 10 ( Start time: 06:18:17 PM ) Total Marks: 1


__________ directory includes essential system boot files including the kernel image.
Select correct option:
/bin
/boot
/dev
/etc

Question # 5 of 10 ( Start time: 06:19:17 PM ) Total Marks: 1


_______ command displays the contents of current working directory.
Select correct option:
ls
cs
mv
cp

Question # 6 of 10 ( Start time: 06:20:29 PM ) Total Marks: 1


In Linux directory structure, there is ___________ root directory.
Select correct option:
1
2
3
4

Question # 7 of 10 ( Start time: 06:20:37 PM ) Total Marks: 1


You can use the rm file1 command to __________ file1.
Select correct option:
retrieve
remove
make
modify

Question # 9 of 10 ( Start time: 06:21:25 PM ) Total Marks: 1


Linux is only single user operating system
Select correct option:
True
False

Question # 10 of 10 ( Start time: 06:21:35 PM ) Total Marks: 1


____________ command is used to change the directory.
Select correct option:
ls
www.vustudents.ning.com
cp
cd
mv

Question # 4 of 10 ( Start time: 05:08:22 PM ) Total Marks: 1


Linux uses ___________ directory to store system configuration files.
Select correct option:

/bin
/dev
/boot
/etc

Question # 6 of 10 ( Start time: 05:09:41 PM ) Total Marks: 1


DOS is a single user operating system.
Select correct option:

True
False

Question # 9 of 10 ( Start time: 05:13:20 PM ) Total Marks: 1


A program in execution is called a _______________.
Select correct option:

Command
Process
Software
Compiler

Question # 7 of 10 ( Start time: 03:08:38 PM ) Total Marks: 1


The scheduling of _____________ are done by the operating system.
Select correct option:

Kernel threads

User level threads

Both Kernel and User Level thread

None of the give option

FCFS scheduling

Question # 9 of 10 ( Start time: 03:10:59 PM ) Total Marks: 1


If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
Select correct option:

Pipe

Read
www.vustudents.ning.com
Write

Open

Question # 9 of 10 ( Start time: 03:16:35 PM ) Total Marks: 1


The correct command for compiling C program named program.c in Linux environment
is
Select correct option:

gcc program.c –o FirstPrgram


gcc –o FirstProgram program.c
gcc –z FirstProgram program.c
gcc program.c –m FirstPrgram

Question # 3 of 10 ( Start time: 03:32:20 PM ) Total Marks: 1


The process id returned to the child process after successful fork system call execution is
______.
Select correct option:

0
1
2
3

Question # 4 of 10 ( Start time: 03:33:07 PM ) Total Marks: 1


POSIX is a standard developed by ___________
Select correct option:

ANSI

IEEE

ISO

ACM

Question # 8 of 10 ( Start time: 03:33:51 PM ) Total Marks: 1


The manual pages can be read in Linux using ____ command.
Select correct option:

man

wan

desc

help

Question # 10 of 10 ( Start time: 03:34:07 PM ) Total Marks: 1


The scheduling of _____________ are done by the operating system.
Select correct option:
www.vustudents.ning.com
Kernel threads

User level threads not sure

Both Kernel and User Level thread

None of the give option

Question # 3 of 10 ( Start time: 03:36:05 PM ) Total Marks: 1


____ command display the status of a process.
Select correct option:

ls not sure

ps

gcc

cat

Question # 6 of 10 ( Start time: 03:38:03 PM ) Total Marks: 1


The correct command for compiling C program named program.c in Linux environment
is
Select correct option:

gcc program.c –o FirstPrgram


gcc –o FirstProgram program.c
gcc –z FirstProgram program.c
gcc program.c –m FirstPrgram

All Threads within a process share the _________ address space.


Select correct option:

Same

Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management. in page#71

------ command display the status of a process.


Select correct option:
ls

ps

gcc

cat

---------displays information about the top processes.


www.vustudents.ning.com
Select correct option:

ls
cs
top p # 64
cd

___________ is the basis of queuing theory which is branch of mathematics used to


analyze systems involving queues and servers.
Select correct option:

Little’s Formula p # 94

Deterministic Modeling

Queuing Theory

Queuing analysis

Question # 1 of 10 ( Start time: 11:16:32 AM )


Kernel is responsible for scheduling the user level threads.
True
False
Question # 2 of 10 ( Start time: 11:17:51 AM )
The manual pages can be read in Linux using ____ command.
Man
Wam
Help
desc

Question # 9 of 10 ( Start time: 11:25:06 AM )


The scheduling of _____________ are done by the operating system.
Kernel threads
User level threads not sure
Both
None of these

Question # 9 of 10 ( Start time: 12:06:28 PM ) Total Marks: 1


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

Non-preemptive SJF

Priority Scheduling

Preemptive Shortest Job First

FCFS

When process opens its first file explicitly it will get descriptor number _________
1
www.vustudents.ning.com
2
3
4

MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 21 ( Marks: 2 )

Define Waiting time with respect to CPU Scheduling?


Waiting time: Waiting time is the time spent waiting in the ready queue. We want
to minimize the waiting time to increase CPU efficiency.

Question No: 22 ( Marks: 3 )

True or False? (and explain): the Multi-Level Feedback Queue (MLFQ) scheduling
algorithm is the same as Shortest-Job-First.

Question No: 23 ( Marks: 5 )

What does the term ‘input redirection’ mean? Write down the basic syntax
for input, output and error redirection of UNIX/LINUX system.

Question No: 24 ( Marks: 10 )

When we use the fork( ) system call? Give three reasons for its failure. Also write the
attributes which are inherited and which are not inherited by the child process from its
parent?

Total 23 Questions

MCQs 16

1. List and define the different metrics by which might evaluate a


scheduler (List at least 4). 5 marks

2. Write brief the multilevel feedback queue scheduling. 5 marks

Ans:

This algorithm partitions the ready queue into several separate


queues.Multilevel feedback queue scheduling allows a process to move
between queues. The idea is to separate processes with different CPU
www.vustudents.ning.com
burst characteristics. If a process uses too much CPU time, it will be
moved to a lower-priority queue.

This scheme leaves I/O bound and interactive processes in the higher-
priority queues. Similarly a process that waits too long in a lower-
priority queue may be moved o a higher priority queue. This form of
aging prevents starvation.

In general, a multi-level feedback queue scheduler is defined by the


following parameters:

ƒ Number of queues

ƒ Scheduling algorithm for each queue

ƒ Method used to determine when to upgrade a process to higher


priority queue

ƒ Method used to determine when to demote a process

ƒ Method used to determine which queue a process enters when it needs


service

3. Assumption made while formulating a solution to the critical


section problem. 2 marks

Ans:

Assumption made while formulating a solution to the critical section


problem

Assume that each process executes at a nonzero speed .

No assumption can be made regarding the relative speeds of the N


processes.

4. There are many commands. Write the method through which these
commands can communicate with each other. 3 marks
www.vustudents.ning.com
copy file1 file2 ……..//to copy „file1‟ to „file2‟

5. Write Difference between SJF and Shortest Remaining Time First


Scheduling algorithm. 3 marks

6. Write formula for calculating waiting time in preemptive Shortest


Job First Algorithm. 2 marks

7. Define race condition and how prevent this condition. 2 marks

Limited Register contains the size of the process. Command-line interpreter is also called
shell in some operating system.
You can use the cp file1 file2 command to copy file1 to file2. I/O bound process spend
more time doing I/O than computation. Pipes are used for communication between
related processes on a system.

What are pros and cons of multithreading?5 marks


user threadsare supported above kernel and are implemented by a thread library at the
user level.
Kernel threads are supported directly by the operating system. In one-to-one model,
there is a kernel thread for
every user thread.

What is waiting time in context of CPU burst?2marks

Prove that SJF is an optimal scheduling?3marks


A semaphore is an integer variable that, apart from initialization is accessible only
through two standard atomic operations: wait and signal.

Q. What is the main disadvantage od semaphore?5marks

Q. About spinlock..3marks

20 MCQ's and 6 questions

1. Write data structures for bakery algorithm? (2 marks)


2. Which command is used for suspending a foreground process? (2 marks)
3. Which command is used to resume the execution of a suspended job in
the background? (3 marks)
4. Define race condition? (3 marks)
www.vustudents.ning.com
5. How to implement RR scheduling? (5 marks)
6. Highlight critical sections of this code? (5 marks)
Operating System
20 MCQ's and 6 questions

1. Write data structures for bakery algorithm? (2 marks)


2. Which command is used for suspending a foreground process? (2 marks)
3. Which command is used to resume the execution of a suspended job in the
background? (3 marks)
4. Define race condition? (3 marks)
5. How to implement RR scheduling? (5 marks)
6. Highlight critical sections of this code? (5 marks)

do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);

7. Write data structures for bakery algorithm? (2 marks)


8. Which command is used for suspending a foreground process? (2 marks)

9. Which command is used to resume the execution of a suspended job in the


background? (3 marks)
10. Define race condition? (3 marks)
11. How to implement RR scheduling? (5 marks)
12. Highlight critical sections of this code? (5 marks)

do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);

total Qs 26.
20 MCQs.
2Qs of 2 marks.
2Qs of 3 marks.
2Qs of 5 marks.
Limited Register contains the size of the

process.
Command-line interpreter is also called shell in

some operating system.


www.vustudents.ning.com
You can use the cp file1 file2 command to copy file1

to file2.
IO bound process spend more time doing IO than

computation.
Pipes are used for communication between related

processes on a system.
What are pros and cons of multithreading?5 marks
user threadsare supported above kernel and are

implemented by a thread library at the user level.


Kernel threads are supported directly by the

operating system.
Inone-to-one model, there is a kernel thread for

every user thread.


What is waiting time in context of CPU burst?2marks
Prove that SJF is an optimal scheduling?3marks
A semaphore is an integer variable that, apart

from initialization is accessible only through two

standard atomic operations: wait and signal.


Q. What is the main disadvantage od semaphore?5marks
Q. About spinlock..3marks

MIDTERM
EXAMINATION Spring
2011
CS604- Operating Systems (Session - 3)

Total 23 Questions
MCQs 16

1. List and define the different metrics by which might evaluate a scheduler (List
at least 4). 5 marks
Ans:
CPU Utilization
The percentage of time that the CPU is busy.Throughput The number of
processes completing in a unit of time..
Turnaround time The length of time it takes to run a process from initialization
totermination, including all the waiting time.Waiting time The total amount of
time that a process is in the ready queue.Response time The time between
when a process is ready to run and its next I/O request.
www.vustudents.ning.com
2.structure of Software critical section .5marks

Critical Section: A piece of code in a cooperating process in which the process may
updates shared data i.e variable, file, database, etc…. The Entry and Exist sections
comprise solution for the problem.
do
{
Entry section

critical section

Exit section

remainder section

} while(1)

3.Write formula for calculating waiting time in preemptive Shortest Job First Algorithm.
2 marks

Ans:
if Arrival time given...
Waiting Time = Turnaround-Arrival time

or if arrival time not given then..

for how much time processor will wait to take CPU thay will be ots waiting
time…..in case if Arrival time for all is ZERO then ...jis ko jis time pe pc mila
wohi us k waiting time hay ....

4.Requirements or critical section 3marks

5.IPC communication 2marks


IPC provides a mechanism to allow processes to communicate and to synchronize their
actions without sharing the same address space.

6.Open source software 2marks

These are that software whose source code is given along with application.

7.Why mfifo system call fails 3marks


www.vustudents.ning.com
Question No: 21 ( Marks: 2 )
Write the formula/ procedure for calculating the waiting time in preemptive Shortest Job
First scheduling.

Turnaround time-Burst Time-Arrival time

Question No: 22 ( Marks: 2 )


What are the common data structures in Bakery Algorithm?
The common data structures are:
boolean choosing [n];
int number[n];
Question No: 23 ( Marks: 3 )
If a process exits and there are still threads of that process running, will they continue to
run?

Yes,If a process exits and there are still threads of that process running, they will continue to
run. Higher-priority threads will run before lower-priority threads. The lowest-level
method of blocking other threads from running uses a global “thread critical”
condition. When the condition is set to true the scheduler will not schedule any
existing thread to run. However, this does not block new threads from being created
and run. Certain thread operations (such as stopping or killing a thread, sleeping in
the current thread, or raising an exception) may cause a thread to be scheduled even
when in a critical section.

Question No: 24 ( Marks: 3 )


What are the important characteristics of TestAndSet? What will be its advantage.
The important characteristic is that this instruction is executed atomically. Thus if two
TestAndSet instructions are executed simultaneously, they will be executed sequentially
in some arbitrary order.
If the machine supports TestAndSet instruction, then we can implement mutual
exclusion by declaring a Boolean variable lock, initialized to false.
Question No: 25 ( Marks: 5 )
Considering the Resource sharing feature of thread, what do you think is „resource sharing‟
an advantage of a thread or disadvantage of a thread. Explain yours answer briefly.
By default, threads share the memory and the resources of the process to which
they belong.Whereas resource sharing is one of the major advantages of
threads, it is also a disadvantage because proper synchronization is needed

between threads for accessing the shared resources (e.g., data and files).

Question No: 26 ( Marks: 5 )


Analyze the given algorithm proposed to solve the critical section problem.
Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical
section turn=j;
remainder section
} while(1)

This solution ensures mutual exclusion, that is only one process at a time can be
in its critical section. However it does not satisfy the progress requirement, since
it requires strict alternation of processes in the execution of the critical section.
For example, if
www.vustudents.ning.com
turn= =0 and P1 is ready to enter its critical section, P1 cannot do so even though
P0 may be in its remainder section. The bounded wait condition is satisfied
though, because there is an alternation between the turns of the two processes.

total 23
1x16
2x3
3x2
5x2

1.what are two problem of using processes that can be overcome by using the threads (5)
2. find the shortcomming of the given sloution of Critical Section Problem (page 106)
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);

1.how to dependent processes can communicate within a system(2-marks)


2.for which problem we make there two assumptions (2 marks)
1.Assume that each process executes at a nonzero speed
2. No assumption can be made regarding the relative speeds of the N processes
1.A system have I/o bound processes and CPU bond processes and the IO bound proceses are waiting for the CPU what is the
problem comes in mind by the above senario (3 marks)

papers is not straight forward its totally conceptual..


MCQs.. 70 % from old papers but all are conceptual....
Please Be prepared before attend the paper...

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmWmgjK

PAPER#1
Total 23 Questions
MCQs 16
1. List and define the different metrics by which might evaluate a scheduler (List at least 4). 5 marks
2. Write brief the multilevel feedback queue scheduling. 5 marks
3. Assumption made while formulating a solution to the critical section problem. 2 marks
4. There are many commands. Write the method through which these commands can communicate with each other. 3 marks
5. Write Difference between SJF and Shortest Remaining Time First Scheduling algorithm. 3 marks
6. Write formula for calculating waiting time in preemptive Shortest Job First Algorithm. 2 marks
7. Define race condition and how prevent this condition. 2 marks

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmbAcyA

PAPER#2
Question No: 17 ( Marks: 2 )
What is Convoy Effect?

Question No: 18 ( Marks: 2 )


What are the common data structures in Bakery Algorithm?

Question No: 19 ( Marks: 2 )


How a pipe can be created?

Question No: 20 ( Marks: 3 )


Define Progress and Bounded Waiting.

Question No: 21 ( Marks: 3 )


What is Starvation and how it occures

Question No: 22 ( Marks: 5 )


What are the advantages of Round Robin Scheduling Algorithm?

Question No: 23 ( Marks: 5 )


Analyze the following algorithm to solve the critical section problem and explain whether it satisfies the Mutual Exclusion
Characteristic

Flag[i] = True;
Turn = j;
do{
www.vustudents.ning.com
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmfRFni

1)

A code about test and set lock was given to highlight errors 5Marks

2)

What is starvation and what is its solution 5Marks

3)

What are common data structures in Bakery Algorithm 2Marks

4)

Difference between preemptive and Non Preemptive Algorithm 2Marks

5)

How inter process communication is done among processes 2Marks

6)

Difference between SJF and SRTF 3Marks

7)

Three queues in Multi level feed back……..3Marks

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmkHFvF

Question No: 3 ( M a r k s: 1 )
The -------------- system call suspends the calling process.

► fork
► wait
► exec
► exit

Question No: 4 ( M a r k s: 1 )
In ---------addressing, the recipient is not required to name the sender.

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

Question No: 5 ( M a r k s: 1 )
-------- command gives a snapshot of the current processes.

► ps
► top
► who
► ls

Question No: 6 ( M a r k s: 1 )
--------------command to resume the execution of a suspended job in the foreground

► fg
► bg
► jobs
► kill

Question No: 7 ( M a r k s: 1 )
You can use the ------------- command to display the status of suspended and background processes

► fg
► bg
► jobs
► kill

Question No: 8 ( M a r k s: 1 )
You can terminate a foreground process by pressing --------------

► <Ctrl-A>
www.vustudents.ning.com
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options

Question No: 9 ( M a r k s: 1 )
A time sharing system is

► Multi tasking

► Interactive

► All of these

► Multi user

Question No: 10 ( M a r k s: 1 )
The main characteristic of a Real time system is

► Efficiency

► Large Virtual Memory

► Large secondary storage device

► Usability

Question No: 11 ( M a r k s: 1 )
Shared libraries and kernel modules are stored in _____________ directory

► /bin

► /dev

► /boot

► /lib

Question No: 12 ( M a r k s: 1 )
__________ scheduler selects the process from the job pool and put them in main memory.

► Long term

► Short term

► Medium term

► Swapper

Question No: 13 ( M a r k s: 1 )
In indirect inter process communication, a sender ___ mention the name of the recipient.

► do

► do not

Question No: 14 ( M a r k s: 1 )
A ______________ is an integer variable that, apart from initialization is accessible only through two standard atomic
operations: wait and signal.

► Semaphore

► Monitor

► Critical region

► Critical section

Question No: 15 ( M a r k s: 1 )
A semaphore that cause Busy-Waiting is termed as ___________.

► Spinlock

► Monitor

► Critical region

► Critical section
www.vustudents.ning.com
Question No: 16 ( M a r k s: 1 )
The execution of critical sections must NOT be mutually exclusive

► True
► False

Question No: 17 ( M a r k s: 1 )
The performance of Round Robin algorithm does NOT depends heavily on the size of the time quantum.

► True
► False

Question No: 18 ( M a r k s: 1 )
The following requirement for solving critical section problem is known as ______________.
“There exists a bound on the number of times that other processes are allowed to enter their critical sections after a process
has made a request to enter its critical section and before that request is granted.”

► Progress

► Bounded Waiting

► Mutual Exclusion

► Critical Region

Question No: 19 ( M a r k s: 1 )
The critical section problem can be solved by the following except

► Software based solution

► Firmware based solution

► Operating system based solution

► Hardware based solution

Question No: 20 ( M a r k s: 1 )
___________ is also called Swapper.

► Swap space

► Medium term scheduler

► Short term scheduler

► Long term scheduler

Question No: 21 ( M a r k s: 2 )
Write the formula/ procedure for calculating the waiting time in preemptive Shortest Job First scheduling.

Question No: 22 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?

Question No: 23 ( M a r k s: 3 )
If a process exits and there are still threads of that process running, will they continue to run?

Question No: 24 ( M a r k s: 3 )
What are the important characteristics of TestAndSet? What will be its advantage.

Question No: 25 ( M a r k s: 5 )
Considering the Resource sharing feature of thread, what do you think is „resource sharing‟ an advantage of a thread or
disadvantage of a thread. Explain yours answer briefly.

Question No: 26 ( M a r k s: 5 )
Analyze the given algorithm proposed to solve the critical section problem. Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmr5hAI

CS604 Operating System Solved Paper


www.vustudents.ning.com
Midterm 2011
SPRING 2011 (12 MAY 2011)
CS604 - OPERATING SYSTEMS
Time: 60 min
M a r k s: 38

CS604 - Operating System - Question No: 1 ( M a r k s: 1 ) http://vuzs.net


Linux is a version of _______ operating system.
Select correct option:

► OS/2
► Windows
► Unix
► None of the above

CS604 - Operating System - Question No: 2 ( M a r k s: 1 ) http://vuzs.net


Current working directory can be accessed using --------- Command.
Select correct option:

►. (dot)
► # ( hash )
► / (slash)
► ~ (tilt)

CS604 - Operating System - Question No: 3 ( M a r k s: 1 ) http://vuzs.net


Mkfifo() is a _______.
Select correct option:

► System Call
► Command
► Directory
► None of Above

CS604 - Operating System - Question No: 4 ( M a r k s: 1 ) http://vuzs.net


-------- command gives a snapshot of the current processes.
Select correct option:

► ps
► top
► who
► ls

CS604 - Operating System - Question No: 5 ( M a r k s: 1 ) http://vuzs.net


Time interval when the I/O Devices are accessed is known as --------.
Select correct option:

► CPU Burst
► IO Burst
► Time Slice
► None of Above

CS604 - Operating System - Question No: 6 ( M a r k s: 1 ) http://vuzs.net


The process of switching from one process to another is called ---------------.
Select correct option:
www.vustudents.ning.com
► context switching
► scheduling
► quantum period
► latency

CS604 - Operating System - Question No: 7 ( M a r k s: 1 ) http://vuzs.net


__________ directory includes essential system boot files including the kernel
image.
Select correct option:

► /bin
► /boot
► /dev
► /etc

CS604 - Operating System - Question No: 8 ( M a r k s: 1 ) http://vuzs.net


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

► Non-preemptive SJF
► Priority Scheduling
► Preemptive Shortest Job First
► FCFS

CS604 - Operating System - Question No: 9 ( M a r k s: 1 ) http://vuzs.net


A semaphore that cause Busy-Waiting is termed as ___________.
Select correct option:

► Spinlock
► Monitor
► Critical region
► Critical section

CS604 - Operating System - Question No: 10 ( M a r k s: 1 ) http://vuzs.net


Progress and Bounded Waiting are some of the characteristics to solve the
critical section problems.
Select correct option:

► True
► False

CS604 - Operating System - Question No: 11 ( M a r k s: 1 ) http://vuzs.net


In ---------addressing, the recipient is not required to name the sender.
Select correct option:

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

CS604 - Operating System - Question No: 12 ( M a r k s: 1 ) http://vuzs.net


The execution of critical sections must NOT be mutually exclusive
Select correct option:
www.vustudents.ning.com
► True
► False

CS604 - Operating System - Question No: 13 ( M a r k s: 1 ) http://vuzs.net


A program in execution is called a _______________.
Select correct option:

► Command
► Process
► Software
► Compiler

CS604 - Operating System - Question No: 14 ( M a r k s: 1 ) http://vuzs.net


The critical section problem can be solved by the following except

► Software based solution


► Firmware based solution
► Operating system based solution
► Hardware based solution

CS604 - Operating System - Question No: 15 ( M a r k s: 1 ) http://vuzs.net


The bottom layer in the layered approach of Operating System is-----------
Select correct option:

► User interface
► Hardware
► Kernel
► None of the given options

CS604 - Operating System - Question No: 16 ( M a r k s: 1 ) http://vuzs.net


The manual pages can be read in Linux using ____ command.
Select correct option:

► man
► wan
► desc
► help

CS604 - Operating System - Question No: 17 ( M a r k s: 2 )


What is Convoy Effect?
Ans: Convoy effect is the result of mechanism in which some one has to follow
an order like the movement of a convoy. In FCFS, a process whether shorter or
smaller has to follow a queue to be assigned to a CPU. T
CS604 - Operating System - Question No: 18 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?
Ans: The common data structures are:

boolean choosing [n];

int number[n];
www.vustudents.ning.com
CS604 - Operating System - Question No: 19 ( M a r k s: 2 )
How a pipe can be created?
Ans: The pipe() system call creates a pipe and returns two file descriptors, one
for

reading and second for writing. The files associated with these

file descriptors are streams and are both opened for reading and writing.
Naturally, to use

such a channel properly, one needs to form some kind of protocol in which data
is sent

over the pipe.

CS604 - Operating System - Question No: 20 ( M a r k s: 3 )


Define Progress and Bounded Waiting.
Ans: 2. Progress

If no process is executing in its critical section and some processes wish to enter
their

critical sections, then only those processes that are not executing in their
remainder

section can participate in the decision on which will enter its critical section next,
and

this selection cannot be postponed indefinitely.

3. Bounded Waiting

There exists a bound on the number of times that other processes are allowed to
enter

their critical sections after a process has made a request to enter its critical
section and
www.vustudents.ning.com

before that request is granted.

CS604 - Operating System - Question No: 21 ( M a r k s: 3 )


What is Starvation and how it occures
Ans: A major problem with priority- scheduling algorithms is indefinite blocking
(or

starvation). A process that is ready to run but lacking the CPU can be
considered

blocked-waiting for the CPU.

CS604 - Operating System - Question No: 22 ( M a r k s: 5 )


What are the advantages of Round Robin Scheduling Algorithm?

CS604 - Operating System - Question No: 23 ( M a r k s: 5 )


Analyze the following algorithm to solve the critical section problem and explain
whether it satisfies the Mutual Exclusion Characteristic

Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)

Ans: To prove mutual exclusion, note that Pi enters its critical section only if
either

flag[j]=false or turn=i. Also, if both processes were executing in their critical


sections at

the same time, then flag[0]= = flag[1]= = true. These two observations suggest
that P0 and

P1 could not have found both conditions in the while statement true at the same
time,
www.vustudents.ning.com
since the value of „turn‟ can either be 0 or 1. Hence only one process say P0
must have

successfully exited the while statement. Hence mutual exclusion is preserved.

total Qs 26.
20 MCQs.
2Qs of 2 marks.
2Qs of 3 marks.
2Qs of 5 marks.

Limited Register contains the size of the process.


Command-line interpreter is also called shell in some operating system.
You can use the cp file1 file2 command to copy file1 to file2.
IO bound process spend more time doing IO thancomputation.
Pipes are used for communication between relatedprocesses on a system.
----------------------------------------------------------------------
What are pros and cons of multithreading?5 marks --------p-70
What is waiting time in context of CPU burst?2marks
Waiting time: Waiting time is the time spent waiting in the ready queue. We want to
minimize the waiting time to increase CPU efficiency.
Prove that SJF is an optimal scheduling?3marks--------------p-85
Q. What is the main disadvantage od semaphore?5marks----------p-110
Q. About spinlock..3marks
====================================================
=======
20 MCQ's and 6 questions

1. Write data structures for bakery algorithm? (2 marks)


The common data structures are:
boolean choosing [n];
int number[n];
Initially these data structures are initialized to false and 0, respectively.
The following
notation is defined for convenience:
ƒ (ticket #, process id #)
ƒ (a,b) < (c,d) if a<c or if a= =c and b<d.
ƒ max(a0, …an-1 ) is a number, k, such that k>= ai for i=0,…n-1

2. Which command is used for suspending a foreground process? (2 marks)


You can suspend a foreground process by pressing <Ctrl-Z>, which sends a
STOP/SUSPEND signal to the process

3. Which command is used to resume the execution of a suspended job in


the background? (3 marks)
You can use the bg command to put the current or a suspended process
into the background. Here is the syntax of the command.
bg [%job_id]
If %job_id is omitted the current job is assumed.
4. Define race condition? (3 marks)
A situation, where several processes access and manipulate the same data
concurrently and the outcome of the manipulation depends on the
particular order in which the access takes place, is called a race condition.
5. How to implement RR scheduling? (5 marks)
To implement RR scheduling, we keep ready queue as a FIFO queue of
processes. New processes are added to the tail of the ready queue. The CPU
www.vustudents.ning.com
scheduler picks the first process from the ready queue, sets a timer to
interrupt after 1 time quantum, and then dispatches the process. One of the
two things will then happen. The process may have a CPU burst of less than
1 time quantum, in which case the process itself will release the CPU
voluntarily. The scheduler will then proceed to the next process in the
ready queue.
Otherwise, if the CPU burst of currently running process is longer than one
time quantum, the timer will go off and will cause an interrupt to the
operating system. A context switch will happen, the current process will be
put at the tail of the ready queue, and the newly scheduled process will be
given the CPU.
6. Highlight critical sections of this code? (5 marks)

do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1
=====================================================================

Total 23 Questions
MCQs 16
1. List and define the different metrics by which might evaluate a
scheduler (List at least 4). 5 marks
2. Write brief the multilevel feedback queue scheduling. 5 marks---p-89
3. Assumption made while formulating a solution to the critical section
problem. 2 marks
While formulating a solution, we must keep the following
assumptions in mind:
ƒ Assume that each process executes at a nonzero speed
ƒ No assumption can be made regarding the relative speeds of the N
processes.
4. There are many commands. Write the method through which these
commands can communicate with each other. 3 marks
5. Write Difference between SJF and Shortest Remaining Time First
Scheduling algorithm. 3 marks
Sjf algorithm is associated with each process the length of the next
latter‟s cpu brust. When the cpu is available, it is assigned to the
process that has the smallest next cpu brust.
While in srtf scheduling algorithm preempts the currently executing
process, wheres a non-preemptive sjf algorithm will allow the
coureently raunning process to finish its cpu brust.
6. Write formula for calculating waiting time in preemptive Shortest Job
First Algorithm. 2 marks
Average waiting time: (0+24+27)/3 = 17
7. Define race condition and how prevent this condition. 2 marks
A situation, in which many process access and manipulate the same data concurrently and the
outcomes of the manipulation depends on the particular order in which the access takes place, is
called race condition. To prevent this condition we required synchronization of the process.

Total 23 Questions
www.vustudents.ning.com
MCQs 16
1. List and define the different metrics by which might evaluate a
scheduler (List at least 4). 5 marks
2. Write brief the multilevel feedback queue scheduling. 5 marks
3. Assumption made while formulating a solution to the critical
section problem. 2 marks
4. There are many commands. Write the method through which
these commands can communicate with each other. 3 marks
5. Write Difference between SJF and Shortest Remaining Time First
Scheduling algorithm. 3 marks
6. Write formula for calculating waiting time in preemptive Shortest
Job First Algorithm. 2 marks
7. Define race condition and how prevent this condition. 2 marks

1.Analyze the given algorithm proposed to solve the critical section problem.
Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)
: 5marks

2.List and define the different metrics by which we might evaluate a scheduler
(list at least 4)
5marks

3. How can you differentiate between a library call and a system call? Explain
briefly giving at least one example.
3marks
The library function executes the instruction following trap; interprets the return
values from the kernel and returns to the user process.

The operating system determines which system call is to be carried out by


examining one of the parameters (the call number) passed to it by library routine.

4. Define the terms "Bounded Waiting" and "Progress" with respect to Critical
Section Problem. (3 marks)
Bounded Waiting :
There exists a bound on the number of times that other processes are allowed to enter
their critical sections after a process has made a request to enter its critical section and
before that request is granted.
Progress :
If no process is executing in its critical section and some processes wish to enter their
critical sections, then only those processes that are not executing in their remainder
section can participate in the decision on which will enter its critical section next, and
this selection cannot be postponed indefinitely.
www.vustudents.ning.com

5. How can you differentiate between the fifo and pipe?(2 marks)

6. There are number of commands in Linux/Unix. Write the method through


which these commands can communicate with each other?
(2 marks)
***
3 Questions of 2 marks:
1) What assumptions should be kept in mind while formulating a
solution to critical section problem
2) Differentiate between independent processes and cooperative
processes
3) Differentiate between fifo and pipe

2 Questions of 2 marks:
1) What are the three requirements for the solution of critical
section problems
2) mkfifo() call may fail due to many reason. Describe the situations
in which mkfifo() command will terminate and also describe the
situations in which the mkfifo() command will not terminate

2 Questions of 5 marks:
1) What are the advantages of Round Ribon scheduling algorithm and
what are the disadvantages of this scheduling algorithm
2) Highlight the shortcoming in the following hardware solution
do
{
while(testandset(lock));
critical section
lock=false;
remainder section
}while(1);

__________ integer shows the highest priority of a process in CPU


scheduling.

3. Small
4. Large

The process of switching from one process to another is called latency.


3. True
4. False

Batch programs are usually __________ programs.

5. interactive
6. Non-interactive
www.vustudents.ning.com
7. Fore ground
8. Preemptive

___________ is used in real time operating systems.

5. Non-preemptive scheduling
6. Preemptive scheduling
7. Dispatching scheduling
8. FCFS scheduling

The procedure “The time at which the process finished working MINUS the
arrival time of the process MINUS CPU burst for that process” will help
calculate the _________.

5. Non-preemptive Shortest Job First scheduling


6. Preemptive Shortest Job First scheduling.
7. FCFS
8. RR Scheduling

The priorities of processes in the __________ group remain fixed.

3. Kernel
4. User

First _______ entries in Per Process File Descriptor Table are used as soon
as the process is created.

 1
 2
 3
 4

_____________ is a preemptive scheduling algorithm.

5. First Come First Serve


6. Shortest Job First
7. Round Robin
8. None of these

_______________ scheduling algorithm can be preemptive or non-


preemptive.

5. First Come First Serve


6. Shortest Job First
7. Round Robin
8. Priority
www.vustudents.ning.com
Cooperating processes never share any data, code, memory or state.
3. True
4. False

When process opens its first file explicitly it will get descriptor number _________
 1
 2
 3
 4

Taking the CPU from one process and giving the CPU to another process is termed
as
5. Context switching
6. Dispatching
7. Swapping
8. Tracking

The correct command for compiling C program named program.c in Linux


environment is
5. gcc program.c –o FirstPrgram
6. gcc –o FirstProgram program.c
7. gcc –z FirstProgram program.c
8. gcc program.c –m FirstPrgram

All Threads within a process share the _________ address space.


Select correct option:

Same
Different

The scheduling of _____________ are done by the operating system.


Select correct option:

Kernel threads

User level threads

Both Kernel and User Level thread

None of the give option


Kernel threads are supported directly by the operating system. The kernel performs the
scheduling, creation, and management in

------ Command displays the status of a process.


Select correct option:

ls

ps
www.vustudents.ning.com
gcc

cat

In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:

6. File

7. Screen

8. Printer

9. Scanner
10.

The priority of a process can be changed using __________ command.


Select correct option:

5. nice

6. cmd

7. cat

8. grep

---------displays information about the top processes.


Select correct option:

ls
cs
top
cd
___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.

5. Little’s Formula

6. Deterministic Modeling

7. Queuing Theory

8. Queuing analysis

The process id returned to the child process after successful fork system call
execution is ______.
www.vustudents.ning.com
 0
 1
 2
 3

The nice value helps in assigning ______ to a process.


Select correct option:

Priority

Weight

Time

Scheduling

Round Robin algorithm is similar to _____________ scheduling but preemption is added


to switch between processes.
Select correct option:

Shortest Job First


Shortest Remaining Time First

First Come First Serve


None of these

In Unix/ Linux, by default the standard input file is attached to the ___________
Select correct option:

Mouse

Keyboard

Light pen

Joystick

A major problem with priority scheduling algorithms is _________________.


Select correct option:

Deadlock
Aging
Starvation
None of these

A solution to the critical section problem must satisfy the following three requirements:
Mutual Exclusion
www.vustudents.ning.com
Progress
Bounded Waiting

Question # 9 of 10 ( Start time: 12:06:28 PM ) Total Marks: 1


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

Non-preemptive SJF

Priority Scheduling

Preemptive Shortest Job First

FCFS

When process opens its first file explicitly it will get descriptor number _________
 1
 2
 3
 4
Round Robin algorithm is most suitable for __________.
Time sharing system
Real time systems and batch systems
Running Batch programs
Expert system

If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
5. Pipe
6. Read
7. Write
8. Open

POSIX is a standard developed by ___________

Select correct option:


5. ANSI
6. IEEE
7. ISO
8. ACM

___________ is a solution to the problem of indefinite blockage of low-priority


processes.
5. Starvation
6. Deadlock
7. Aging
8. None of the these
www.vustudents.ning.com
_____ system call is used to write to a file or FIFO or any other IPC channel.
5. read
6. write
7. open
8. fork

_________________ scheduling allows a process to move between queues.

5. Round Robin
6. First Come First Serve
7. Multilevel Feedback Queue
8. Shortest Remaining Time First

MIDTERM
EXAMINATION Spring
2010
CS604- Operating Systems (Session - 3)

Time: 60 min
Marks: 40

Question No: 1 ( Marks: 1 ) - Please choose one


The hardware mechanism that enables a device to notify CPU is called an -------------

► Interrupt
► Signal
► Trap
► Process

Question No: 2 ( Marks: 1 ) - Please choose one


You can display the contents (names of files and directories) of a directory in UNIX/Linux directory
structure with the --------------- command.

►l
l
►s
► ls
► none of the given options

Question No: 3 ( Marks: 1 ) - Please choose one


The -------------- system call suspends the calling process.

► fork
► wait
► exec
► exit

Question No: 4 ( Marks: 1 ) - Please choose one


In ---------addressing, the recipient is not required to name the sender.

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

Question No: 5 ( Marks: 1 ) - Please choose one


www.vustudents.ning.com
-------- command gives a snapshot of the current processes.

► ps
► top
► who
► ls

Question No: 6 ( Marks: 1 ) - Please choose one


--------------command to resume the execution of a suspended job in the foreground

► fg
► bg
► jobs
► kill

Question No: 7 ( Marks: 1 ) - Please choose one


You can use the ------------- command to display the status of suspended and background
processes

► fg
► bg
► jobs
► kill

Question No: 8 ( Marks: 1 ) - Please choose one


You can terminate a foreground process by pressing --------------

► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options

Question No: 9 ( Marks: 1 ) - Please choose one


A time sharing system is

► Multi tasking
► Interactive
► All of these
► Multi user

Question No: 10 ( Marks: 1 ) - Please choose one


The main characteristic of a Real time system is

► Efficiency
► Large Virtual Memory
► Large secondary storage device
► Usability

Question No: 11 ( Marks: 1 ) - Please choose one


Shared libraries and kernel modules are stored in
directory
www.vustudents.ning.com
► /bin
► /dev
► /boot
► /lib

Question No: 12 ( Marks: 1 ) - Please choose one


scheduler selects the process from the job pool and put them in main memory.

► Long term
► Short term
► Medium term
► Swapper

Question No: 13 ( Marks: 1 ) - Please choose one


In indirect inter process communication, a sender mention the name of the recipient.

► do
► do not

Question No: 14 ( Marks: 1 ) - Please choose one


A is an integer variable that, apart from initialization is accessible only through two
standard atomic operations: wait and signal.

► Semaphore
► Monitor
► Critical region
► Critical section

Question No: 15 ( Marks: 1 ) - Please choose one


A semaphore that cause Busy-W aiting is termed as .

► Spinlock
► Monitor
► Critical region
► Critical section

Question No: 16 ( Marks: 1 ) - Please choose one


The execution of critical sections must NOT be mutually exclusive

► True
► False

Question No: 17 ( Marks: 1 ) - Please choose one


The performance of Round Robin algorithm does NOT depends heavily on the size of the time quantum.

► True
► False

Question No: 18 ( Marks: 1 ) - Please choose one


The following requirement for solving critical section problem is known as _. “There exists
a bound on the number of times that other processes are allowed to enter their critical sections after a
process has made a request to enter its critical section and before that request is granted.”

► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region

Question No: 19 ( Marks: 1 ) - Please choose one


The critical section problem can be solved by the following except

► Software based solution


www.vustudents.ning.com

► Firmware based solution


► Operating system based solution
► Hardware based solution

Question No: 20 ( Marks: 1 ) - Please choose one


_ is also called Swapper.

► Swap space
► Medium term scheduler
► Short term scheduler
► Long term scheduler

MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 1 ( Marks: 1 ) - Please choose one
I MB or 1 megabyte is equivalent to----

1024 bytes
10242 bytes (may be this)
10243 bytes
1000000 bytes

Question No: 2 ( Marks: 1 ) - Please choose one

The bottom layer in the layered approach of Operating System is-----------


Hardware

User interface
Hardware
Kernel
None of the given options

Question No: 3 ( Marks: 1 ) - Please choose one

------------has a hierarchical file system structure.

DOS
Windows
UNIX
None of the given options

Question No: 4 ( Marks: 1 ) - Please choose one

You can use the ---------command in UNIX to create a directory.


rmdir
mkdir
cp
gcc

Question No: 5 ( Marks: 1 ) - Please choose one


www.vustudents.ning.com
Files that start with a -------- in UNIX/Linux directory structure are known as hidden
files .

. (dot)
# ( hash )
/ (slash)
~ (tilt)

Question No: 6 ( Marks: 1 ) - Please choose one

The creating process is called a--------------- process while the new processes are
called the -------------- of that process

None of the given options


Children, parent
Parent, children
Zombie, single

Question No: 7 ( Marks: 1 ) - Please choose one

------------buffer places no practical limit on the size of the buffer

Bounded
Unbounded
Both Unbounded & bounded
Bounded
Unbounded
None of the given options

Question No: 8 ( Marks: 1 ) - Please choose one


The ------------ are used for communication between related or unrelated
processes on the same system or unrelated processes on different systems.

Pipes
BSD Sockets
Named pipe (FIFO)
None of the given options

Question No: 9 ( Marks: 1 ) - Please choose one

A ---------------is an abstract key for accessing a file.

File descriptor
Input Redirection
Output Redirection
FIFO

Question No: 10 ( Marks: 1 ) - Please choose one

-------- command gives a snapshot of the current processes.

ps
www.vustudents.ning.com
top
who
ls

Question No: 11 ( Marks: 1 ) - Please choose one


You can display all of the signals supported by your system, along with their
numbers, by using the -----------command

<Ctrl-A>
fg
jobs
kill -l

Question No: 12 ( Marks: 1 ) - Please choose one

The time it takes for the dispatcher to stop one process and start another running
is known as the-----------.

Dispatch latency
Scheduling
Context switching
None of the given options

Question No: 13 ( Marks: 1 ) - Please choose one


First-Come, First-Served (FCFS) is a --------------scheduling algorithm.

preemptive
non-preemptive
both preemptive and non- preemptive none of the given options

Question No: 14 ( Marks: 1 ) - Please choose one

The Shortest-Job-First Scheduling algorithm can be

Preemptive only
non-preemptive only
preemptive or non-preemptive.
None of the given options

Question No: 15 ( Marks: 1 ) - Please choose one

Preemptive ----------------scheduling is sometimes called shortestremaining-time-


first scheduling.

First-Come-First-Served (FCFS)
Round-Robin
Sorted Job First (SJF)
Priority

Question No: 16 ( Marks: 1 ) - Please choose one


The basic purpose of ________________is to help the users to utilize the hardware
resources for completing different tasks in a simplified manner
www.vustudents.ning.com

Operating system
Application software
All Software
All of the given

Question No: 17 ( Marks: 1 ) - Please choose one


OS helps manages the following except

Application software
Bus speed of the system
Memory
Virtual memory

Question No: 18 ( Marks: 1 ) - Please choose one


__________ scheduler selects the process from the job pool and put them in main
memory.

Long term
Short term
Medium term
Swapper

Question No: 19 ( Marks: 1 ) - Please choose one

A parent process calling __________ system call will be suspended until children process
terminates.

wait
fork
exit
exec

Question No: 20 ( Marks: 1 ) - Please choose one

n-process critical section problem can be solved by using

The bakery algorithm


Deterministing modeling
Analytic evaluation
None of above
www.vustudents.ning.com
1. Linux OS can support multiple users at a time
a) True
b) False

2. The Operating system is a layer of software between _________ and ___________.


a) hardware, software application
b) Kernel, hardware
c) Dos, Windows
d) Windows, Kernel

3. The major advantage of multi-programming system is


a) More than one jobs can be processed at a given time
b) CPU utilization can be increased
c) Jobs can be completed quickly
d) All of the options are correct

4. The main characteristic of a Real time system is


a) Efficiency
b) Large Virtual Memory
c) Large secondary storage device
d) Usability

5. Command-line interpreter is also called __________ in some operating systems.


a) Kernel
b) Shell
c) Signal
d) API

6. I/O instructions are Privileged Instructions.


a) True
b) False

7. In Linux directory structure, there is ___________ root directory.


a) 1
b) 2
c) 3
d) 4

8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
b) /boot
c) /lib
d) /sbin

9. rm and rmkdir commands are used to _____________ directory.


a) Create
b) Move
c) Remove
d) Modify

10. You can use the mv file1 file2 command to move ______________
a) file1 to file2.
b) file 2 to file 1
www.vustudents.ning.com
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct

11. Taking the CPU from one process and giving the CPU to another process is termed
as
a) Context Switching
b) Dispatching
c) Swapping
d) Tracking

13. A Process that has finished working, as well as its parent process has also finished its
execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork

14. Bounded Buffer is a buffer of ____________ size


a) variable
b) fixed

15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self

16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not

17. The returned code to the child process after successful fork system call execution is
a) 1
b) 2
c) 3
d) 0

18. If the fork system call fails, it returns


a) 1
b) -1
c) 2
d) 0

19. When a process opens its first file explicitly it will get descriptor number
_________
a) 1
b) 2
c) 3
d) 4
www.vustudents.ning.com
www.vustudents.ning.com
CS604: QUIZES

Question # 1 of 10 ( Start time: 06:17:33 PM ) Total Marks: 1


Linux uses ___________ directory to store system configuration files.
Select correct option:
/bin
/dev
/boot
/etc

Question # 2 of 10 ( Start time: 06:18:01 PM ) Total Marks: 1


OS helps manages the following except
Select correct option:
Application software
Memory
Virtual memory
Bus speed of the system

Question # 3 of 10 ( Start time: 06:18:09 PM ) Total Marks: 1


Linux OS can support multiple users at a time
Select correct option:
True
False

Question # 4 of 10 ( Start time: 06:18:17 PM ) Total Marks: 1


__________ directory includes essential system boot files including the kernel image.
Select correct option:
/bin
/boot
/dev
/etc

Question # 5 of 10 ( Start time: 06:19:17 PM ) Total Marks: 1


_______ command displays the contents of current working directory.
Select correct option:
ls
cs
mv
cp

Question # 6 of 10 ( Start time: 06:20:29 PM ) Total Marks: 1


In Linux directory structure, there is ___________ root directory.
Select correct option:
1
2
3
4

Question # 7 of 10 ( Start time: 06:20:37 PM ) Total Marks: 1


You can use the rm file1 command to __________ file1.
Select correct option:
retrieve
remove
make
modify

Question # 9 of 10 ( Start time: 06:21:25 PM ) Total Marks: 1


Linux is only single user operating system
Select correct option:
True
False

Question # 10 of 10 ( Start time: 06:21:35 PM ) Total Marks: 1


____________ command is used to change the directory.
Select correct option:
ls
www.vustudents.ning.com
cp
cd
mv

Question # 4 of 10 ( Start time: 05:08:22 PM ) Total Marks: 1


Linux uses ___________ directory to store system configuration files.
Select correct option:

/bin
/dev
/boot
/etc

Question # 6 of 10 ( Start time: 05:09:41 PM ) Total Marks: 1


DOS is a single user operating system.
Select correct option:

True
False

Question # 9 of 10 ( Start time: 05:13:20 PM ) Total Marks: 1


A program in execution is called a _______________.
Select correct option:

Command
Process
Software
Compiler

Question # 7 of 10 ( Start time: 03:08:38 PM ) Total Marks: 1


The scheduling of _____________ are done by the operating system.
Select correct option:

Kernel threads

User level threads

Both Kernel and User Level thread

None of the give option

FCFS scheduling

Question # 9 of 10 ( Start time: 03:10:59 PM ) Total Marks: 1


If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
Select correct option:

Pipe

Read
www.vustudents.ning.com
Write

Open

Question # 9 of 10 ( Start time: 03:16:35 PM ) Total Marks: 1


The correct command for compiling C program named program.c in Linux environment
is
Select correct option:

gcc program.c –o FirstPrgram


gcc –o FirstProgram program.c
gcc –z FirstProgram program.c
gcc program.c –m FirstPrgram

Question # 3 of 10 ( Start time: 03:32:20 PM ) Total Marks: 1


The process id returned to the child process after successful fork system call execution is
______.
Select correct option:

0
1
2
3

Question # 4 of 10 ( Start time: 03:33:07 PM ) Total Marks: 1


POSIX is a standard developed by ___________
Select correct option:

ANSI

IEEE

ISO

ACM

Question # 8 of 10 ( Start time: 03:33:51 PM ) Total Marks: 1


The manual pages can be read in Linux using ____ command.
Select correct option:

man

wan

desc

help

Question # 10 of 10 ( Start time: 03:34:07 PM ) Total Marks: 1


The scheduling of _____________ are done by the operating system.
Select correct option:
www.vustudents.ning.com

Kernel threads

User level threads not sure

Both Kernel and User Level thread

None of the give option

Question # 3 of 10 ( Start time: 03:36:05 PM ) Total Marks: 1


____ command display the status of a process.
Select correct option:

ls not sure

ps

gcc

cat

Question # 6 of 10 ( Start time: 03:38:03 PM ) Total Marks: 1


The correct command for compiling C program named program.c in Linux environment
is
Select correct option:

gcc program.c –o FirstPrgram


gcc –o FirstProgram program.c
gcc –z FirstProgram program.c
gcc program.c –m FirstPrgram

All Threads within a process share the _________ address space.


Select correct option:

Same

Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management. in page#71

------ command display the status of a process.


Select correct option:
ls

ps

gcc

cat

---------displays information about the top processes.


www.vustudents.ning.com
Select correct option:

ls
cs
top p # 64
cd

___________ is the basis of queuing theory which is branch of mathematics used to


analyze systems involving queues and servers.
Select correct option:

Little’s Formula p # 94

Deterministic Modeling

Queuing Theory

Queuing analysis

Question # 1 of 10 ( Start time: 11:16:32 AM )


Kernel is responsible for scheduling the user level threads.
True
False
Question # 2 of 10 ( Start time: 11:17:51 AM )
The manual pages can be read in Linux using ____ command.
Man
Wam
Help
desc

Question # 9 of 10 ( Start time: 11:25:06 AM )


The scheduling of _____________ are done by the operating system.
Kernel threads
User level threads not sure
Both
None of these

Question # 9 of 10 ( Start time: 12:06:28 PM ) Total Marks: 1


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

Non-preemptive SJF

Priority Scheduling

Preemptive Shortest Job First

FCFS

When process opens its first file explicitly it will get descriptor number _________
1
www.vustudents.ning.com
2
3
4

MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 21 ( Marks: 2 )

Define Waiting time with respect to CPU Scheduling?


Waiting time: Waiting time is the time spent waiting in the ready queue. We want
to minimize the waiting time to increase CPU efficiency.

Question No: 22 ( Marks: 3 )

True or False? (and explain): the Multi-Level Feedback Queue (MLFQ) scheduling
algorithm is the same as Shortest-Job-First.

Question No: 23 ( Marks: 5 )

What does the term ‘input redirection’ mean? Write down the basic syntax
for input, output and error redirection of UNIX/LINUX system.

Question No: 24 ( Marks: 10 )

When we use the fork( ) system call? Give three reasons for its failure. Also write the
attributes which are inherited and which are not inherited by the child process from its
parent?

Total 23 Questions

MCQs 16

1. List and define the different metrics by which might evaluate a


scheduler (List at least 4). 5 marks

2. Write brief the multilevel feedback queue scheduling. 5 marks

Ans:

This algorithm partitions the ready queue into several separate


queues.Multilevel feedback queue scheduling allows a process to move
between queues. The idea is to separate processes with different CPU
www.vustudents.ning.com
burst characteristics. If a process uses too much CPU time, it will be
moved to a lower-priority queue.

This scheme leaves I/O bound and interactive processes in the higher-
priority queues. Similarly a process that waits too long in a lower-
priority queue may be moved o a higher priority queue. This form of
aging prevents starvation.

In general, a multi-level feedback queue scheduler is defined by the


following parameters:

ƒ Number of queues

ƒ Scheduling algorithm for each queue

ƒ Method used to determine when to upgrade a process to higher


priority queue

ƒ Method used to determine when to demote a process

ƒ Method used to determine which queue a process enters when it needs


service

3. Assumption made while formulating a solution to the critical


section problem. 2 marks

Ans:

Assumption made while formulating a solution to the critical section


problem

Assume that each process executes at a nonzero speed .

No assumption can be made regarding the relative speeds of the N


processes.

4. There are many commands. Write the method through which these
commands can communicate with each other. 3 marks
www.vustudents.ning.com
copy file1 file2 ……..//to copy „file1‟ to „file2‟

5. Write Difference between SJF and Shortest Remaining Time First


Scheduling algorithm. 3 marks

6. Write formula for calculating waiting time in preemptive Shortest


Job First Algorithm. 2 marks

7. Define race condition and how prevent this condition. 2 marks

Limited Register contains the size of the process. Command-line interpreter is also called
shell in some operating system.
You can use the cp file1 file2 command to copy file1 to file2. I/O bound process spend
more time doing I/O than computation. Pipes are used for communication between
related processes on a system.

What are pros and cons of multithreading?5 marks


user threadsare supported above kernel and are implemented by a thread library at the
user level.
Kernel threads are supported directly by the operating system. In one-to-one model,
there is a kernel thread for
every user thread.

What is waiting time in context of CPU burst?2marks

Prove that SJF is an optimal scheduling?3marks


A semaphore is an integer variable that, apart from initialization is accessible only
through two standard atomic operations: wait and signal.

Q. What is the main disadvantage od semaphore?5marks

Q. About spinlock..3marks

20 MCQ's and 6 questions

1. Write data structures for bakery algorithm? (2 marks)


2. Which command is used for suspending a foreground process? (2 marks)
3. Which command is used to resume the execution of a suspended job in
the background? (3 marks)
4. Define race condition? (3 marks)
www.vustudents.ning.com
5. How to implement RR scheduling? (5 marks)
6. Highlight critical sections of this code? (5 marks)
Operating System
20 MCQ's and 6 questions

13. Write data structures for bakery algorithm? (2 marks)


14. Which command is used for suspending a foreground process? (2 marks)
15. Which command is used to resume the execution of a suspended job in the
background? (3 marks)
16. Define race condition? (3 marks)
17. How to implement RR scheduling? (5 marks)
18. Highlight critical sections of this code? (5 marks)

do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);

19. Write data structures for bakery algorithm? (2 marks)


20. Which command is used for suspending a foreground process? (2 marks)

21. Which command is used to resume the execution of a suspended job in the
background? (3 marks)
22. Define race condition? (3 marks)
23. How to implement RR scheduling? (5 marks)
24. Highlight critical sections of this code? (5 marks)

do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);

total Qs 26.
20 MCQs.
2Qs of 2 marks.
2Qs of 3 marks.
2Qs of 5 marks.
Limited Register contains the size of the

process.
Command-line interpreter is also called shell in

some operating system.


www.vustudents.ning.com
You can use the cp file1 file2 command to copy file1

to file2.
IO bound process spend more time doing IO than

computation.
Pipes are used for communication between related

processes on a system.
What are pros and cons of multithreading?5 marks
user threadsare supported above kernel and are

implemented by a thread library at the user level.


Kernel threads are supported directly by the

operating system.
Inone-to-one model, there is a kernel thread for

every user thread.


What is waiting time in context of CPU burst?2marks
Prove that SJF is an optimal scheduling?3marks
A semaphore is an integer variable that, apart

from initialization is accessible only through two

standard atomic operations: wait and signal.


Q. What is the main disadvantage od semaphore?5marks
Q. About spinlock..3marks

MIDTERM
EXAMINATION Spring
2011
CS604- Operating Systems (Session - 3)

Total 23 Questions
MCQs 16

1. List and define the different metrics by which might evaluate a scheduler (List
at least 4). 5 marks
Ans:
CPU Utilization
The percentage of time that the CPU is busy.Throughput The number of
processes completing in a unit of time..
Turnaround time The length of time it takes to run a process from initialization
totermination, including all the waiting time.Waiting time The total amount of
time that a process is in the ready queue.Response time The time between
when a process is ready to run and its next I/O request.
www.vustudents.ning.com

2.structure of Software critical section .5marks

Critical Section: A piece of code in a cooperating process in which the process may
updates shared data i.e variable, file, database, etc…. The Entry and Exist sections
comprise solution for the problem.
do
{
Entry section

critical section

Exit section

remainder section

} while(1)

3.Write formula for calculating waiting time in preemptive Shortest Job First Algorithm.
2 marks

Ans:
if Arrival time given...
Waiting Time = Turnaround-Arrival time

or if arrival time not given then..

for how much time processor will wait to take CPU thay will be ots waiting
time…..in case if Arrival time for all is ZERO then ...jis ko jis time pe pc mila
wohi us k waiting time hay ....

4.Requirements or critical section 3marks

5.IPC communication 2marks


IPC provides a mechanism to allow processes to communicate and to synchronize their
actions without sharing the same address space.

6.Open source software 2marks

These are that software whose source code is given along with application.

7.Why mfifo system call fails 3marks


www.vustudents.ning.com
Question No: 21 ( Marks: 2 )
Write the formula/ procedure for calculating the waiting time in preemptive Shortest Job
First scheduling.

Turnaround time-Burst Time-Arrival time

Question No: 22 ( Marks: 2 )


What are the common data structures in Bakery Algorithm?
The common data structures are:
boolean choosing [n];
int number[n];
Question No: 23 ( Marks: 3 )
If a process exits and there are still threads of that process running, will they continue to
run?

Yes,If a process exits and there are still threads of that process running, they will continue to
run. Higher-priority threads will run before lower-priority threads. The lowest-level
method of blocking other threads from running uses a global “thread critical”
condition. When the condition is set to true the scheduler will not schedule any
existing thread to run. However, this does not block new threads from being created
and run. Certain thread operations (such as stopping or killing a thread, sleeping in
the current thread, or raising an exception) may cause a thread to be scheduled even
when in a critical section.

Question No: 24 ( Marks: 3 )


What are the important characteristics of TestAndSet? What will be its advantage.
The important characteristic is that this instruction is executed atomically. Thus if two
TestAndSet instructions are executed simultaneously, they will be executed sequentially
in some arbitrary order.
If the machine supports TestAndSet instruction, then we can implement mutual
exclusion by declaring a Boolean variable lock, initialized to false.
Question No: 25 ( Marks: 5 )
Considering the Resource sharing feature of thread, what do you think is „resource sharing‟
an advantage of a thread or disadvantage of a thread. Explain yours answer briefly.
By default, threads share the memory and the resources of the process to which
they belong.Whereas resource sharing is one of the major advantages of
threads, it is also a disadvantage because proper synchronization is needed

between threads for accessing the shared resources (e.g., data and files).

Question No: 26 ( Marks: 5 )


Analyze the given algorithm proposed to solve the critical section problem.
Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical
section turn=j;
remainder section
} while(1)

This solution ensures mutual exclusion, that is only one process at a time can be
in its critical section. However it does not satisfy the progress requirement, since
it requires strict alternation of processes in the execution of the critical section.
For example, if
www.vustudents.ning.com
turn= =0 and P1 is ready to enter its critical section, P1 cannot do so even though
P0 may be in its remainder section. The bounded wait condition is satisfied
though, because there is an alternation between the turns of the two processes.

total 23
1x16
2x3
3x2
5x2

1.what are two problem of using processes that can be overcome by using the threads (5)
2. find the shortcomming of the given sloution of Critical Section Problem (page 106)
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);

1.how to dependent processes can communicate within a system(2-marks)


2.for which problem we make there two assumptions (2 marks)
1.Assume that each process executes at a nonzero speed
2. No assumption can be made regarding the relative speeds of the N processes
1.A system have I/o bound processes and CPU bond processes and the IO bound proceses are waiting for the CPU what is the
problem comes in mind by the above senario (3 marks)

papers is not straight forward its totally conceptual..


MCQs.. 70 % from old papers but all are conceptual....
Please Be prepared before attend the paper...

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmWmgjK

PAPER#1
Total 23 Questions
MCQs 16
1. List and define the different metrics by which might evaluate a scheduler (List at least 4). 5 marks
2. Write brief the multilevel feedback queue scheduling. 5 marks
3. Assumption made while formulating a solution to the critical section problem. 2 marks
4. There are many commands. Write the method through which these commands can communicate with each other. 3 marks
5. Write Difference between SJF and Shortest Remaining Time First Scheduling algorithm. 3 marks
6. Write formula for calculating waiting time in preemptive Shortest Job First Algorithm. 2 marks
7. Define race condition and how prevent this condition. 2 marks

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmbAcyA

PAPER#2
Question No: 17 ( Marks: 2 )
What is Convoy Effect?

Question No: 18 ( Marks: 2 )


What are the common data structures in Bakery Algorithm?

Question No: 19 ( Marks: 2 )


How a pipe can be created?

Question No: 20 ( Marks: 3 )


Define Progress and Bounded Waiting.

Question No: 21 ( Marks: 3 )


What is Starvation and how it occures

Question No: 22 ( Marks: 5 )


What are the advantages of Round Robin Scheduling Algorithm?

Question No: 23 ( Marks: 5 )


Analyze the following algorithm to solve the critical section problem and explain whether it satisfies the Mutual Exclusion
Characteristic

Flag[i] = True;
Turn = j;
do{
www.vustudents.ning.com
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmfRFni

1)

A code about test and set lock was given to highlight errors 5Marks

2)

What is starvation and what is its solution 5Marks

3)

What are common data structures in Bakery Algorithm 2Marks

4)

Difference between preemptive and Non Preemptive Algorithm 2Marks

5)

How inter process communication is done among processes 2Marks

6)

Difference between SJF and SRTF 3Marks

7)

Three queues in Multi level feed back……..3Marks

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmkHFvF

Question No: 3 ( M a r k s: 1 )
The -------------- system call suspends the calling process.

► fork
► wait
► exec
► exit

Question No: 4 ( M a r k s: 1 )
In ---------addressing, the recipient is not required to name the sender.

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

Question No: 5 ( M a r k s: 1 )
-------- command gives a snapshot of the current processes.

► ps
► top
► who
► ls

Question No: 6 ( M a r k s: 1 )
--------------command to resume the execution of a suspended job in the foreground

► fg
► bg
► jobs
► kill

Question No: 7 ( M a r k s: 1 )
You can use the ------------- command to display the status of suspended and background processes

► fg
► bg
► jobs
► kill

Question No: 8 ( M a r k s: 1 )
You can terminate a foreground process by pressing --------------

► <Ctrl-A>
www.vustudents.ning.com
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options

Question No: 9 ( M a r k s: 1 )
A time sharing system is

► Multi tasking

► Interactive

► All of these

► Multi user

Question No: 10 ( M a r k s: 1 )
The main characteristic of a Real time system is

► Efficiency

► Large Virtual Memory

► Large secondary storage device

► Usability

Question No: 11 ( M a r k s: 1 )
Shared libraries and kernel modules are stored in _____________ directory

► /bin

► /dev

► /boot

► /lib

Question No: 12 ( M a r k s: 1 )
__________ scheduler selects the process from the job pool and put them in main memory.

► Long term

► Short term

► Medium term

► Swapper

Question No: 13 ( M a r k s: 1 )
In indirect inter process communication, a sender ___ mention the name of the recipient.

► do

► do not

Question No: 14 ( M a r k s: 1 )
A ______________ is an integer variable that, apart from initialization is accessible only through two standard atomic
operations: wait and signal.

► Semaphore

► Monitor

► Critical region

► Critical section

Question No: 15 ( M a r k s: 1 )
A semaphore that cause Busy-Waiting is termed as ___________.

► Spinlock

► Monitor

► Critical region

► Critical section
www.vustudents.ning.com
Question No: 16 ( M a r k s: 1 )
The execution of critical sections must NOT be mutually exclusive

► True
► False

Question No: 17 ( M a r k s: 1 )
The performance of Round Robin algorithm does NOT depends heavily on the size of the time quantum.

► True
► False

Question No: 18 ( M a r k s: 1 )
The following requirement for solving critical section problem is known as ______________.
“There exists a bound on the number of times that other processes are allowed to enter their critical sections after a proces s
has made a request to enter its critical section and before that request is granted.”

► Progress

► Bounded Waiting

► Mutual Exclusion

► Critical Region

Question No: 19 ( M a r k s: 1 )
The critical section problem can be solved by the following except

► Software based solution

► Firmware based solution

► Operating system based solution

► Hardware based solution

Question No: 20 ( M a r k s: 1 )
___________ is also called Swapper.

► Swap space

► Medium term scheduler

► Short term scheduler

► Long term scheduler

Question No: 21 ( M a r k s: 2 )
Write the formula/ procedure for calculating the waiting time in preemptive Shortest Job First scheduling.

Question No: 22 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?

Question No: 23 ( M a r k s: 3 )
If a process exits and there are still threads of that process running, will they continue to run?

Question No: 24 ( M a r k s: 3 )
What are the important characteristics of TestAndSet? What will be its advantage.

Question No: 25 ( M a r k s: 5 )
Considering the Resource sharing feature of thread, what do you think is „resource sharing‟ an advantage of a thread or
disadvantage of a thread. Explain yours answer briefly.

Question No: 26 ( M a r k s: 5 )
Analyze the given algorithm proposed to solve the critical section problem. Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)

Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmr5hAI

CS604 Operating System Solved Paper


www.vustudents.ning.com
Midterm 2011
SPRING 2011 (12 MAY 2011)
CS604 - OPERATING SYSTEMS
Time: 60 min
M a r k s: 38

CS604 - Operating System - Question No: 1 ( M a r k s: 1 ) http://vuzs.net


Linux is a version of _______ operating system.
Select correct option:

► OS/2
► Windows
► Unix
► None of the above

CS604 - Operating System - Question No: 2 ( M a r k s: 1 ) http://vuzs.net


Current working directory can be accessed using --------- Command.
Select correct option:

►. (dot)
► # ( hash )
► / (slash)
► ~ (tilt)

CS604 - Operating System - Question No: 3 ( M a r k s: 1 ) http://vuzs.net


Mkfifo() is a _______.
Select correct option:

► System Call
► Command
► Directory
► None of Above

CS604 - Operating System - Question No: 4 ( M a r k s: 1 ) http://vuzs.net


-------- command gives a snapshot of the current processes.
Select correct option:

► ps
► top
► who
► ls

CS604 - Operating System - Question No: 5 ( M a r k s: 1 ) http://vuzs.net


Time interval when the I/O Devices are accessed is known as --------.
Select correct option:

► CPU Burst
► IO Burst
► Time Slice
► None of Above

CS604 - Operating System - Question No: 6 ( M a r k s: 1 ) http://vuzs.net


The process of switching from one process to another is called ---------------.
Select correct option:
www.vustudents.ning.com
► context switching
► scheduling
► quantum period
► latency

CS604 - Operating System - Question No: 7 ( M a r k s: 1 ) http://vuzs.net


__________ directory includes essential system boot files including the kernel
image.
Select correct option:

► /bin
► /boot
► /dev
► /etc

CS604 - Operating System - Question No: 8 ( M a r k s: 1 ) http://vuzs.net


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

► Non-preemptive SJF
► Priority Scheduling
► Preemptive Shortest Job First
► FCFS

CS604 - Operating System - Question No: 9 ( M a r k s: 1 ) http://vuzs.net


A semaphore that cause Busy-Waiting is termed as ___________.
Select correct option:

► Spinlock
► Monitor
► Critical region
► Critical section

CS604 - Operating System - Question No: 10 ( M a r k s: 1 ) http://vuzs.net


Progress and Bounded Waiting are some of the characteristics to solve the
critical section problems.
Select correct option:

► True
► False

CS604 - Operating System - Question No: 11 ( M a r k s: 1 ) http://vuzs.net


In ---------addressing, the recipient is not required to name the sender.
Select correct option:

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

CS604 - Operating System - Question No: 12 ( M a r k s: 1 ) http://vuzs.net


The execution of critical sections must NOT be mutually exclusive
Select correct option:
www.vustudents.ning.com
► True
► False

CS604 - Operating System - Question No: 13 ( M a r k s: 1 ) http://vuzs.net


A program in execution is called a _______________.
Select correct option:

► Command
► Process
► Software
► Compiler

CS604 - Operating System - Question No: 14 ( M a r k s: 1 ) http://vuzs.net


The critical section problem can be solved by the following except

► Software based solution


► Firmware based solution
► Operating system based solution
► Hardware based solution

CS604 - Operating System - Question No: 15 ( M a r k s: 1 ) http://vuzs.net


The bottom layer in the layered approach of Operating System is-----------
Select correct option:

► User interface
► Hardware
► Kernel
► None of the given options

CS604 - Operating System - Question No: 16 ( M a r k s: 1 ) http://vuzs.net


The manual pages can be read in Linux using ____ command.
Select correct option:

► man
► wan
► desc
► help

CS604 - Operating System - Question No: 17 ( M a r k s: 2 )


What is Convoy Effect?
Ans: Convoy effect is the result of mechanism in which some one has to follow
an order like the movement of a convoy. In FCFS, a process whether shorter or
smaller has to follow a queue to be assigned to a CPU. T
CS604 - Operating System - Question No: 18 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?
Ans: The common data structures are:

boolean choosing [n];

int number[n];
www.vustudents.ning.com

CS604 - Operating System - Question No: 19 ( M a r k s: 2 )


How a pipe can be created?
Ans: The pipe() system call creates a pipe and returns two file descriptors, one
for

reading and second for writing. The files associated with these

file descriptors are streams and are both opened for reading and writing.
Naturally, to use

such a channel properly, one needs to form some kind of protocol in which data
is sent

over the pipe.

CS604 - Operating System - Question No: 20 ( M a r k s: 3 )


Define Progress and Bounded Waiting.
Ans: 2. Progress

If no process is executing in its critical section and some processes wish to enter
their

critical sections, then only those processes that are not executing in their
remainder

section can participate in the decision on which will enter its critical section next,
and

this selection cannot be postponed indefinitely.

3. Bounded Waiting

There exists a bound on the number of times that other processes are allowed to
enter

their critical sections after a process has made a request to enter its critical
section and
www.vustudents.ning.com

before that request is granted.

CS604 - Operating System - Question No: 21 ( M a r k s: 3 )


What is Starvation and how it occures
Ans: A major problem with priority- scheduling algorithms is indefinite blocking
(or

starvation). A process that is ready to run but lacking the CPU can be
considered

blocked-waiting for the CPU.

CS604 - Operating System - Question No: 22 ( M a r k s: 5 )


What are the advantages of Round Robin Scheduling Algorithm?

CS604 - Operating System - Question No: 23 ( M a r k s: 5 )


Analyze the following algorithm to solve the critical section problem and explain
whether it satisfies the Mutual Exclusion Characteristic

Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)

Ans: To prove mutual exclusion, note that Pi enters its critical section only if
either

flag[j]=false or turn=i. Also, if both processes were executing in their critical


sections at

the same time, then flag[0]= = flag[1]= = true. These two observations suggest
that P0 and

P1 could not have found both conditions in the while statement true at the same
time,
www.vustudents.ning.com
since the value of „turn‟ can either be 0 or 1. Hence only one process say P0
must have

successfully exited the while statement. Hence mutual exclusion is preserved.

paper of CS604.

16 multiple choices of 1 marks


3 questions of 2 marks
2 question of 3 marks
2 questions of 5 marks.

Regards,

mc080403856
http://vusr.net
My today cs604 paper _____ dated: 16-05-11

1. define throughput
2. write priority formula
3. write a swap function
4. when mkfifo call fails
5. pros and cons of Round robin algorithm
6. coding wala aik q tha coding d hoi thi to us main se error find krne the.
7. what is command to read from input file instead of standard input file.

My today cs604 paper _____ dated: 16-05-11

1. define throughput
2. write priority formula
3. write a swap function
4. when mkfifo call fails
5. pros and cons of Round robin algorithm
6. coding wala aik q tha coding d hoi thi to us main se error find krne the.
7. what is command to read from input file instead of standard input file.
8. MIDTERM EXAMINATION
SPRING 2011 (12 MAY 2011)
CS604- OPERATING SYSTEMS
Time: 60 min
Marks: 38

Question No: 1 ( Marks: 1 ) - Please choose one


Linux is a version of _______ operating system.
Select correct option:

► OS/2
► Windows
► Unix
► None of the above
www.vustudents.ning.com

Question No: 2 ( Marks: 1 ) - Please choose one


Current working directory can be accessed using --------- Command.
Select correct option:

►. (dot)
► # ( hash )
► / (slash)
► ~ (tilt)

Question No: 3 ( Marks: 1 ) - Please choose one


Mkfifo() is a _______.
Select correct option:

► System Call
► Command
► Directory
► None of Above

Question No: 4 ( Marks: 1 ) - Please choose one


-------- command gives a snapshot of the current processes.
Select correct option:

► ps
► top
► who
► ls

Question No: 5 ( Marks: 1 ) - Please choose one


Time interval when the I/O Devices are accessed is known as --------.
Select correct option:

► CPU Burst
► IO Burst
► Time Slice
► None of Above

Question No: 6 ( Marks: 1 ) - Please choose one


The process of switching from one process to another is called ---------------.
Select correct option:

► context switching
► scheduling
► quantum period
► latency

Question No: 7 ( Marks: 1 ) - Please choose one


__________ directory includes essential system boot files including the kernel
image.
Select correct option:

► /bin
► /boot
► /dev
www.vustudents.ning.com
► /etc

Question No: 8 ( Marks: 1 ) - Please choose one


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

► Non-preemptive SJF
► Priority Scheduling
► Preemptive Shortest Job First
► FCFS

Question No: 9 ( Marks: 1 ) - Please choose one


A semaphore that cause Busy-Waiting is termed as ___________.
Select correct option:

► Spinlock
► Monitor
► Critical region
► Critical section

Question No: 10 ( Marks: 1 ) - Please choose one


Progress and Bounded Waiting are some of the characteristics to solve the critical
section problems.
Select correct option:

► True
► False

Question No: 11 ( Marks: 1 ) - Please choose one


In ---------addressing, the recipient is not required to name the sender.
Select correct option:

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

Question No: 12 ( Marks: 1 ) - Please choose one


The execution of critical sections must NOT be mutually exclusive
Select correct option:

► True
► False

Question No: 13 ( Marks: 1 ) - Please choose one


A program in execution is called a _______________.
Select correct option:

► Command
► Process
► Software
► Compiler
www.vustudents.ning.com
Question No: 14 ( Marks: 1 ) - Please choose one
The critical section problem can be solved by the following except

► Software based solution


► Firmware based solution
► Operating system based solution
► Hardware based solution

Question No: 15 ( Marks: 1 ) - Please choose one


The bottom layer in the layered approach of Operating System is-----------
Select correct option:

► User interface
► Hardware
► Kernel
► None of the given options

Question No: 16 ( Marks: 1 ) - Please choose one


The manual pages can be read in Linux using ____ command.
Select correct option:

► man
► wan
► desc
► help

Question No: 17 ( Marks: 2 )


What is Convoy Effect?
Ans: Convoy effect is the result of mechanism in which some one has to follow
an order like the movement of a convoy. In FCFS, a process whether shorter or
smaller has to follow a queue to be assigned to a CPU. T
Question No: 18 ( Marks: 2 )
What are the common data structures in Bakery Algorithm?
Ans: The common data structures are:
9. boolean choosing [n];
10. int number[n];
11.
Question No: 19 ( Marks: 2 )
How a pipe can be created?
Ans: The pipe() system call creates a pipe and returns two file descriptors, one
for
12. reading and second for writing. The files associated with these
13. file descriptors are streams and are both opened for reading and writing.
Naturally, to use
14. such a channel properly, one needs to form some kind of protocol in which data
is sent
15. over the pipe.

Question No: 20 ( Marks: 3 )


Define Progress and Bounded Waiting.
Ans: 2. Progress
16. If no process is executing in its critical section and some processes wish
to enter their
www.vustudents.ning.com
17. critical sections, then only those processes that are not executing in their
remainder
18. section can participate in the decision on which will enter its critical
section next, and
19. this selection cannot be postponed indefinitely.
20. 3. Bounded Waiting
21. There exists a bound on the number of times that other processes are
allowed to enter
22. their critical sections after a process has made a request to enter its
critical section and
23. before that request is granted.
24.
Question No: 21 ( Marks: 3 )
What is Starvation and how it occures
Ans: A major problem with priority- scheduling algorithms is indefinite blocking
(or
25. starvation). A process that is ready to run but lacking the CPU can be considered
26. blocked-waiting for the CPU.

Question No: 22 ( Marks: 5 )


What are the advantages of Round Robin Scheduling Algorithm?

Question No: 23 ( Marks: 5 )


Analyze the following algorithm to solve the critical section problem and explain
whether it satisfies the Mutual Exclusion Characteristic

Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
27. Ans: To prove mutual exclusion, note that Pi enters its critical section only if
either
28. flag[j]=false or turn=i. Also, if both processes were executing in their critical
sections at
29. the same time, then flag[0]= = flag[1]= = true. These two observations suggest
that P0 and
30. P1 could not have found both conditions in the while statement true at the same
time,
31. since the value of „turn‟ can either be 0 or 1. Hence only one process say P0 must
have
32. successfully exited the while statement. Hence mutual exclusion is preserved.

Today's CS604 operating system paper

Total 23 Questions
MCQs 16
www.vustudents.ning.com
1. List and define the different metrics by which might
evaluate a scheduler (List at least 4). 5 marks

2.structure of Software critical section .5marks

3.Write formula for calculating waiting time in preemptive


Shortest Job First Algorithm. 2 marks

4.Requirements or critical section 3marks


5.IPC communication 2marks
6.Open source software 2marks
7.Why mfifo system call fails 3marks

www.vustudents.ning.com
MIDTERM
EXAMINATION
Spring 2010
CS604- Operating Systems (Session - 3)

Time: 60 min
Marks: 40

Question No: 1 ( Marks: 1 ) - Please choose one


The hardware mechanism that enables a device to notify CPU is called an -------------

► Interrupt
► Signal
► Trap
► Process

Question No: 2 ( Marks: 1 ) - Please choose one


You can display the contents (names of files and directories) of a directory in
UNIX/Linux directory structure with the --------------- command.


II
►s
► ls
► none of the given options

Question No: 3 ( Marks: 1 ) - Please choose one


The -------------- system call suspends the calling process.
www.vustudents.ning.com
► fork
► wait
► exec
► exit

Question No: 4 ( Marks: 1 ) - Please choose one


In ---------addressing, the recipient is not required to name the sender.

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

Question No: 5 ( Marks: 1 ) - Please choose one


-------- Command gives a snapshot of the current processes.

► ps
► top
► who
► ls

Question No: 6 ( Marks: 1 ) - Please choose one


--------------command to resume the execution of a suspended job in the foreground

► fg
► bg
► jobs
► kill

Question No: 7 ( Marks: 1 ) - Please choose one


You can use the ------------- command to display the status of suspended and
background processes

► fg
► bg
► jobs
► kill

Question No: 8 ( Marks: 1 ) - Please choose one


You can terminate a foreground process by pressing --------------

► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options

Question No: 9 ( Marks: 1 ) - Please choose one


A time sharing system is

► Multi tasking
► Interactive
► All of these
► Multi user

Question No: 10 ( Marks: 1 ) - Please choose one


www.vustudents.ning.com
The main characteristic of a Real time system is

► Efficiency
► Large Virtual Memory
► Large secondary storage device
► Usability

Question No: 11 ( Marks: 1 ) - Please


choose one
Shared libraries and kernel modules are
stored in directory
www.vustudents.ning.com
► /bin
► /dev
► /boot
► /lib

Question No: 12 (Marks: 1) - Please choose one


__________ Scheduler selects the process from the job pool and put them in main memory.

► Long term
► Short term
► Medium term
► Swapper
Question No: 13 (Marks: 1 ) - Please choose one
In indirect inter process communication, a sender mention the name of the recipient.

► Do
► do not

Question No: 14 (Marks: 1) - Please choose one


A ________is an integer variable that, apart from initialization is accessible only through
two standard atomic operations: wait and signal.

► Semaphore
► Monitor
► Critical region
► Critical section

Question No: 15 (Marks: 1 ) - Please choose one


A semaphore that cause Busy-Waiting is termed as .

► Spin lock
► Monitor
► Critical region
► Critical section
Question No: 16 ( Marks: 1 ) - Please choose one
The execution of critical sections must NOT be mutually exclusive

► True
► False

Question No: 17 (Marks: 1 ) - Please choose one


The performance of Round Robin algorithm does NOT depends heavily on the size of the
time quantum.

► True
► False

Question No: 18 (Marks: 1 ) - Please choose one


The following requirement for solving critical section problem is known as _. “There
exists a bound on the number of times that other processes are allowed to enter their critical
sections after a process has made a request to enter its critical section and before that request
is granted.”
www.vustudents.ning.com

► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region

Question No: 19 ( Marks: 1 ) - Please choose one


The critical section problem can be solved by the following except

► Software based solution


www.vustudents.ning.com
► Firmware based solution
► Operating system based solution
► Hardware based solution

Question No: 20 ( Marks: 1 ) - Please choose one


_ is also called Swapper.

► Swap space
► Medium term scheduler
► Short term scheduler
► Long term scheduler

MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 1 ( Marks: 1 ) - Please choose one
I MB or 1 megabyte is equivalent to----

1024 bytes
10242 bytes (may be this)
10243 bytes
1000000 bytes

Question No: 2 ( Marks: 1 ) - Please choose one

The bottom layer in the layered approach of Operating System is-----------

User interface
Hardware
Kernel
None of the given options

Question No: 3 ( Marks: 1 ) - Please choose one

------------has a hierarchical file system structure.

DOS
Windows
UNIX
None of the given options

Question No: 4 ( Marks: 1 ) - Please choose one


www.vustudents.ning.com
You can use the ---------command in UNIX to create a directory.
rmdir
mkdir
cp
gcc

Question No: 5 ( Marks: 1 ) - Please choose one

Files that start with a -------- in UNIX/Linux directory structure are known as hidden files .

. (dot)
# ( hash )
/ (slash)
~ (tilt)

Question No: 6 ( Marks: 1 ) - Please choose one

The creating process is called a--------------- process while the new processes are called the
-------------- of that process

None of the given options


Children, parent
Parent, children
Zombie, single

Question No: 7 ( Marks: 1 ) - Please choose one

------------buffer places no practical limit on the size of the buffer

Bounded
Unbounded
Both Unbounded & bounded
None of the given options

Question No: 8 (Marks: 1 ) - Please choose one


The ------------ are used for communication between related or unrelated processes on the
same system or unrelated processes on different systems.

Pipes
BSD Sockets
Named pipe (FIFO)
None of the given options

Question No: 9 ( Marks: 1 ) - Please choose one


www.vustudents.ning.com
A ---------------is an abstract key for accessing a file.

File descriptor
Input Redirection
Output Redirection
FIFO

Question No: 10 (Marks: 1 ) - Please choose one

-------- Command gives a snapshot of the current processes.

Ps
top
Who
ls

Question No: 11 (Marks: 1 ) - Please choose one


You can display all of the signals supported by your system, along with their numbers, by
using the -----------command

<Ctrl-A>
fg
jobs
kill -l

Question No: 12 (Marks: 1) - Please choose one

The time it takes for the dispatcher to stop one process and start another running is known
as the-----------.

Dispatch latency
Scheduling
Context switching
None of the given options

Question No: 13 ( Marks: 1 ) - Please choose one


First-Come, First-Served (FCFS) is a --------------scheduling algorithm.

Preemptive
Non-preemptive
Both preemptive and non- preemptive
none of the given options
www.vustudents.ning.com
Question No: 14 (Marks: 1 ) - Please choose one

The Shortest-Job-First Scheduling algorithm can be

Preemptive only
Non-preemptive only
Preemptive or non-preemptive.
None of the given options

Question No: 15 ( Marks: 1 ) - Please choose one

Preemptive ----------------scheduling is sometimes called shortest remaining-time-first


scheduling.

First-Come-First-Served (FCFS)
Round-Robin
Sorted Job First (SJF)
Priority

Question No: 16 ( Marks: 1 ) - Please choose one


The basic purpose of ________________is to help the users to utilize the hardware
resources for completing different tasks in a simplified manner

Operating system
Application software
All Software
All of the given

Question No: 17 (Marks: 1 ) - Please choose one


OS helps manages the following except

Application software
Bus speed of the system
Memory
Virtual memory

Question No: 18 ( Marks: 1 ) - Please choose one


__________ Scheduler selects the process from the job pool and put them in main memory.

Long term
Short term
Medium term
Swapper
www.vustudents.ning.com
Question No: 20 (Marks: 1 ) - Please choose one

N-process critical section problem can be solved by using

The bakery algorithm


Determanisting modeling
Analytic evaluation
None of above

1. Linux OS can support multiple users at a time


a) True
b) False

2. The Operating system is a layer of software between _________ and ___________.


a) hardware, software application
b) Kernel, hardware
c) Dos, Windows
d) Windows, Kernel

3. The major advantage of multi-programming system is


a) More than one jobs can be processed at a given time
b) CPU utilization can be increased
c) Jobs can be completed quickly
d) All of the options are correct

5. Command-line interpreter is also called __________ in some operating systems.


a) Kernel
b) Shell
c) Signal
d) API

6. I/O instructions are Privileged Instructions.


a) True
b) False

7. In Linux directory structure, there is ___________ root directory.


a) 1
b) 2
c) 3
d) 4

8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
www.vustudents.ning.com
b) /boot
c) /lib
d) /sbin

9. rm and rmkdir commands are used to _____________ directory.


a) Create
b) Move
c) Remove
d) Modify

10. You can use the mv file1 file2 command to move ______________
a) file1 to file2.
b) file 2 to file 1
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct

11. Taking the CPU from one process and giving the CPU to another process is termed as
a) Context switching
b) Dispatching
c) Swapping
d) Tracking

12. ___________ Scheduler is also called Swapper.


a) Long term
b) Short term
c) Medium term
d) Swap space

13. A Process A that has finished working, as well as its parent process has also finished
its execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork

14. Bounded Buffer is a buffer of ____________ size


a) variable
b) fixed

15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self
www.vustudents.ning.com
16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not

17. The returned code to the child process after successful fork system call execution is
a) 1
b) 2
c) 3
d) 0

18. If the fork system call fails, it returns


a) 1
b) -1
c) 2
d) 0

20. In Unix/ Linux, by default the standard input file is attached to the ___________
a) Mouse
b) Keyboard
c) Light pen
d) Joystick
www.vustudents.ning.com
Question # 4 of 10 ( Start time: 06:18:17 PM ) Total Marks: 1
__________ directory includes essential system boot files including the kernel image.
Select correct option:
/bin
/boot
/dev
/etc

Question # 7 of 10 ( Start time: 06:20:37 PM ) Total Marks: 1


You can use the rm file1 command to __________ file1.
Select correct option:
retrieve
remove
make
modify

Question # 8 of 10 ( Start time: 06:20:54 PM ) Total Marks: 1


Shared libraries and kernel modules are stored in _____________ directory.
Select correct option:
/bin
/dev
/boot
/lib

Question # 9 of 10 ( Start time: 06:21:25 PM ) Total Marks: 1


Linux is only single user operating system
Select correct option:
True
False

Question # 10 of 10 ( Start time: 06:21:35 PM ) Total Marks: 1


____________ command is used to change the directory.
Select correct option:
ls
cp
cd
mv
www.vustudents.ning.com
Question # 6 of 10 ( Start time: 05:09:41 PM ) Total Marks: 1
DOS is a single user operating system.
Select correct option:

True
False

Question # 7 of 10 ( Start time: 05:10:58 PM ) Total Marks: 1


A time sharing system is
Select correct option:

Multi user
Multi tasking
Interactive
All of these

Question # 9 of 10 ( Start time: 05:13:20 PM ) Total Marks: 1


A program in execution is called a _______________.
Select correct option:

Command
Process
Software
Compiler

Question # 2 of 15 ( Start time: 08:26:02 PM ) Total Marks: 1


______________ is used to request the OS by the process to take an I/O or initiating
child process.
Select correct option:

System call

Interrupt

Trap

Signal

Question # 5 of 15 ( Start time: 08:30:09 PM ) Total Marks: 1


__________ commands in Linux is used to copy file
Select correct option:

ls
www.vustudents.ning.com
Cp

mv

mkdir
Question # 6 of 15 ( Start time: 08:30:46 PM ) Total Marks: 1
User mode can run the Privileged instructions.
Select correct option:

True
False
Question # 7 of 15 (Start time: 08:32:13 PM) Total Marks: 1
A parent process calling __________ system call will be suspended until children process
terminates.
Select correct option:

Wait

Fork

Exit

Exec

Question # 8 of 15 ( Start time: 08:33:42 PM ) Total Marks: 1


If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
Select correct option:

Pipe

Read

Write

Quiz Start Time: 03:05 PM Time Left 86


sec(s)

Question # 1 of 10 ( Start time: 03:05:46 PM ) Total Marks: 1


www.vustudents.ning.com
The problem with priority scheduling algorithm is ________.
Select correct option:

Deadlock
Starvation
Aging
Nice value

Quiz Start Time: 03:05 PM Time Left 87


sec(s)

Question # 2 of 10 ( Start time: 03:06:29 PM ) Total Marks: 1


___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.
Select correct option:

Little‟s Formula

Deterministic Modeling

Queuing Theory

Queuing analysis

Quiz Start Time: 03:05 PM Time Left 87


sec(s)

Question # 3 of 10 ( Start time: 03:06:41 PM ) Total Marks: 1


_________________ scheduling allows a process to move between queues.
Select correct option:

Round Robin
First Come First Serve
Multilevel Feedback Queue
Shortest Remaining Time First

Question # 4 of 10 ( Start time: 03:07:33 PM ) Total Marks: 1


Batch programs are usually __________ programs.
Select correct option:

Interactive
www.vustudents.ning.com
Non-interactive

Foreground

Preemptive

19. When a process opens its first file explicit ly it will get descriptor number
_________
a) 1
b) 2
c) 3
d) 4

Question # 6 of 10 ( Start time: 03:08:11 PM ) Total Marks: 1


Round Robin algorithm is most suitable for __________.
Select correct option:

Time sharing system

Real time systems and batch systems

Running Batch programs

Expert system

Question # 7 of 10 ( Start time: 03:08:38 PM ) Total Marks: 1


The scheduling of _____________ are done by the operating system.
Select correct option:

Kernel threads

User level threads

Both Kernel and User Level thread

None of the give option

Question # 8 of 10 ( Start time: 03:09:39 PM ) Total Marks: 1


___________ is used in real time operating systems.
Select correct option:
www.vustudents.ning.com
Non-preemptive scheduling

Preemptive scheduling

Dispatching scheduling

FCFS scheduling

Question # 9 of 10 ( Start time: 03:10:59 PM ) Total Marks: 1


If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
Select correct option:

Pipe

Read

Write

Open

Question # 10 of 10 ( Start time: 03:11:12 PM ) Total Marks: 1


The procedure “The time at which the process finished working MINUS the arrival time
of the process MINUS CPU burst for that process” will help calculate the _________.
Select correct option:

Non-preemptive Shortest Job First scheduling.

Preemptive Shortest Job First scheduling.

FCFS

RR Scheduling

Question # 1 of 10 ( Start time: 03:12:41 PM ) Total Marks: 1


The nice value helps in assigning ______ to a process.
Select correct option:

Priority

Weight

Time

Scheduling
www.vustudents.ning.com

Question # 2 of 10 ( Start time: 03:13:00 PM ) Total Marks: 1


All Threads within a process share the _________ address space.
Select correct option:

Same
Different
Question # 3 of 10 ( Start time: 03:13:33 PM ) Total Marks: 1
In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:

File

Screen

Printer

Scanner

Question # 4 of 10 ( Start time: 03:13:57 PM ) Total Marks: 1


__________ integer shows the highest priority of a process in CPU scheduling
Select correct option:

Small
Large

Question # 6 of 10 ( Start time: 03:15:33 PM ) Total Marks: 1


_________________ scheduling allows a process to move between queues.
Select correct option:

Round Robin
First Come First Serve
Multilevel Feedback Queue
Shortest Remaining Time First

Question # 7 of 10 ( Start time: 03:16:02 PM ) Total Marks: 1


__________ displays information about the top processes.
Select correct option:

ls
cs
top
cd
www.vustudents.ning.com
Question # 8 of 10 ( Start time: 03:16:09 PM ) Total Marks: 1
The priorities of processes in the __________ group remain fixed.
Select correct option:

Kernel
User

Question # 9 of 10 ( Start time: 03:16:35 PM ) Total Marks: 1


The correct command for compiling C program named program.c in Linux environment
is
Select correct option:

gcc program.c –o FirstPrgram


gcc –o FirstProgram program.c
gcc –z FirstProgram program.c
gcc program.c –m FirstPrgram

Question # 10 of 10 ( Start time: 03:16:44 PM ) Total Marks: 1


First _______ entries in Per Process File Descriptor Table are used as soon as the process
is created.
Select correct option:

1
2
3
4

Question # 3 of 10 ( Start time: 03:32:20 PM ) Total Marks: 1


The process id returned to the child process after successful fork system call execution is
______.
Select correct option:

0
1
2
3

Question # 4 of 10 ( Start time: 03:33:07 PM ) Total Marks: 1


POSIX is a standard developed by ___________
Select correct option:

ANSI
www.vustudents.ning.com
IEEE

ISO

ACM

Question # 7 of 10 ( Start time: 03:33:34 PM ) Total Marks: 1


The priority of a process can be changed using __________ command.
Select correct option:

Nice

Cmd

Cat

Grep

Question # 8 of 10 ( Start time: 03:33:51 PM ) Total Marks: 1


The manual pages can be read in Linux using ____ command.
Select correct option:

man

wan

desc

help

Question # 1 of 10 ( Start time: 03:35:26 PM ) Total Marks: 1


_____________ is a preemptive scheduling algorithm.
Select correct option:

First Come First Serve


Shortest Job First
Round Robin
None of these
www.vustudents.ning.com

Question # 3 of 10 ( Start time: 03:36:05 PM ) Total Marks: 1


____ command display the status of a process.
Select correct option:

ls

ps

gcc

cat

Question # 4 of 10 ( Start time: 03:37:30 PM ) Total Marks: 1


First _______ entries in Per Process File Descriptor Table are used as soon as the process
is created.
Select correct option:

1
2
3
4

Question # 7 of 10 ( Start time: 03:38:59 PM ) Total Marks: 1


___________ is used in real time operating systems.
Select correct option:

Non-preemptive scheduling
Preemptive scheduling

Dispatching scheduling

FCFS scheduling

Question # 10 of 10 ( Start time: 03:41:08 PM ) Total Marks: 1


_____ system call is used to write to a file or FIFO or any other IPC channel.
Select correct option:

read

write
www.vustudents.ning.com
open

fork

All Threads within a process share the _________ address space.


Select correct option:

Same
Different P # 68 not sure

Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management in ------ command display the status of a
process.
Select correct option:

ls

ps

gcc

cat

In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:

File

Screen

Printer

Scanner
___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.
Select correct option:

Little’s Formula

Deterministic Modeling

Queuing Theory
www.vustudents.ning.com
Queuing analysis

Quiz 2:-
The priorities of processes in the __________ group remain fixed.
Select correct option:

Kernel
User

Round Robin algorithm is similar to _____________ scheduling but preemption is added


to switch between processes.
Select correct option:

Shortest Job First


Shortest Remaining Time First
First Come First Serve
None of these

A major problem with priority scheduling algorithms is _________________.


Select correct option:

Deadlock
Aging
Starvation
None of these

Question # 9 of 10 (Start time: 12:06:28 PM) Total Marks: 1


________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Select correct option:

Non-preemptive SJF

Priority Scheduling

Preemptive Shortest Job First


www.vustudents.ning.com
FCFS

Question # 10 of 10 ( Start time: 12:07:53 PM ) Total Marks: 1


___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.
Select correct option:

Little‟s Formula

Deterministic Modeling

Queuing Theory

Queuing analysis

In Unix/ Linux, by default the standard output file is attached to the ___________

Select correct option:

File
Screen
Printer
Scanner

Bookmark
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
_______________ scheduling algorithm can be preemptive or non-preemptive.
First Come First Serve

Shortest Job First


Round Robin

Priority
www.vustudents.ning.com
___________ is a solution to the problem of indefinite blockage of low-priority
processes.

Starvation
Deadlock
Aging
None of the these

Question # 1 of 10 ( Start time: 11:16:32 AM )


Kernel is responsible for scheduling the user level threads.
True

Quiz 2:-
The priorities of processes in the __________ group remain fixed.
Select correct option:

Kernel
User
A Process „A‟ that has finished working but its parent process has also finished its
execution. In this state the process „A‟ will be called as _____ process.
 Child
 thread
 zombie
 fork
Cooperating processes never share any data, code, memory or state.
 True
Fasle

Question # 2 of 10 ( Start time: 05:06:16 PM ) Total Marks: 1


The basic purpose of ________________is to help the users to utilize the hardware
resources for completing different tasks in a simplified manner.
Select correct option:

Operating system

Application software

All Software

All of the given


www.vustudents.ning.com
Question # 6 of 10 ( Start time: 05:09:41 PM ) Total Marks: 1
DOS is a single user operating system.
Select correct option:

True

False

Question # 7 of 10 ( Start time: 05:10:58 PM ) Total Marks: 1


A time sharing system is
Select correct option:

Multi user

Multi tasking

Interactive

All of these

Question # 9 of 10 ( Start time: 05:13:20 PM ) Total Marks: 1


A program in execution is called a _______________.
Select correct option:

Command

Process

Software

Compiler
__________ Scheduler selects the process from the job pool and put them in main
memory.

Long term
Short term
Medium term
Swapper
www.vustudents.ning.com
The process id returned to the child process after successful fork system call execution is
______.

0
1
2
3

__________ commands in Linux helps to create a new directory.


ls
cp
mv
mkdir

____ command display the status of a process.

ls
ps
gcc
cat

Swapper is also termed as Short term scheduler.


True
False
www.vustudents.ning.com
www.vustudents.ning.com
FALSE

The main characteristic of a Real time system is


 Efficiency
 Large Virtual Memory
 Large secondary storage device
Which part of the computer system helps in managing the file and memory management
system?
 Operating System
 Device Drivers
 Application Software
 Hardware

Linux OS can support multiple users at a time


 True
 False
A time sharing system is
 Multi user
 Multi tasking
 Interactive
 All of these
______________ is used to request the OS by the process to take an I/O or initiating
 child process.
 System call
 Interrupt
 Trap
 Signal
Command-line interpreter is also called -------- in some operating systems.
 Kernel
 Shell
 Signal
 API
User mode can run the privileged instruction
 True
 False
www.vustudents.ning.com
www.vustudents.ning.com

Question # 1 of 10 ( Start time: 08:40:25 PM ) Total Marks: 1


__________ integer shows the highest priority of a process in CPU scheduling
Select correct option:

Small

True
Large

Question # 2 of 10 ( Start time: 08:41:35 PM ) Total Marks: 1


The process of switching from one process to another is called latency.
Select correct option:

True

TRUE
False

Question # 3 of 10 ( Start time: 08:43:03 PM ) Total Marks: 1


Batch programs are usually __________ programs.
Select correct option:

Interactive

Non-interactive

TRUE
www.vustudents.ning.com
Foreground

Preemptive

Question # 4 of 10 ( Start time: 08:44:21 PM ) Total Marks: 1


___________ is used in real time operating systems.
Select correct option:

Non-preemptive scheduling

Preemptive scheduling

TRUE
Dispatching scheduling

FCFS scheduling

Question # 5 of 10 ( Start time: 08:45:44 PM ) Total Marks: 1

Question # 6 of 10 ( Start time: 08:47:00 PM ) Total Marks: 1


The priorities of processes in the __________ group remain fixed.
Select correct option:

Kernel

TRUE
www.vustudents.ning.com
User

Question # 7 of 10 ( Start time: 08:47:56 PM ) Total Marks: 1


All Threads within a process share the _________ address space.
Select correct option:

Same

TRUE
Different
www.vustudents.ning.com
www.vustudents.ning.com

_______ scheduler takes the process from the ready queue and assign the CPU with the
help of Dispatcher.
 Long term
 Short term
 Medium term
 Swapper
www.vustudents.ning.com
___________ is also called Swapper.
 Long term
 Short term
 Medium term
 Swap spacE
Bounded Buffer is a buffer of ____________ size
 Variable
 Fixed
________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.

 Non-preemptive SJF
 Priority Scheduling
 Preemptive Shortest Job First
8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
b) /boot
c) /lib
d) /sbin
15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic

Question No: 1 ( Marks: 1 ) - Please choose one


Linux is a version of _______ operating system.
Select correct option:
? OS/2
? Windows
? Unix
? None of the above
Question No: 3 ( Marks: 1 ) - Please choose one
Mkfifo() is a _______.
Select correct option:
? System Call
? Command
? Directory
? None of Above
Question No: 6 ( Marks: 1 ) - Please choose one
The process of switching from one process to another is called ---------------.
Select correct option:

? context switching
? scheduling
www.vustudents.ning.com
? quantum period
? latency
A semaphore that cause Busy-Waiting is termed as ___________.
Select correct option:
? Spinlock
? Monitor
? Critical region
? Critical section
In ---------addressing, the recipient is not required to name the sender.
Select correct option:

► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options

CS604 - Operating System - Question No: 12 ( M a r k s: 1 )


The execution of critical sections must NOT be mutually exclusive
Select correct option:

► True
What is Convoy Effect?
Ans: Convoy effect is the result of mechanism in which some one has to follow an order
like the movement of a convoy. In FCFS, a process whether shorter or smaller has to
follow a queue to be assigned to a CPU. T
CS604 - Operating System - Question No: 18 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?
Ans: The common data structures are:

boolean choosing [n];

int number[n];

CS604 - Operating System - Question No: 19 ( M a r k s: 2 )


How a pipe can be created?
Ans: The pipe() system call creates a pipe and returns two file descriptors, one for

reading and second for writing. The files associated with these

file descriptors are streams and are both opened for reading and writing. Naturally, to use

such a channel properly, one needs to form some kind of protocol in which data is sent

over the pipe.


www.vustudents.ning.com
CS604 - Operating System - Question No: 20 ( M a r k s: 3 )
Define Progress and Bounded Waiting.
Ans: 2. Progress

If no process is executing in its critical section and some processes wish to enter their

critical sections, then only those processes that are not executing in their remainder

section can participate in the decision on which will enter its critical section next, and

this selection cannot be postponed indefinitely.

3. Bounded Waiting

There exists a bound on the number of times that other processes are allowed to enter

their critical sections after a process has made a request to enter its critical section and

before that request is granted.

CS604 - Operating System - Question No: 21 ( M a r k s: 3 )


What is Starvation and how it occures
Ans: A major problem with priority- scheduling algorithms is indefinite blocking (or

starvation). A process that is ready to run but lacking the CPU can be considered

blocked-waiting for the CPU.

CS604 - Operating System - Question No: 22 ( M a r k s: 5 )


What are the advantages of Round Robin Scheduling Algorithm?

CS604 - Operating System - Question No: 23 ( M a r k s: 5 )


Analyze the following algorithm to solve the critical section problem and explain whether
it satisfies the Mutual Exclusion Characteristic

Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)

Ans: To prove mutual exclusion, note that Pi enters its critical section only if either
www.vustudents.ning.com
flag[j]=false or turn=i. Also, if both processes were executing in their critical sections at

the same time, then flag[0]= = flag[1]= = true. These two observations suggest that P0
and

P1 could not have found both conditions in the while statement true at the same time,

since the value of „turn‟ can either be 0 or 1. Hence only one process say P0 must have

successfully exited the while statement. Hence mutual exclusion is preserved.

You might also like