Thursday, 14 September 2017

JANUARY 2017 - OPERATING SYSTEM QUESTION - PAPER III




JANUARY 2017 – PAPER III

OPERATING SYSTEM QUESTIONS

49. A memory management system has 64 pages with 512 bytes page size. Physical memory consists of 32 page frames. Number of bits required in logical and physical address are respectively : 

(1) 14 and 15
(2) 14 and 29
(3) 15 and 14
(4) 16 and 32

Ans:- 3

Explanation:

Always page size = frame size for minimizing the internal fragmentation.

Text Box: Number of bits for logical address = Number of bits to represent pages + Number of bits to represent bytes per page size.LOGICAL ADDRESS CALCULATION






In the above question, number of pages = 64, and 512 bytes page size.

64 = 26 . So, number of bits to represent pages = 6.

512=29. So, number of bits to represent bytes per page size = 9.

So, the number of bits for logical address = 6 + 9 = 15

PHYSICAL ADDRESS CALCULATION

Text Box: Number of bits for physical address = Number of bits to represent frames + Number of bits to represent bytes per frame size.

 


In the above question, number of page frames = 32, and frame size is the same as page size which is 512 bytes.
32 = 25. So, number of bits to represent frames = 5.

512=29. So, number of bits to represent bytes per frame size = 9.

So, the number of bits for physical address = 5 + 9 = 14.

Therefore, the number of bits required in logical and physical address are 15 and 14 respectively.

So, the correct answer is 3.












Wednesday, 13 September 2017

OPERATING SYSTEM QUESTIONS

OPERATING SYSTEMS
 DECEMBER 2004

36. Semaphores are used to :
(A)  Synchronise critical resources to prevent deadlock
(B)   Synchronise critical resources to prevent contention
(C)   Do I/O
(D)  Facilitate memory management
Ans :- A
Explanation :-
In order to understand semaphores, we should first understand the problem which it is tryig to solve. It is called “The critical-section problem”. What is “Critical-Section Problem”?. Consider a system consisting of n processes. Each process has a segment of code, called a critical section, in which the process may be changing common variables, updating a table, writing a file etc. The important thing is that, when one process is executing in its critical section, no other process is to be allowed to execute in its critical section. Thus the execution of critical sections by the processes is mutually exclusive in time.
The critical section problem is to design a protocol that the processes can use to cooperate. To overcome this difficulty, we can use a synchronization tool called  a semaphore.

37. In which of the following storage replacement strategies, is a program placed in the largest available hole in the memory?
(A) Best fit
(B)  First fit
(C)  Worst fit
(D)  Buddy
First-fit, best-fit and worst-fit are the most common strategies used to select a free hole from the set of available holes.
First-fit : allocate the first hole that is big enough.
Best-fit : Allocate the smallest hole that is big enough.
      Worst-fit : Allocate the largest hole.
Ans :- C

38. Remote computing systems involves the use of timesharing systems and :
(A) Real time processing
(B)  Batch processing
(C)  Multiprocessing
(D) All of the above
Ans:- B

39. Non modifiable procedures are called
(A) Serially usable procedures
(B)  Concurrent procedures
(C)  Reentrant procedures
(D) Topdown procedures
Ans :- C
Explanation : -
We would have guessed that it comes under the “Memory management” topic. Non modifiable procedures are referred to when a discussion on advantages of paging is done. One important advantage of paging is the possibility of sharing common code. This is particularly important in a time-sharing environment. Let us understand this with an example.
Consider a system that supports 40 users, each of whom executes a text editor. If the text editor consists of 150K of code and 50K of data space, we would need 8000K to support the 40 users. If the code is reentrant, however, it can be shared. However, each process will have its own data page.
Reentrant code also called pure code is non-self-modifying code. If the code is reentrant, then it never changes during execution. So, the correct answer for the above question is non modifiable procedures are called reentrant procedures.

40. Match the following:
(a) Disk scheduling
(1) Round robin
(b) Batch processing
(2) Scan
(C)Time sharing
(3) LIFO
(d) Interrupt processing
(4) FIFO

(A) a-3,b-4,c-2,d-1
(B)  a-4,b-2,c-2,d-1
(C)  a-2,b-4,c-1,d-3
(D) a-3,b-4,c-1,d-2
Ans:- C
Explanation :-
This is a easy question. You can first choose the obvious ones. For example, Time sharing is associated with round robin. So, C-1. But there are two options where C is matched with 1. So, let us look at other alternatives. Scan is one of the disk scheduling algorithm and so, we can match a with 2. So, batch processing matches to 4 and the last one matches d with 3. So, the correct answer is C.

JUNE 2005
36.Moving Process from main memory to disk is called :
(A)
Caching
(B)
Termination
(C)
Swapping
(D)
Interruption
Ans :- C
Explanation:-
Moving process from main memory to disk and vice versa is called swapping. Swapping is one of the memory management techniques used by the operating system. Since the size of the RAM is limited and finite, all the processes or programs to be executed cannot be made to fit in it. So the disk is also treated as an extension of the memory and is referred to as virtual memory. Moving a process from main memory to disk is called swapping.
37.The principle of Locality of reference justifies the use of :
(A)
Virtual memory
(B)
Interrupts
(C)
Cache memory
(D)
Secondary memory
Ans :- C
In computer science, locality of reference, also called the principle of locality, is the term applied to situations where the same value or related storage locations are frequently accessed. There are three basic types of locality of reference: temporal, spatial and sequential:

Temporal locality
Here a resource that is referenced at one point in time is referenced again soon afterwards.
Spatial locality
Here the likelihood of referencing a storage location is greater if a storage location near it has been recently referenced.
Sequential locality
Here storage is accessed sequentially, in descending or ascending order.

The reason locality occurs is often because of the manner in which computer programs are created. Generally, data that are related are stored in consecutive locations in storage. One common pattern in computing is that processing is performed on a single item and then the next. This means that if a lot of processing is done, the single item will be accessed more than once, thus leading to temporal locality of reference. Furthermore, moving to the next item implies that the next item will be read, hence spatial locality of reference, since memory locations are typically read in batches.

Locality often occurs because code contains loops that tend to reference arrays or other data structures by indices.

Increasing and exploiting locality of reference are common techniques for optimization. This can happen on several levels of the memory hierarchy. Paging obviously benefits from spatial locality. A cache is a simple example of exploiting temporal locality, because it is a specially designed faster but smaller memory area, generally used to keep recently referenced data and data near recently referenced data, which can lead to potential performance increases. Data in cache does not necessarily correspond to data that is spatially close in main memory; however, data elements are brought into cache one cache line at a time. This means that spatial locality is again important: if one element is referenced, a few neighbouring elements will also be brought into cache. Finally, temporal locality plays a role on the lowest level, since results that are referenced very closely together can be kept in the machine registers. Programming languages such as C allow the programmer to suggest that certain variables are kept in registers.
38.Banker’s algorithm is for.
(A)
Dead lock Prevention
(B)
Dead lock Avoidance
(C)
Dead lock Detection
(D)
Dead lock creation
Ans :- B
Explanation :- Banker’s algorithm is used for dead lock avoidance.
39.Which is the correct definition of a valid process transition in an operating system ?
(A)Wake up : Ready Running
(B)Dispatch : Ready Running
(C)Block : Ready Running
(D)Timer run out : Ready Blocked

Ans :- C

Tuesday, 13 June 2017

NOVEMBER 2017 - JRF AND NET EXAM

Hi all,

CBSE has published the notification for the conduct of the JRF and NET EXAM exam in the month of November, 2017.

Click on the following link for more details....

http://cbsenet.nic.in/CMS/Handler/FileHandler.ashx?i=File&ii=49&iii=Y

Monday, 17 April 2017

DECEMBER 2015 - PAPER III - Q NO 39

DECEMBER 2015 – PAPER III – Q.NO 39

This question is based on the concept of deadlock avoidance. In order to understand the theory behind this concept, refer to my earlier post on the same topic.

http://ugcnetsolved-computerscience.blogspot.in/2017/04/deadlock-avoidance.html

Let us try to understand the question and solve it based on the theory given above.

Consider a system with twelve magnetic tape drives and three processes p1,p2 and p3. Process p1 requires maximum ten tape drives, process p2 may need as many as four tape drives and p3 may need upto nine tape drives. Suppose that at time t1, process p1 is holding five tape drives, process p2 is holding two tape drives and process p3 is holding three tape drives. At time t1, system is in :
(1) Safe state
(2) Unsafe state
(3) Deadlocked state
(4) Starvation state

Explanation:-

Below is a table given depicting the maximum needs and current needs of each process.

MAXIMUM NEEDS CURRENT NEEDS
p0 10 5
p1 4 2
p2 9 3

Remember, there is no specific formula to solve this problem. It is more of understanding, logic and common sense for solving this.

Total number of magnetic tapes = 12

Already allocated = 10

Number of free magnetic tapes = 12 – 10 =2

From the table, we can understand that process p2 requires 2 more tapes for completion and since two tapes are free, they are allocated to process p2.

Process p2 completes its execution, and returns all the four tapes to the sytem.

So, number of free tape drives = 4.

Since process p1 is allocated 5 tape drives, but has a maximum of 10, it may then request 5 more tape drives. Since they are unavailable, process p1 must wait. Similarly, process p3 may request an additional 6 tape drives and have to wait, resulting in a deadlock. So the system is in deadlocked state.

The correct option is 3.

Sunday, 16 April 2017

DEADLOCK AVOIDANCE

Deadlock avoidance is a very important topic in operating system. So, first let us understand the basics related to deadlock.

What is a deadlock?

In a multiprogramming environment, there are several processes running concurrently. Each of these processes may compete for a limited or finite number of resources. If a process requests resource, and it is not available, then it has to wait for the resource, and so it enters into wait state. But the waiting process may never change state, because the resources they have requested are held by other waiting processes. Such a situation is called deadlock.


Safe state

A system is in a safe state if it can allocate resources to each process in some order and still avoids a deadlock.


ILLUSTRATION

Let us consider a system with 12 magnetic tape drives and 3 processes. p0,p1 and p2. Process p0 requires 10 tape drives, process p1 requires 4 tape drives and process p2 may need up to 9 tape drives. Suppose, at time t0, process p0 is holding 5 tape drives, process p1 is holding 2 tape drives and process p2 is holding 2 tape drives.

MAXIMUM NEEDS CURRENT NEEDS
p0 10 5
p1 4 2
p2 9 2
Now, the systems is in safe state. The question is, can the sequence,<p1,p0,p2> satisfy the safety condition.


EXPLANATION

TOTAL NUMBER OF TAPE DRIVES = 12

NUMBER OF FREE TAPE DRIVES = 12-9=3

p1 requires 2, allotted 2, so number of free tape drives = 1

Since p1 got its maximum need, it finishes its work and returns all the 4 tape drives.

NUMBER OF FREE TAPE DRIVES NOW = 1+4 = 5

p0 requires 5, allotted 5, so number of free tape drives = 0

Since p0 got its maximum need, it finishes its work and returns all the 10 tape drives.

NUMBER OF FREE TAPE DRIVES NOW = 10

p2 requires 7, allotted 7, and p2 also got its maximum need and it finishes its work and returns all the tape drives.
The system is in safe state if the sequence is <p1,p0,p2>.

UNSAFE STATE

Let us consider, that at time t1, process p2 requests 1 tape drive and is allotted 1 more. So, the maximum and current needs are depicted as below.

MAXIMUM NEEDS CURRENT NEEDS
p0 10 5
p1 4 2
p2 9 3

TOTAL NUMBER OF TAPE DRIVES = 12

NUMBER OF FREE TAPE DRIVES = 12 - 10=2

p1 requires 2, allotted 2, so number of free tape drives = 0

Since p1 got its maximum need, it finishes its work and returns all the 4 tape drives.

Now, neither p0 nor p2 can be allotted the rest for completion. So, the system is in unsafe state.

Let us try to solve some problems on deadlock avoidance.

JUNE 2013-PAPERIII QUESTION NO 61

An operating system using banker’s algorithm for deadlock avoidance has ten dedicated devices (of same type) and has three processes P1, P2 and P3 with maximum resource requirements of 4, 5 and 8 respectively.
There are two states of allocation of devices as follows : State 1 Processes P1 P2 P3
Devices allocated 2 3 4
State 2 Processes P1 P2 P3
Devices allocated 0 2 4
Which of the following is correct ?
(A) State 1 is unsafe and state 2 is safe.
(B) State 1 is safe and state 2 is unsafe.
(C) Both, state 1 and state 2 are safe.
(D) Both, state 1 and state 2 are unsafe.

Ans:- A

EXPLANATION:-

MAXIMUM NEEDS CURRENT NEEDS
p1 4 2
p2 5 3
p3 8 4

NUMBER OF FREE DEVICE = 10
NUMBER OF FREE DEVICE = 10-9=1
Since the number of free device is just 1, it can be allocated to any of the processes p1,p2 or p3.
p1 requires 2, as it is allocated only 2.
p2 requires 2, because it is already allocated 3 and its maximum need is 5.
p3 requires 4, because it is already allocated 4 and its maximum need is 4.
Since, none of the processes requirement can be satisified, the state 1 is in unsafe state.

MAXIMUM NEEDS CURRENT NEEDS
p1 4 0
p2 5 2
p3 8 4

Let us see whether state 2 is in safe or unsafe state.
TOTAL NUMBER OF FREE DEVICES = 10
NUMBER OF FREE DEVICE=10-6=4

Process p1 requires a maximum of 4 devices and they can be allocated, because the number of free device right now is 4. Since p1 gets its maximum need, it completes the process and returns all of the 4 devices.
Process p2 requires a maximum of 5, which can be allocated right now. p2 completes its process and returns all the 5 devices.
Process p3 requires a maximum of 8, which also can be allocated right now. So, p3 also can finish its execution successfully.
So, state 2 is in safe state So, the correct answer for the question is State 1 is in unsafe state and state 2 is in safe state which is option A.

Thursday, 12 November 2015

DECEMBER 2011 - PAPER II


36. X – = Y + 1 means

(A) X=X– Y +1
(B) X = –X – Y – 1
(C) X=–X+Y+1
(D) =X– Y – 1

Ans:-A


37. Handoff is the mechanism that

(A) transfer an ongoing call from
one base station to another
(B) initiating a new call
(C) dropping an ongoing call
(D) none of above

Ans:-A


38. Which one of the following statement is false ?

(A) Context-free languages are closed under union.
(B) Context-free languages are closed under concatenation.
(C) Context-free languages are closed under intersection.
(D) Context-free languages are closed under Kleene closure.

Ans:-C

Explanation:- CFL's are closed under union, concatenation, and Kleene closure. But not under intersection or difference. So the correct answer is option C.


39. All of the following are examples of real security and privacy risks except

(A) Hackers
(B) Spam
(C) Viruses
(D) Identify theft

Ans:-B


40. Identify the incorrect statement :

(A) The ATM adoption layer is not service dependent.
(B) Logical connections in ATM are referred to as virtual channel connections.
(C) ATM is streamlined protocol with minimal error and flow control capabilities
(D) ATM is also known as cell delays.

Ans:-A


41. Software risk estimation involves following two tasks :

(A) Risk magnitude and risk impact
(B) Risk probability and risk impact
(C) Risk maintenance and risk impact
(D) Risk development and risk impact

Ans:-B


42. The number of bits required for an IPV6 address is

(A) 16
(B) 32
(C) 64
(D) 128

Ans:-D


43. The proposition ~ q–vp is equivalent to

(A)p→q
(B) q→p
(C) p↔q
(D) p∨q

Ans:-B


44. Enterprise Resource Planning (ERP)

(A) has existed for over a decade.
(B) does not integrate well with the functional areas other than operations.
(C) is inexpensive to implement.
(D) automate and integrates the majority of business processes.

Ans:-D


45. Which of the following is false concerning Enterprise Resource Planning (ERP) ?

(A) It attempts to automate and integrate the majority of business processes.
(B) It shares common data and practices across the enterprise.
(C) It is inexpensive to implement.
(D) It provides and access information in a real-time environment.

Ans:-C


46. To compare, overlay or cross analyze to maps in GIS

(A) both maps must be in digital form
(B) both maps must be at the same equivalent scale.
(C) both maps must be on the same coordinate system
(D) All of the above

Ans:-D


47. Web Mining is not used in which of the following areas ?

(A) Information filtering
(B) Crime fighting on the internet
(C) Online transaction processing
(D) Click stream analysis.

Ans:-B


48. A telephone conference call is an example of which type of communications ?

(A) same time / same place
(B) same time / different place
(C) different time / different place
(D) different time / same place

Ans:-B


49. What is the probability of choosing correctly an unknown integer between 0 and 9 with 3 chances ?

(A) 963/1000
(B) 973/1000
(C) 983/1000
(D) 953/1000

Ans:-A

The number of nodes in a complete binary tree of height h (with roots at level 0) is equal to (A) 20 + 21 + ..... 2h
(B) 20 + 21 + ..... 2h – 1
(C) 20 + 21 + ..... 2h + 1
(D) 21 + ..... 2h + 1

Ans:-A