CS604- OPERATING SYSTEM
SOLVED SUBJECTIVE FOR FINAL EXAM
FALL SEMESTER 2012 SOLVED BY SYED M. UMAIR SAULAT MC100403250
QNo.78 Degree of multiprogramming when increased what effect is on CPU utilization? 3mar
Multi-programming increases CPU utilization by organizing jobs so that the CPU always has one to execute. The operating system keeps several jobs in memory simultaneously,
REF :: handouts Page No. 5
QNo.79 Source open software are helpful for testing algorithms as compared to pirated software?
Open source software is very often developed in a public, collaborative manner. Open source software is the most prominent example of open source development and often compared to (technically defined) user-generated content or (legally defined) open content movements
QNo.80 Hardware required for swapping, paging and demand paging? 5 marks
A process needs to be in the memory to be executed. A process, however, can be swapped temporarily out of memory to a backing store, and then brought back into memory for continued execution. Backing store is a fast disk large enough to accommodate copies of all memory images for all users; it must provide direct access to these memory images. The system maintains a ready queue of all processes whose memory images are on the backing store or in memory and are ready to run
Paging is a memory management scheme that permits the physical address space of a process to be non-contiguous. It avoids the considerable problem of fitting the various sized memory chunks onto the backing store, from which most of the previous memory-management schemes suffered. When some code fragments or data residing in main memory need to be swapped out, space must be found on the backing store. The fragmentation problems discussed in connection with main memory are also prevalent with backing store, except that access is much slower so compaction is impossible
A demand paging system is similar to a paging system with swapping. Processes reside on secondary memory (which is usually a disk).When we want to execute a process, we swap it into memory. Rather than swapping the entire process into memory, however we use a lazy swapper. A lazy swapper never swaps a page into memory unless that page will be needed. Since we are now viewing a process as a sequence of pages rather than as one large contiguous address space, use of swap is technically incorrect. A swapper manipulates entire processes, whereas a pager is concerned with the individual pages of a process. Thus the term pager is used in connection with demand paging.
REF :: handouts Page No. 158, 162,186,
QNo.80 Semaphores Algorithm? 5 marks
In this algorithm, we combine the ideas of the first two algorithms. The common data
structures used by a cooperating process are:
The structure of process Piis:
waiting[i] = true;
key = true;
while (waiting[i] && key)
key = TestAndSet(lock);
waiting[i] = false;
j = (i+1) % n;
while ((j!=i) && !waiting[j])
j = (j+1)% n;
if (j == i)
lock = false;
waiting[j] = false;
These data structures are initialized to false. To prove that the mutual exclusion requirement is met, we note that process Pican enter its critical section only if either waiting[i]= = false or key = = false. The value of key can become false only if TestAndSet is executed. The first process to execute the TestAndSet instruction will find key= =false; all others must wait. The variable waiting[i] can only become false if another process leaves its critical section; only one waiting[i] is set to false, maintaining the mutual exclusion requirement.
To prove the progress requirement is met, we note that the arguments presented for mutual exclusion also apply here, since a process exiting the critical section either sets lock to false or sets waiting[j] to false. Both allow a process that is waiting to enter its critical section to proceed.
To prove that the bounded waiting requirement is met, we note that, when a process leaves its critical section, it scans the array waiting in the cyclic ordering (i+1, i+2, …, n-1, 0, 1, …, i-1). It designates the first process it sees that is in its entry section with waiting[j]=true as the next one to enter its critical section. Any process waiting to do so will enter its critical section within n-1 turns
REF :: handouts Page No. 107, 108
QNo.81 Who generate physical address and logical address? 5 marks
An address generated by the CPU is commonly referred to as a logical address, where as an address seen by the memory unit–that is, the one loaded into the memory-address register of the memory–is commonly referred to as the physical address. In essence, logical data refers to an instruction or data in the process address space where as the physical address refers to a main memory location where instruction or data resides. 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.
REF :: handouts Page No. 153
QNo.82 Write the names of common file structures. (2)
A file has certain defined structure characteristics according to its type. A few common types of file structures are:-
REF :: handouts Page No. 215
QNo.83 Which part of compiler/assembler perform the task of taking one or more objects generated and assemble them in to a single executable program. (2)
This process generates the machine language executable code (also known as a binary image) for the give source program. To execute the binary code, it is loaded into the main memory and the CPU state is set appropriately. The whole process is shown in the following diagram.
REF :: handouts Page No. 152
QNo.84 Write the method through which Linus/Unix commands can communicate with each other. (2)
Answer $mkdir ~/courses/cs604/program
Command creates the programs directory under your ~/courses/cs604 directory.
REF :: handouts Page No. 26
QNo.85 Which term is best suited for the situation where several process access and manipulate shared data concurrently and final value of data depends which process finishes last. (3)
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.
REF :: handouts Page No. 96
QNo.86 Possible criteria to decide that which process should be terminated
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
REF :: handouts Page No. 149
QNo.87 Some times mkfifo call may be failure,write the reasons for failure if mkfifo call in Unix?
Some of the reasons for this call to fail are:
REF :: handouts Page No. 57
QNo.88 which factors are determine to choose a process for Termination?
Many factors determine which process is chosen, including:
REF :: handouts Page No. 148 , 149
QNo.89 How can you calculate size of page table, give formula? 2 marks
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 (equal to |f| based on our discussion so far).
Page table size = 16 * 5 bits
REF :: handouts Page No. 165
QNo.90 Soft links in UNIX? 3 marks
Soft links take care of all the problems inherent in hard links. They are flexible. You may have soft links to directories and across file systems. However, UNIX has to support an additional file type, the link type, and a new file is created for every link, slowing down file operations.
REF :: handouts Page No. 225
QNo.91 A code was given and question was to tell whether it satisfies mutual exclusion?
An algorithm solves the mutual exclusion problem if the following hold:
– Mutual Exclusion
In every configuration of every execution, at most one process
is in the critical section.
– No Deadlock
In every execution, if some process is in the entry section in some configuration, then there is a later configuration in which some process is in the critical section.
• Stronger Progress Property
– No lockout (starvation-free)
In every execution, if some processor is in the entry section in a configuration, then there is a later configuration in which that same processor is in the critical section
QNo.92 A diagram was given and question was In fully LRU the concept of aging is used with the algorithm. What does keep track of R-bits at each clock tick? 5 marks
R bits Page 0 Page 1 Page 2 Page 3
1110 10000000 10000000 10000000 00000000
1001 11000000 01000000 01000000 10000000
1100 11100000 10100000 00100000 01000000
1101 11110000 11010000 00010000 10100000
0010 01111000 01101000 10001000 01010000
1010 10111100 00110100 11000100 00101000
1100 11011110 10011010 01100010 00010100
0011 01101111 01001101 10110001 10001010
QNo.93 If a new process is to be loaded of size 25 k which whole size will be filled using best fit, First fit and worst fit? given hole memory location were given 20k, 15k, 40k, 60k, 10k,25k. 5 marks
QNo.94 Differentiate between logical and physical address. (5)
# It is also called as MAC address or Ethernet Address or Layer 2 address.
# This address is burnt in the network Adapter called NIC card.
# This is a 48 bit address represented in hexadecimal format.
# To find known MAC to unknown IP address we need a protocol called RARP-Reverse Address Resolution Protocol.
# This address is used inside LAN networks i.e within a single network.
# Example MAC address: 00-0d-65-ac-50-7f
# It is also called as Network address or layer 3 address.
# It is a 32 bit address represented in 4 octets.
# This address is used when two or more networks communicate with each other.
# To find unknown IP from MAC address we need a protocol called ARP-Address Resolution Protocol.
# This address has two components: Network part and Host part.
# Example IP address: 192.168.1.10
QNo.95 Identify the necessary information that must be stored in process control block during the execution of program
Each process is represented in the operating system by a process control block (PCB) – also called a task control block
Process state: The state may be new, ready, running, and waiting, halted and so on.
Program counter: The counter indicates the address of the next instruction to be executed for this process.
CPU registers: The registers vary in number and type, depending on the computer architecture. They include accumulators, index registers, stack pointers and general-purpose registers, plus any condition code information. Along with the program counter, this state information must be saved when an interrupt occurs, to allow the process to be continued correctly afterwards.
CPU Scheduling information: This information includes a process priority, pointers to scheduling queues, and any other scheduling parameters.
Memory-management information: This information may include such information such as the value of the base and limit registers, the page tables, or the segment tables, depending on the memory system used by the operating system.
Accounting information: This information includes the amount of CPU and real time used, time limits, account numbers, job or process numbers, and so on.
I/O status information: The information includes the list of I/O devices allocated to the process, a list of open files, and so on.
REF :: handouts Page No. 30
Thank you Very Much
Anything about MCQ..???
great work sir.thx