CS604 - Final Term Solved Subjective With References
CS604 - Final Term Solved Subjective With References
3.Write the method through which Linus/Unix commands can communicate with each other. (2)
4. Consider a process having its segment 15 having 5096 bytes. The process generates a logical address
(15, 3921). What page does the logical address refers to? (2)
Answer:- (Page 181)
ceiling[3921/1024]= 4 (i.e., page number 3)
1
7. Which term is best suited for the situation where several process access and manipulate shared data
concurrently and final value of data depend which process finishes last. (3)
Answer:- (Page 96)
A situation like this, 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.
2. Deadlock Avoidance: This method of handling deadlocks requires that processes give advance additional
information concerning which resources they will request and use during their lifetimes. With this information,
it may be decided whether a process should wait or not.
9. A file system must keep track of free blocks on disk. Name two schemes for doing this, and one
advantage for each (5)
Answer:- Click here for detail
Linked list of free pages supports very fast deletion: we can link a whole file onto the free list in constant time.
Bit map facilitates spatial locality optimizations in disk layout. It is also the most effecient in terms of memory
inside the OS required to find the free pages.
The list of pages with free page references in each is also space-efficient, particularly for disks that are mostly
full (the bit map takes space proportional to the size of the entire disk). Also, free page insertion and deletion
operations exhibit high locality under this scheme.
The compile time and load time binding methods generate identical logical and physical addresses, where as the
execution time binding method results in different physical and logical addresses. In this case we refer to the
logical address as the virtual address. The set of all logical addresses generated by a program form the logical
address space of a process; the set of all physical addresses corresponding to these logical addresses is a
physical address space of the process. The total size of physical address space in a system is equal to the size
of its main memory.
The run-time mapping from virtual to physical addresses is done by a piece of hardware in the CPU, called the
2
memory management unit (MMU).
11. Identify the necessary information that must be stored in process control block during the execution
of program. (5)
QNo.6 Define and briefly describe what is memory mapping system calls?
Answer:- (Page 195)
The memory mapping system calls can only support copy-on-write functionality allowing processes to share a
file in read-only mode, but to have their own copies of any data they modify. So that access to the shared data is
coordinated, the processes involved might use one of the mechanisms for achieving mutual exclusion.
In a UNIX system, mmap() system call can be used to request the operating system to memory map an opened
file.
QNo.7 What hardware is needed to support demand paging and swapping name and describe briefly?
Answer:- (Page 188)
The hardware needed to support demand paging is the same as the hardware for paging and swapping:
Page table: This table has the ability to mark an entry invalid through a valid-invalid bit or special value
of protection bits.
Secondary memory: This memory holds those pages that are not present in main memory. The
secondary memory is usually a high speed disk. It is known as the swap device, and the section of disk
used for this purpose is called the swap space.
give one advantage and one disadvantage of using large sized block (2)
Answer:- Click here for detail
advantage
Good for large rows with lots of sequential I/O
Has a lower overhead with less block headers so more room to store data
Well suited for tables with large sized rows
disadvantage
Wastes space in the buffer cache if doing random I/O to access a small number of rows
In OLTP systems can increase block contention due to more rows being stored in each block
name the steps involved in converting the source code into executable program (3)
Answer:- Rep
2. Whether the files are volatiles or non-volatile? Also comment that whether data can be written on
secondary storage if not written in file?
Answer:- (Page 214)
Files usually non-volatile, so the contents are persistent through power failures, etc. A file is a named collection
5
of related information that is recorded on secondary storage. Data cannot be written to secondary storage unless
they are within a file.
5. Do you think that FIFO is useful? Provide at least two reasons of justify your answer?
Answer:- (Page 58)
Two common uses of FIFOs are:
In client-server applications, FIFOs are used to pass data between a server process and client processes
Used by shell commands to pass data from one shell pipeline to another, without creating temporary files
7. Maximum no of pages in process address space is one million and total address size is (p + d),
process address space is 32-bit with page size 4096 bytes. Calculate no bits for page no (p) and the no of
bits required for offset (d)?
8. Is it necessary to avoid user program from get stuck in an infinite loop? Give reasons.
Answer:- (Page 11)
In addition to protecting I/O and memory, we must ensure that the operating system maintains control. We must
prevent the user program from getting stuck in an infinite loop or not calling system services and never
returning control to the CPU. To accomplish this we can use a timer, which interrupts the CPU after specified
period to ensure that the operating system maintains control.
The timer period may be variable or fixed. A fixed-rate clock and a counter are used to implement a variable
timer. The OS initializes the counter with a positive value. The counter is decremented every clock tick by the
clock interrupt service routine. When the counter reaches the value 0, a timer interrupt is generated that
transfers control from the current process to the next scheduled process. Thus we can use the timer to prevent a
program from running too long.
In the most straight forward case, the timer could be set to interrupt every N milliseconds, where N is the time
slice that each process is allowed to execute before the next process gets control of the CPU. The OS is invoked
6
at the end of each time slice to perform various housekeeping tasks.
Q4) What is the basic logic of FIFO Page Replacement Algorithm? Marks (2)
Answer:- (Page 198)
A FIFO replacement algorithm associates with each page the time when that page was brought into memory.
When a page must be replaced, the oldest page is chosen.
7
address space.
How can we calculate a size of page table? Just provide the formula?
Answer:- (Page 165)
Page table size = NP * PTES, where NP is the number of pages in the process address space and PTES is the
page table entry size.
What are three different stages/times when address can be bound to instructions and data?
Answer:- (Page 151)
compile time
load time
execution time
What is the problem hard links creates in terms of referential naming? How does one solve it?
Answer:- Click here for detail
When using hard links, we effectively create multiple names for the same data contained within a file. The
problem in managing these structures comes down to knowing when the data within the file should actually be
deleted. In particular, the data should be deleted only when the last name (or reference) is removed from the file
system. This is typically detected through the use of reference counters.
It is also possible to create cycles in the directory structure, which can lead to files and/or directories being left
on the disk without any way to get to the from the root directory. This may be solved by either not allowing
hardlinks to directories or by explicitly checking to make sure that a cycle is not created when a link is made to
a directory.
If we take an average page fault service time of 20 milliseconds and a memory access time of 100
nanoseconds, then the effective access time in nanoseconds?
Answer:- (Page 190)
Effective access time = (1-p) * (100) + p (20 milliseconds)
= (1-p) * 100 + p * 20,000,000
= 100 + 19,999,900 * p
What hardware is needed to support demand paging and swapping name and describe briefly?
Answer:- Rep
9
Let us consider a situation in which we want to communicate un related process on the same system?
Answer:- (Page 50)
The BSD sockets are used for communication between related or unrelated processes on the same system or
unrelated processes on different systems.
Out of primary and secondary storage which memory do you think is best suited to store a program
written in C language is which memory is best suited when we want to execute that program given
reasons?
1 what is mounting in the file system? and where is the mount point ?
Answer:- Rep
3 Can we increase the speed by accessing the page table in the memory compare to the CPU register
Answer:- (Page 166)
A page table base register (PTBR) is needed to point to the page table. With page table in main memory, the
effective memory access time, Teffective, is 2Tmem , which is not acceptable because it would slow down
program execution by a factor of two.
5 If we create a pipe and a pipe return a numeric value -1 what does it means?
Answer:- (Page 46)
The function returns -1 if the call fails.
7 Write one advantage and one disadvantage of using large size block
Answer:- Rep
11
Answer:- (Page 188)
The secondary memory is usually a high speed disk. It is known as the swap device, and the section of disk
used for this purpose is called the swap space.
Is starvation and deadlock are same. Accept or reject with solid reason 3 marks
Answer:- (Page 112)
A set of processes are said to be in a deadlock state if every process is waiting for an event that can be caused only
by another process in the set and Starvation is infinite blocking caused due to unavailability of resources.
If hard real-time system cannot manage output within given slot then what happen? 3marks
Answer:- (Page 7)
A real time system has well defined, fixed time constraints, and if the system does not produce output for an
input within the time constraints, the system will fail. For instance, it would not do for a robot arm to be
instructed to halt after it had smashed into the car it was building.
Q) Possible criteria to decide that which process should be terminated while dead lock detection and
recovery,
Answer:- (Page 148)
When a deadlock detection algorithm determines that a deadlock exists, several alternatives exist. One possibility is
to inform the operator that a deadlock has occurred, and to let the operator deal with the deadlock manually. The
other possibility is to let the system recover from the deadlock automatically. There are two options for breaking a
deadlock. One solution is simply to abort one or more processes to break the circular wait. The second option is to
preempt some resources from one or more of the deadlocked processes
14
Q ) what does the following command do in the LINX/UNIX operating system (P #26)
$mkdir ~/courses/cs604/program
Answer:- (Page 26)
Command creates the programs directory under your ~/courses/cs604 directory.
Q) Sometimes mkfifo call may be failure, write the reasons for failure if mkfifo call in Unix?
Answer:- (Page 26)
File with the given name already exists
Pathname too long
A component in the pathname not searchable,
Non-existent or non-directory
Destination directory is read-only
Not enough memory space available
Signal caught during the execution of mkfifo()
Q) CPU sends the user or application request to the kernel. How kernal works on the request and fulfill it.
Answer:- (Page 15)
any user or application request that involves access to any system resource must be handled by the kernel code,
but user process must not be given open access to the kernel code for security reasons.
15
CS604 – Final term Paper Spring (2011)
++++++++++++++++++++++++++++++
What is Mounting? Name two types of mounting. Give your answer with respect to File System?
Provide names of common file structures. none, Simple record structure, complex structure.
What do you think that why Main Memory is kept as a volatile memory and why not a permanent storage
device?
Summarize the tradeoffs among simple arrays, trees, and hash tables as implementations of a page table.
However, in a more general case, deadlock can occur in RR scheduling. Consider two processes and two locks.
Process A acquires lock 1 and then yields the processor to Process B. Process B then acquires lock 2 and
attempts to acquire lock 1. Because lock 1 belongs to Process A, process B will then sleep. Process A awakes
and attempts to acquire lock 2. Lock 2 still belongs to process B, so neither process can move forward and you
have a deadlock.
+++++++++++++++++++++++++
2 marks questions:
Problem occur while trying to avoid the condition of hold and wait for deadlock?
Write Disadvantages of dynamic loading?
Write name of common file structure?
Is it possible to install virtual machine on windows platform to run LINUX and how?
What Difference between outer page and inner page table?
3 marks questions:
What are the three stages/times when the address is bound to instructions and data?
Write difference between binary and counting semaphore?
If we create a pipe and a pipe return a numeric value -1 what does it means?
Will CPU utilization is decrease due to high page fault rate?
If average page fault time is 20 milliseconds and memory access time is 100 nanoseconds
Then calculate effective access time?
5 marks questions:
Explain page fault and how to handle?
Write advantages of dynamic loading?
Explain page fault frequency model how to control page thrashing?
++++++++++++++++++
FINALTERM EXAMINATION
Spring 2010
CS604- Operating Systems (Session - 4)
19
Question No: 31 ( Marks: 2 )
When a process is rolled out of memory, it loses its ability to use the CPU
(at least for a while). Describe another situation where a process loses its
ability to use the CPU, but where the process does not get rolled out.
Where the Infinite loop starts it also be the cause to suspend the CPU from
working sitution to idle stat.
the pipe system call creates a pipe and returns two file descriptors, one for
reading and second for writing.
20
Processes CPU Burst
P1 4
P2 1
P3 3
P4 2
A process is thrashing if it is spending more time paging than executing. thrashing result
in severe performance problems: low cpu utilization, high disk utilization, low utilization
of other i/o devices.
Question No: 40 ( Marks: 5 )
Summarize the tradeoffs among simple arrays, trees, and hash tables as
implementations of a page table.
FINALTERM EXAMINATION
Spring 2010
CS604- Operating Systems (Session - 4)
22
23