You are on page 1of 10

CLUSTER 2

OPERATING SYSTEMS

1. What is meant by CPU scheduling?


1. CPU Scheduling is the basis of multiprogrammed operating system. By
switching the CPU among processes, the operating system can make
computers more productive.
2. What is preemptive and non preemptive scheduling?
1. CPU scheduling decisions may take place on following circumstances:

I. When a process switches from


the running state to the waiting state

II. When a process switching from


the running state to the ready state

III. When a process switches from


the waiting state to the ready state

IV. When a process terminates.

When scheduling takes place only under circumstances I and IV , we say that the
scheduling is nonpreemptive or cooperative; otherwise is preemptive.

1. List different scheduling algorithms.


2. a. First-Come, First-Served Scheduling(FCFS)

b. Shortest –Job-First Scheduling (SJF)

c. Priority Scheduling

d. Round-Robin Scheduling (RR)

e. Multi-Level Queue Scheduling

f. Multilevel Feedback-Queue Scheduling

1. Define time slice.


1. A small unit of time, called a time quantum or time slice, is defined. A
time quantum is generally from 10 to 100 milliseconds.
2. List different scheduling criteria.
a) Different scheduling criteria are: CPU utilization, Throughput, Turnaround time,
Waiting time, Response time.

1. Give disadvantages of priority scheduling.


1. Indefinite blocking or starvation
2. What is meant by turnaround time?
1. From the point of view of a particular process, the important criterion is
how long it takes to execute that process. The interval from the time of
submission of a process to the completion is the turnaround time.
Turnaround time is the sum of the periods spent waiting to get into
memory, waiting in the ready queue, executing on the CPU, and doing I/O
3. What is the use of Gantt chart? (check)
1. The Gantt chart is used to show the result of process which arrive in a
order and are served in FCFS.
4. Give examples for preemptive and non preemptive scheduling algorithms.
1. Preemptive Algorithms:

a) SJF Scheduling

b) Priority Scheduling

c) Round-Robin scheduling

Non Preemptive Algorithms

a) FCFS Scheduling

b) SJF Scheduling

c) Priority Scheduling

10. What is the use of short term scheduler?

1. Whenever the CPU becomes idle, the operating System must select one of the
processes in the ready queue to be executed. The selection process is carried out
by short-term scheduler (or CPU Scheduler)

11. What is meant by file allocation?

1.

12. List different file allocation methods.

a) Different file allocation methods are: Contiguous allocation, Linked allocation,


Indexed allocation.
13. Give the disadvantages of contiguous file allocation.

a) Dynamic storage- allocation

b) External fragmentation

c) How much space is needs for a file

14. Define external fragmentation.

1. External fragmentation exists whenever free space is broken into chunks. It


becomes a problem when the largest contiguous chunk is insufficient for a
request; storage is fragmented into a number of holes, no one of which is large
enough to store the data. Depending on the total amount of disk storage and the
average file size, external fragmentation may be major or a minor problem.

15. What is meant by compaction?

1. One solution to the problem of external fragmentation is compaction. The goal is


to shuffle the memory contents so as to place all free memory together in one
large block. Compaction is not always possible, however. If relocation is static
and is done at assembly or load time, compaction cannot be done; compaction is
possible only if relocation is dynamic and is done at execution time.

16. List the Advantages and disadvantages of Linked file allocation.

1. Advantages of Linked file allocation:

a) To create a new file

b) A write to the file causes the free-space management to find a free block,& this new
block is linked to the end of the file.

c) To read a file, we simply read blocks by following the pointer from block to block

d) No external fragmentation

e) Size of a file need not be declared when that file is created

f) A file can grow as long as free blocks are available

Disadvantages:

a) It can be used effectively only for sequential-access files.


b) To find the ith block of a file, we must start at the beginning of that file and follow
the pointers until we get the ith block

c) The space required for pointers

17. How index block can be implemented?

1. Each file has its own index block, which is an array of disk-block addresses. The
ith entry in the index block points to the ith bock of the file. The directory
contains the addresses of the index block. To find read the ith block, we use
pointer in the ith index-block entry.

18. What are single, double and triple indirect blocks?

1. Single indirect block, which is an index block containing not data but the
addresses of blocks that do contain data.
2. Double index blocks, which contains the address of a block that contains the
addresses of blocks that contain pointers to the actual data blocks.
3. Triple indirect block : the last pointer contains the addresses of a triple indirect
block

19. What is FAT?

1. FAT is File Allocation Table: A section of disk at the beginning of each volume is
set aside to contain a table. The Table has one entry for each disk block & is
indexed by block number. The FAT is used in much the same way as linked list.
The directory entry contains the block number of the first block of the file. The
table entry indexed by that block number contains the block number of the next
block in the file. This chain continues until the last block, which has a special
end-of-file value as the table rntry.

20. What is meant by cluster in Linked allocation?

A. To collect blocks into multiples, called clusters.

21. Define multiprogramming.

A. In multiprogramming systems, the running task keeps running until it performs an


operation that requires waiting for an external event (e.g. reading from a tape).
Multiprogramming systems are designed to maximize CPU usage.

22. What is MVT?

23. What is MFT?

24. What is meant by fixed size partitioning?


25. What is meant by variable size partitioning?

26. Give different directory operations.

List different file organization techniques.

1. Directory operations are: Search for a file, Create a file, Delete file, List a
directory, Rename a file, and Traverse the file system.

File organization techniques are: Sequential File Organization, Direct Access File
Organization, and Index Sequential File Organization.

27. What are the limitations of single level directory?

1. When the number of files increases or when the system has more than one user.
Since all files are in the same directory ,they must have unique names. If 2 users
call their data file test, then the unique-name is violated.

28. What are UFD and MFD?

1. UFD-user file directory: the UFDs have similar structures, but each lists only the
files of single user. When a job starts ora user logs in, the system’s master file
directory (MFD)

29. Give disadvantages of two level directories.

1. This structure effectively isolates one user from another. Isolation is an advantage
when the users are completely independent but is disadvantage when the users
want to cooperate on some task and to access one another’s files. Some systems
simply do not allow local user files to be accessed by other users.

If access is to be permitted, one user must have the ability to name a file in another user’s
directory.

30. What is meant by absolute path name? Give example.

1. An absolute path name begins at the root and follows a path down to the specified
file, giving the directory names on the path.

E.g. root/spell/mail/prt/first

31. What is meant by relative path name? Give example.

1. A relative path name defines a path from the current directory.


E.g. If the current directory is root/spell/mail, then the relative path name prt/first

32. What is the use of link in DAG?

33. Which directory structure allows sharing of files?

1. A user’s ability to access files created by other users, and ability to permit other
users to access his files.

34. What are the limitations of tree structure directories?

1.

35. What is meant by Dead Lock?

1. A process requests resources; and if the resources are not available at that time,
the process enters a waiting state. Sometimes, it has requested are held by other
waiting processes. This situation is called a deadlock.

36. List necessary conditions for Dead Lock.

1. Necessary conditions are Mutual exclusion, Hold and Wait, No preemption,


Circular wait.

37. What is the use of resource allocation Graph?

1. Deadlocks can be described more precisely in terms of a directed graph called a


system resource-allocation graph

38. What is meant by Dead Lock Avoidance?

1. Deadlock Avoidance requires that the o.s. be given in advance additional


information concerning which resources a process will request and use during
lifetime. With this additional knowledge, it can decide for each request whether
or not the process should wait. To decide whether request can be satisfied or must
be delays, the system must consider the resources currently available, the
resources currently available, the resources currently allocated to each process,
and the future requests and releases of each process.

39. Give example for safe state.-

40. Define safe and unsafe states.

41. List data structures used in Banker’s algorithm.

a) Data structures are: Available, Max, Allocation, Need


42. How to find Need Matrix?

1. Need [i][j]=Max[i][j]-Allocation[i][j]

43. What are the three actions a process does on resource?

1. Actions are:

i. Determine the new allocation


state the system would be in if the request is granted.

ii. Grant the request if the


projected state is both feasible and safe. Update allocation_resourcesj,k and total_allock
accordingly.

iii. Keep therequest pending if the


projected state is either infeasible or unsafe

44. What is meant by Dead Lock Prevention?

1. Deadlock prevention provides a set of methods for ensuring that at least one of the
necessary conditions cannot hold. These methods prevent deadlocks by
constraining how requests for resources can be made.

45. How to avoid hold and wait?

1. To ensure that the hold- and-wait condition never occurs in the system, we must
guarantee that, whenever a process requests a resource, it does not hold any other
resources.

46. What is meant by circular wait? How to avoid?

1. This condition implies existence of a cycle in a WFG or RRAG. It is a


consequence of hold-and-wait condition, which is a consequence of the non-
shareability and non-preemptibility. Hence a circular wait does not arise if any of
the other conditions does not arise.

This can be avoided by applying a validity constraint to each resource request. The
validity constraint is a Boolean function of the resource state of a requesting process. It
evaluates to false if the request may lead to a circular wait in the system. Such a request
is rejected straightaway. Or else the resource is allocated if it is available; otherwise, the
process is blocked for the resource.

47. List the methods to avoid preemption.(check)


1. Methods

a) Selecting a victim

b) Rollback

c) Starvation

48. Which types of resources need mutual exclusion?

1. Non-sharable resources

49. What is paging?

1. Paging is a memory-management schema that permits the physical address space


of a process to be noncontiguous.

50. What is the need of page replacement?

1. Loading of a new page into a page frame that previously contained another page
is called a page replacement. It becomes necessary when a page fault occurs and
no free page frame exist in memory.

51. Define Page Fault.(check)

1. While performing address translation for a logical address (pi, bi) the Memory
Management Unit (MMU) checks the valid bit of the page table entry of pi. If it
indicates that pi is not present in memory, the MMU raises an interrupt called a
page fault or a missing page interrupt. The interrupt action transfers control to the
interrupt handler, which invokes the virtual memory handler when it finds that the
interrupt is a page fault.

52. What is demand paging?

1. In demand paging, a page is loaded in memory when needed, i.e., when a logical
address generated by a process points to a page that is not present in memory. It
involves interaction between hardware and software components of the virtual
memory i.e., between MMU and the virtual memory handler.

53. Give the concept of belady’s anomaly.

1. For some page-replacement algorithms, the page-fault rate may increase as the
number of allocated frames increases. We would expect that giving more memory
to a process would improve its performance. In some early research, investigators
noticed that this assumption was not always true. Belady’s anomaly was
discovered as a result.
54. List different page replacement algorithms.

1. Algorithms are: FIFO replacement algorithm, optimal page-replacement


algorithm, Least-recently used (LRU) algorithm.

55. Give the differences between frame and page.

1. The breaking of physical memory into fixed-sized blocks is called as frames. The
breaking of logical memory into blocks of same size called as pages.

56. What is the principle of optimal page replacement?

1. Replace the page that will not be used for the longest period of time.

57. In what way LFU differ from MFU?

1. LFU requires that the page with the smallest count be replaced. MFU is based on
the argument that the page with the smallest count was probably just brought in
and has yet to be used.

58. What a page table contains?

1. The page table contains the base address of each page in physical address.

59. What is meant by virtual memory?

1. Virtual memory involves the separation of logical memory as perceived by users


from physical memory.

60. List the differences between paging and segmentation.

A. Paging is a memory-management schema that permits the physical address space of a


process to be noncontiguous. It is the separation of the user’s view of memory and the
actual physical memory. Segmentation is a memory-management scheme that supports
this user view of memory. A logical address space is a collection of segments.

61. What is internal and external fragmentation?

1. External fragmentation: arises when free memory areas existing in a system are
too small to be allocated to processes. The kernel is aware of external
fragmentation, and may be able to take some actions to relieve it. Internal
fragmentation exists when the memory allocated to a process is not fully utilized.
Internal fragmentation arises if the kernel allocates a memory area of a standard
size to a process irrespective of its request.
62. How page table can be implemented?(checks)

1. The base address is combined with the page offset to define the physical memory
address that is sent to the memory unit.

63. What is logical and physical address?

1. An address generated by the CPU is commonly referred as a logical address, the


address which is loaded into the memory-address register of the memory-is
commonly is referred to as a Physical address.

You might also like