2 Marks Os R23
2 Marks Os R23
OPERATING SYSTEMS
Two Marks Questions with Answers
Q.1 Define operating systems.
Ans.: An operating system is a program that manages the computer hardware.
Q.2 What are the goals of OS?
Ans.:Operating system goals :
a. Execute user programs and make solving user problems easier.
b. Make the computer system convenient to use.
Q.3 List down the functions of operating systems.
Ans. : Functions of operating systems are convenience, efficiency and ability to evolve.
Q.4 What are the objective of operating systems?
Ans.: The objective of operating systems is efficient use, user convenience, ability to
evolve.
Q.5 How does an interrupt differ from trap?
Ans.: Trap is a software-generated interrupt caused either by an error or by a specific
request from a user program that an operating-system service be performed. A trap usually
results in a switch to kernel mode. Interrupt signals can cause a program to suspend itself
temporarily to service the interrupt. An interrupt is a hardware-generated signal that
changes the flow within the system.
Q.6 What are the three main purposes of an operating system?
Ans.:• To provide an environment for a computer user to execute programs on computer
hardware in a convenient and efficient manner.
• To allocate the separate resources of the computer as needed to solve the problem given.
The allocation process should be as fair and efficient as possible.
• As a control program it serves two major functions: 1) Supervision of the execution of
user programs to prevent errors and improper use of the computer and 2) Management of
the operation and control of I/O devices.
Q.7 Explain what is batch processing.
Ans. : Here jobs with similar requirements are batched together and run through the
computer as a group. Thus a batch operating system reads a stream of separate jobs, each
with its own control cards that predefine what the job does, feed the batches one after
another and send the output of each job to the appropriate destination.
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
are slaves. The master distributes tasks among the slaves and I/O is usually done by the
master only.
c. Each layer hides the existence of data structures, operations and hardware from higher-
level layer.
Q.22 Mention the purpose of system calls.
Ans.: System calls allow user-level processes to request services of the operating system.
Q.23 What is the purpose of system programs ?
Ans.:System program that provides an application programming environment on top of
the hardware.
Q.24 What are the five major categories of system calls ?
Ans.: Five main categories of system calls are File management, IPC, process
management, I/O devices management, information management.
Q.25 What is the function of system programs? Write the name of the categories in
which the system programs can be divided.
Ans.: programs provide a convenient environment for program development and
execution. System programs are divided into these categories: File management, status
management, file modification, programming language support, program loading and
execution, communications.
Q.26 What is meant by a system call ?
Ans. : System calls provide the interface between a process and the OS.
Q.27 What is dual mode operation and what is the need of it?
Ans.:• Two modes are provided by the hardware - user and kernel mode. Mode bit is
added to computer hardware to indicate the current mode. The OS is loaded and then user
process is started in user mode. When an interrupt occurs, hardware switches to kernel
mode.
• In order to ensure the proper execution of the OS, user must be able to distinguish
between the execution of OS code and user defined code.
Q.28 List out some system calls required to control the communication system.
Ans.: System calls for communication system: Open connection and close connection,
read message and write message, get hosted and get processed.
Initially, the computers made did not have an Operating system and to run each
program a different code was used. This had made the processing of data more
complex and time taking
In 1956, the first operating systems were developed by General Motors to run a
single IBM computer
It was in the 1960s that IBM had started installing OS in the devices they launched
The first version of the UNIX operating system was launched in the 1960s and was
written in the programming language C
Later on, Microsoft came up with their OS on the request of IBM
Today, all major computer devices have an operating system, each performing the
same functions but with slightly different features
Multiple people at various terminals can use a program at the same time
The main motive is to minimize the response time
4. Distributed Operating System
When two or more systems are connected to each other and one can open files
which are not present in their system but in other devices connected in the network
Its usage has now increased over the years
They use multiple central processors to serve real-time applications
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
Failure of one system does not affect the other systems connected in the network
5. Embedded Operating System
They have one main server which is connected to other client servers
All the management of files, processing of data, access to sharing files, etc. are
performed over this small network
It is also a secure operating system for working with multiple users
7. Mobile Operating System
With the advancement in the field of technology, smartphones now are released
with an Operating system.
They are designed in a manner that they can help a small device work efficiently
Q31 Define process. What is the information maintained in a PCB ?
Ans. A process is simply a program in execution. i.e. an instance of a program. execution.
PCB maintains pointer, state, process number, CPU register, PC, memory allocation etc.
Q.32 Define task control block.
Ans. TCB is also called PCB.
Q.33 What is PCB? Specify the information maintained in it.
Ans. Each process is represented in the operating system by a process control block. PCB
contains information like process state, program counter, CPU register, accounting
information etc.
Q.34 What is independent process ?
Ans. Independent process cannot affect or be affected by the execution of another process.
Q.35 Name and draw five different process states with proper definition.
Ans. Process states are new, running, waiting, ready and terminated. Fig. 2.16.1 shows
process State diagram
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
Ans. Response time is the amount of time it takes from when a request was, submitted
until the first response is produced, not output.
Q.47 Define waiting time.
Ans. Amount of time a process has been waiting in the ready queue.
Q.48 Define scheduling algorithm?
Ans. In multiprogramming systems, whenever two simultaneously in the ready state, a
choice has to be made which process to run next. The part of the OS that makes the choice
is called the scheduler and the algorithm it uses is called the scheduling algorithm.
Q.49 Define the term dispatch latency.
Time it takes for the dispatcher to stop one process and start another running.
Q.50 What is preemptive priority method?
Ans. A preemptive priority will preempt the CPU if the newly arrived process is higher
than the priority of the currently running process.
Q.51 What is medium term scheduling ?
Ans. Medium-term scheduling used especially with time-sharing systems as an
intermediate scheduling level. A swapping scheme is implemented to remove partially run
programs from memory and reinstate them later to continue where they left off.
Q.52 What is preemptive scheduling ?
Ans. Preemptive scheduling can preempt a process which is utilizing the CPU in between
its execution and give the CPU to another process.
Q.53 What is the difference between long-term scheduling and short-term scheduling
?
Ans. Long term scheduling adds jobs to the ready queue from the job queue. Short term
scheduling dispatches jobs from the ready queue to the running state.
Q.54 List out any four scheduling criteria.
Ans. Response time, throughput, waiting time and turn around time.
Q.55 Define the term 'Dispatch latency'.
Ans. Dispatch latency: Time it takes for the dispatcher to stop one process and start
another running. It is the amount of time required for the scheduler to stop one process and
start another.
Q.56 Distinguish between CPU-bounded and I/O bounded processes.
Ans.
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
Ans. A thread is a flow of execution through the process's code with its own program
counter, system registers and stack.
2. Efficient communication.
Advantages: 1. Minimize context switching time.
Q.64 What are the differences between user-level threads and kernel-level threads ?
(Refer section 2.8.3)
Ans. Pthreads refers to the POSIX standard defining an API for thread creation and
synchronization. This is a specification for thread behavior, not an implementation.
Operating system designers may implement the specification in any way they wish.
Q.70 Differentiate single threaded and multi-threaded processes.
Ans.Single-threading is the processing of one command at a time. When one thread is
paused, the system waits until this thread is resumed. In Multithreaded processes, threads
can be distributed over a series of processors to scale. When one thread is paused due to
some reason, other threads run as normal.
Q.71 Define mutual exclusion.
Ans. If a collection of processes share a resource or collection of resources, then often
mutual exclusion is required to prevent interference and ensure consistency when
accessing the resources.
Q.72 What is race condition ?
Ans. A race condition is a situation where two or more processes access shared data
concurrently and final value of shared data depends on timing.
Q.73 Define entry section and exit section.
Ans. Each process must request permission to enter its critical section. The section of the
code implementing this request is the entry section. The critical section is followed by an
exit section. The remaining code is the remainder section.
Q.74 Elucidate mutex locks with its procedure.
Ans. Mutex lock is software tools to solve the critical-section problem. A mutex lock has a
boolean variable available whose value indicates if the lock is available or not. If the lock
is available, a call to acquire() succeeds, and the lock is then considered unavailable
Q.75 What is binary semaphore?
Ans. Binary semaphore is a semaphore with an integer value that can range only between
0 and 1.
Q.76 What is semaphore? Mention its importance in operating systems.
Ans. Semaphore is an integer variable. It is a synchronization tool used to solve critical
section problem. The various hardware based solutions to the critical section problem are
complicated for application programmers to use.
Q.77 What is the meaning of the term busy waiting ?
Ans. Busy waiting means a process waits by executing a tight loop to check the
status/value of a variable.
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
Ans. A logical address does not refer to an actual existing address; rather, it refers to an
abstract address in an abstract address space. Contrast this with a physical address that
refers to an actual physical address in memory. A logical address is generated by the CPU
and is translated into a physical address by the memory management unit (MMU).
Therefore, physical addresses are generated by the
Q.92 What is address binding?
Ans. The process of associating program instructions and data to physical memory
addresses is called address binding, or relocation.
Q.93 What is memory?
Ans. Memory is a device used to store the data and instructions required for any operation.
Q.94 Explain the consequences of swapping.
Ans.
a. Context switching time is fairly high.
b. Only idle process must swap.
c. Transfer time is directly proportional to the amount of memory swapped.
d. It increase the O.S. overheads.
Q.95 What is an overlay? What is the use of it?
Ans. It allows a process to execute despite to the system having insufficient physical
memory. The idea of overlay is to keep in memory only those instructions and data that
are needed at any given time. When other instructions are needed, they are loaded into
space that was occupied previously by instructions that are no longer needed. Overlay do
not require any special support from the operating system.
Q.96 What is internal fragmentation?
Ans. Internal fragmentation exists when the smallest available block is larger than the
requested memory. It is the memory which is internal to a partition, but is not being used.
Q.99 Distinguish between internal and external fragmentation.
Ans. Internal fragmentation is the area in a region or a page that is not used by the process
it is allocated to. The space is wasted until the process terminates. External fragmentation
occurs when there is enough free space to satisfy a request for memory, but none of the
free holes between processes in memory is large enough to satisfy the request.e
Q.98 Bring out the disadvantages of fixed partition multiprogramming.
Ans. Disadvantages of fixed partition multiprogramming
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
Best fit: Take the hole that most closely matches (atleast as big as) the size of the program.
Usage efficient but slow still leads to fragmentation.
Worst fit : Take the biggest possible hole. Aims to reduce the number of little and wasted
memory holes. Still leads to fragmentation.
Q.101 Describe non-contiguous memory allocation.
Ans. For N memory blocks, the loss of 0.5 N blocks is possible due to external
fragmentation. This means that one-third of memory is not usable. But compaction is too
costly to perform regularly. External fragmentation arises because we are trying to allocate
memory contiguously. We can deal with external fragmentation if we can allow process
memory to be non-contiguous.
Q.102 What are the disadvantages of single contiguous memory allocation ?
Ans.
Disadvantages:
1. Memory is not fully utilized. 2. Poor utilization of processors.
Q.16 Define external fragmentation ?
Ans.
Total memory space exists to satisfy a request, but it is not contiguous; storage is
fragmented into a large number of small holes.
Q.103 What is a page ?
Ans. Divide logical memory into blocks of same size called pages.
Q.104 What is frame table ?
Ans. Allocation and availability of the frame information is kept in a data structure called
a frame table. Frame table has one entry for each physical page frame, indicating whether
the latter is free or allocated and if it is allocated, to which page of which process or
processes.
Q.105 Define zero level paging.
Ans. There is no paging is used. The TLB is large enough to hold all the entries which is
required for processing.
Q.106 What is the purpose of paging the page tables ?bbe
Ans. In certain situations the page tables could become large enough that by paging the
page tables, one could simplify the memory allocation problem (by ensuring that
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
everything is allocated as fixed size pages as opposed to variable sized chunks) and also
enable the swapping of portions of page table that are not currently used.
Q.107 What is a translation look aside buffer used for?
Ans.
Problem with paging is that, extra memory references to access translation tables can slow
programs down by a factor of two or three. Too many entries in translation tables to keep
them all loaded in fast processor memory. To solve this problem TLB is used. TLB is used
to store a few of the translation table entries.
Q.108 Explain what the use of a page table is and how it is used.
Ans. Use of page table,
1. It shows the frame location for each page of the process.
2. Processor uses page table to produce a physical address.
Q.109 What is page frame?
Ans. Physical memory unit is called page frame.
Q.110 Consider a logical address space of eight pages of 1024 words each, mapped
onto a physical memory of 32 frames. How many bits are there in the logical address
and in the physical address.
Ans. Addressing within a 1024-word page requires 10 bits because 1024 = 210. Since the
logical address space consists of 8 = 23 pages, the logical addresses must be 10+ 3 = 13
bits. Similary, since there are 32 = 25 physical pages, physical addresses are 5+10 15 bits
long.
Q.111 Define swap space.
Ans. Secondary 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 known as swap space.
Q.112 What do you mean by page fault?
Ans. A page fault is a trap to the software raised by the hardware when a program accesses
a page that is mapped in the virtual address space, but not loaded in
Q.113 Define TLB.
Ans.: TLB is the memory cache of the most recently used memory management unit.
Q.114 What is virtual memory? Mention its advantages.
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
Ans. Virtual memory is a technique that allows the execution of processes that are not
completely in memory. Advantage of virtual memory is that programs can be larger than
physical memory.
Q.115 Consider a memory system with a cache access time of 10ns and a memory
access time of 110ns assume the memory access time includes the time to check the
cache. If the effective access time is 10% greater than the cache access time, what is
the hit ratio H? AU CSE: May-17
Ans. Effective Access Time = H × Tcache + (1-H) × Tmemory
1.1 × Tcache = H × Tcache + (1-H) × Tmemory
1.1 × 10 = H × 10 + (1 - H) 110
11 = H × 10 + 110 - 110 × H
- 99 = -100 H
H = 99/100
H = 0.99
Q.116 What is demand paging ?
Ans. : Determines when a page should be brough into memory. Demand paging only
brings pages into main memory when a reference is made to a location on the page.
Q.117 What is optimal page replacement ?
Ans. The optimal policy selects for replacement the page that will not be used for longest
period of time.
Q.118 What is the key distinction between FIFO and optimal algorithms ?
Ans. The key distinction between FIFO and optimal algorithms is that FIFO uses the time
when a page was brought into memory; the optimal uses the time when a page is to be
used (future).
Q.119 Define a cache hit.
Ans. When the CPU refers to memory and finds a required word in cache it is termed as
cache hit.
Q.120 Define hit ratio.
Ans. The ratio of the number of hits divided by the total CPU references to memory is the
hit ratio.
Q.121 Define a miss.
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
Ans. When the CPU refers to memory and if the required word is not found in cache it is
termed as miss.
Q.122 Will optimal page replacement algorithm suffer from Belady's anomaly?
Justify your answer.
Ans. Optimal replacement never suffers from Belady's anomaly. It was always believed
that an increase in the number of page frames would always result in the same number or
fewer page faults.
Q.123 Consider the following page-reference string 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12.
How many page faults ratio would occur for the FIFO page replacement algorithm?
Assuming three is four frames.
Q.127 Define seek-time and latency time for a hard-disk (HDD) mechanism
Ans.Latency time: It is the time spent waiting for the target sector to appear under the read
and write head.
Seek time: Seek time is the time required to move the disk arm to the required
Q.128 What is the need for disk scheduling ?
Ans. For a multiprogramming system with many processes, the disk queue may often have
several pending requests. Thus, when one request is completed, the OS chooses which
pending request to service next. To reduce seek time and increase disk bandwidth, disk
scheduling is required.
Q.128 What is SCAN disk scheduling ?
Ans. The disk arm starts at one end of the disk, and moves toward the other end, servicing
requests until it gets to the other end of the disk, where the head movement is reversed and
servicing continues.
Q.129 What is trap?
Ans. A trap is a software generated interrupt caused either by an error or by a specific
request from a user program that an operating system service be performed.
Q.130 Give the various disk scheduling methods.
Ans.1. FCFS 2. SSTF 3. SCAN 4. C-SCAN 5. LOOK 6. C-LOOK.
Q.131 Define C-SCAN scheduling.
Ans.Head begins its scan toward the nearest end and works it way all the way to the end of
the system. Once it hits the bottom or top it jumps to the other end and moves in the same
direction
Q.132 Suppose that the disk rotates at 7200 RPM. What is the average rotational
latency of this disk drive?
Ans. Disk rotates at 7200 rpm which gives 120 rotations per second. One rotation = 60s /
7200 = 8.33 ms Thus, a full rotation takes 8.33 ms and the average rotational latency (a
half rotation) takes 4.167 ms.
A single-level directory in a multiuser system causes naming problems, since each file
must have a unique name.
The direct access nature of disks allows flexibility in the implementation of files. The
main problem here is how to allocate space to these files so that disk space is utilized
effectively and files can be accessed quickly. Three major methods of allocating disk
space are:
Contiguous
Linked
Indexed
Primary memory is the main memory (Hard disk, RAM) where the operating system
డాక్ టర్. కొండా శ్రీను OPERATING SYSTEMS R23 - 2 MARKS WITH ANSWERS
resides. Secondary memory can be external devices like CD, floppy magnetic discs etc.
secondary storage cannot be directly accessed by the CPU and is also external memory
storage.
Name
Type
Size
Protection
Protection mechanisms provide controlled access by limiting the types of file access that
can be made. Access is permitted or denied depending on many factors. Several different
types of operations may be controlled –
i. Read ii. Write iii. Execute iv. Append v. Delete vi. List
Since disk space is limited, we should reuse the space from deleted files for new files. To
keep track of free disk space, the system maintains a free space list. The free space list
records all free disk blocks