0% found this document useful (0 votes)
107 views11 pages

Chapter - 1

This document discusses operating system concepts related to processes, scheduling, and threads. It begins by defining key terms like bootstrap loader, system booting, microkernel, and advantages of multiprocessor systems. It then discusses process states and control blocks, scheduling algorithms like priority scheduling and round robin, and threading models like one-to-one and many-to-many. The document also covers context switching, scheduling criteria, dispatcher functions, and multilevel feedback queue scheduling.

Uploaded by

Harshada Bavale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
107 views11 pages

Chapter - 1

This document discusses operating system concepts related to processes, scheduling, and threads. It begins by defining key terms like bootstrap loader, system booting, microkernel, and advantages of multiprocessor systems. It then discusses process states and control blocks, scheduling algorithms like priority scheduling and round robin, and threading models like one-to-one and many-to-many. The document also covers context switching, scheduling criteria, dispatcher functions, and multilevel feedback queue scheduling.

Uploaded by

Harshada Bavale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 11

CHAPTER - 1

1.What is function of bootstrap loader?[1m]


• The program called bootstrap program or bootstrap loader is used to locate the
kernel and loads it into main memory and starts execution.
2.Define system boot.[1m]
• Booting the system is done by loading the kernel into main memory, and starting
its execution. The process of starting a computer by loading the kernel is known
as system booting.
3.What is the main function of microkernel?[1m]
• A Microkernel is a piece of software or even code that contains the near-
minimum amount of functions and features required to implement an operating
system.
4.Write advantages of multiprocessor system.[1m]
• It increased throughput by increasing the number of processors, more work done
.
5.Explain any two operating system components.[5m]
• A computer system is a collection of hardware and software components
designed to provide an effective tool for computation.
• The hardware consists of Central Processing Unit (CPU), memory and
Input/Output (1/0) devices which are altogether used to provide the basic
computing resources for the computer system.
• Application programs define the ways in which the system resources are used to
solve the computing problems of the users (word processor, video games,
spreadsheet
• System programs are the set of utility programs supplied with an operating
system to provide basic services for the computer users (compilers, text editors,
assembler etc.).
6.What is system call? Explain the system call for process and job control.[3m]
• A system call is the programmatic way in which a computer program requests a
service from the kernel of the operating system on which it is executed.
• Process Control: These system calls deal with processes. Process is nothing but
program in execution. Some examples of these system calls are end, abort, load,
execute, create new, process, terminate process, setting and retrieving process
attribute etc
8.Write the advantages of microkernel.[2m]
• The microkernel structure provides high security and reliability.
• (ii) Extending of operating system is easier, since all new services are added to
user space and kernel modification is not required.
CHAPTER - 2
1. List any two examples of many to many model. [1m]
• Solaris 2, IRIX, HP-UX and Tru64 UNIX support many to many thread model.

2. Explain PCB with proper diagram. [5m]


• Each process is represented in the operating system by a Process Control Block (PCB)
also called as Task Control Block (TCB).
• The operating system groups all information that needs about a particular process into
a data structure called a PCB or process descriptor
• The PCB is a data structure with fields for recording the various aspects of process
execution and the usage of resources.

3. Write a primary function of medium term scheduler.[1m]

• It selects those processes which are ready to execute.


4. State Scalability and Responsiveness benefits of multithreading. [1m]
• Program responsiveness allows a program to run even if part of it is blocked using
multithreading. This can also be done if the process is performing a lengthy operation.
For example, a web browser with multithreading can use one thread for user contact
and another for image loading at the same time.
5. State two benefits of multi-threaded programming. [1m]
• 1. Many threads can be created as per user's requirement.
• 2. Provides the best accuracy on concurrency.

6. What is process? State and explain in brief different types of process states. [5m]
• A process is defined as, an entity which represents the basic unit of work to be
implemented in the system.
• 1. New: A process is said to be new state if it is being created.
• 2. Ready: A process is said to be ready state if it is ready for the execution and waiting
for the CPU to be allocated to it.
• 3. Running State: A process is said to be in running state if the CPU has been
allocated to it and it is currently being executed.
• 4. Waiting or Blocked: A process is said to be in waiting state if it has been blocked by
some event. Unless that event occurs the process cannot continue it execution.
• 5. Terminated: A process is said to be in waiting state if it has completed its execution
normally or it has been terminated abnormally by the OS because of some error or
killed by some other processes.
7. List any two operating system examples that uses one to one model.[1m]
• os/2, windows NT and windows 2000

8. Give example of operating system with user Pthread. [1m]


• Linux , max os X, Tru64 UNIX
9. What is context switching? State conditions when context switching occurs. [5m]
• A context switch is the mechanism to store and restore the state or context of a CPU
in Process Control Block (PCB) so that a process execution can be resumed from the
samepoint at a time later
• Context switching occur when If an error or interruption has occurred or the process
requires input/output, the Po process switches its state from running to the waiting
state.

10. Differentiate between user level thread and kernel level thread.[2m]

11. Explain many to many multithreading model. [2m]


• In this model, many user level threads multiplex to the Kernel thread of smaller or equal
numbers.
• The number of Kernel threads may be specific to either a particular application or a
particular machine.
• Solaris 2, IRIX, HP-UX and Tru64 UNIX support many to many thread model
CHAPTER - 3
1 What will happen if all process is CPU bound in system
• The I/O queue will be always empty.

2 Define dispatch latency


• The time taken by the dispatcher to stop one process and start another process to run
is called dispatch latency time.
3 Define turnaround time
• It is the difference between the time a process enters the system and the time it exits
the system

4 State and explain criteria for computing various scheduling algorithm


• FCFS
o It is the simplest type of algorithm in which the process that requests the CPU
first is allocated the CPU first.
• SJF
o In SJF algorithm, the process with the shortest expected processing time is
assigned to CPU. Hence, the name is shortest job first.
• Priority queue
o A priority is associated with each process and the CPU is allocated to the
process with the highest priority, hence it is called Priority Scheduling.
• .Round Robin
o Round robin scheduling is a preemptive version of First Come First Serve
scheduling. Processes are (FCFS) dispatched in a First In First Out (FIFO)
sequence but each process is allowed to run for only a limited amount of time.

5 State function of dispatcher


• The module of the operating system that performs the function of setting up the
execution of the selected process on the CPU is called dispatcher functions of
dispatcher are:
• Loading the register of the process
• Switching operating system to the user mods
• Restart the program by jumping to the proper location in the user program.

6 Define pre-emptive and non-pre-emptive scheduling. State disadvantages of pre-emptive


scheduling
• Primitive :
• A pre-emptive scheduling allows a higher priority process to replace a currently
running process, even if its time slot is not completed or it has not requested for
any I/O.
• The disadvantages of pre-emptive scheduling algorithms are they are complex
and they lead the system to race condition.
• Non- primitive
• In non-preemptive scheduling once the CPU is assigned to a process, the
processor do not release until the completion of that process.

7 Explain multilevel feedback queue scheduling with diagram


• In multilevel queue scheduling, processes cannot move from one queue to
otherbecause processes do not change their foreground or background nature.
• But in multilevel feedback queue scheduling, processes are not permanently assigned
to a queue on entry to the system.
• A multilevel feedback queue scheduler is defined by the following parameters:
• 1. The number of queues.
• 2. The scheduling algorithm for each queue.
• 3. The method used to determine when to upgrade a process to a higher priority
queue
• 4.The method used to determine when to demote a process to a lower priority
queue.
• 5. The method used to determine which queue a process will enter when that
process needs service.

8 What will happen if all processes are I/O bound in system

• If all processes are I/O bound, the ready queue will almost empty and the
short-term scheduler will have a little to do. I/O bound processes spend more
time doing I/O than computation
10 Explain multilevel queue scheduling with diagram
• A multilevel queue scheduling algorithm partitions the ready queue separate into
queues.
• In a multilevel queue scheduling processes are permanently assigned to one queue,
depending upon their properties such as the size of the memory or the type of the
process or priority of the process. So each queue follows a separate scheduling
algorithm.
• In multilevel queue scheduling algorithm scheduling the processes are classified into
different groups such as System processes, Interactive processes, Interactive editing
processes, Batch processes, User processes etc., as shown in Fig. 3.9.
• Here, each queue gets a certain portion of the CPU time, which it can then schedule
among its various processes.

11 Write any two disadvantages of priority scheduling


• It suffers from the problem of starvation of lower priority processes, since the
continuous arrival of higher priority processes will prevent lower priority processes
indefinitely from acquiring the CPU.
• A priority scheduling can leave some low priority waiting processes indefinitely for
CPU.
12 Define I/O bound process
• I/O Bound Process: The process which spends more time in I/O operation than
computation (time spends with CPU) is I/O bound process.

13 Priority scheduling suffers from starvation t/f justify


• True. It suffers from the problem of starvation of lower priority processes, since the
continuous arrival of higher priority processes will prevent lower priority processes
indefinitely from acquiring the CPU.

14 What is dispatch latency time write the function performed by dispatcher

• The time taken by dispatcher to stop one process and start another process to run is
called dispatch latency time.
• The following are functions performed by dispatcher:
• 1. Loading the register of the process.
• 2. Switching operating system to the user mode.
• 3. Restart the program by jumping to the proper location in the user program.
CHAPTER -4
1. What is race condition? [1m]
• Race condition is a situation where multiple processes access and manipulate the
same data concurrently and the outcome of the execution depends on the order in
which the instructions execute.
2. State two general approaches that are used to handle critical section in operating
system. [1m]
• Peterson Solution
o In Peterson's solution, when a process is executing in a critical state, then the
other process only executes the rest of the code, and the opposite can happen.
o This method also helps to make sure that only a single process runs in the
critical section at a specific time.
• Bakery algorithm
o The Bakery algorithm is one of the simplest known solutions to the mutual
exclusion
o
o problem for the general case of n (multiple) process.
o
o The Bakery algorithm is a critical section solution for n processes. The Bakery
algorithm preserves the First Come First Serve (FCFS) property.

3. What is semaphore?[5m]
• A semaphore is a variable used to control access to a common resource by multiple
processes and avoid critical section problem.
• A semaphore is an integer variable, which can be accessed only through two
operations Wait() and Signal()).
• Semaphores allow only one process into the critical section. They follow the mutual
exclusion principle strictly and are much more efficient than some other methods of
synchronization.
• There is no resource wastage because of busy waiting in semaphores as processor
time is not wasted unnecessarily to check if a condition is fulfilled to allow a process to
access the critical section.
• The two type's semaphores are binary semaphore and counting semaphore. A binary
semaphore is restricted to values of zero (0) or one (1), while a counting semaphore
can assume any non-negative integer value. The counting semaphores can range over
an unrestricted domain.
4. Explain bounded buffer problem. Give structure of producer and consumer.[5m]
• Bounded buffer problem is also called Producer-Consumer problem. Solution to this
problem is, creating two counting semaphores "full" and "empty" to keep track of the
current number of full and empty buffers respectively.
• Producers produce a product and consumers consume the product, but both use of
one of the containers each time.
• Producer
o Creates item and adds to the buffer.
o Do not want to overflow the buffer.
• Consumer
o Removes items from buffer (consumes it).
o Do not want to get ahead of producer.
• Bour Bounded-buffer assumes that there is a fixed buffer size. Consumer waits for
new item, producer waits if buffer is full. Producers and consumers are much like Unix
pipes.
• The bounded buffer problem can be handled using semaphores, mutex semaphore
provide mutual exclusion. Empty and full semaphores count number of empty and full
buffers respectively.
5. Counting semaphore can be implemented by using binary semaphore. True/ False.
Justify. [1m]
• False

6. Which two standard atomic operations can access semaphore value?[1m]


:-wait()
signal()

7. “A race condition exists when processes are running simultaneously”. True/False.


Justify.[1m]
True

8. Discuss the bound buffer problem with its solution.[5m]


9. Write a note on Dinning Philosopher problem.[5m]
• The dining philosopher is a popular classic synchronization problem for concurrency
control.
• The problem can be stated as follows:
o Consider five philosophers spend their lives alternating between thinking and
eating.
o They are seated around a circular table. In the centre of table is a bowl of rice,
and table is laid with five single chopsticks.
o Each philosopher has access to the chopsticks at his/her left and right. In order
to eat, a philosopher must be in possession of both chopsticks.
o A philosopher may only pick up one chopstick at a time. Each philosopher
attempts to pick up the left chopstick and then the right chopstick.
o When done eating, a philosopher puts both chopsticks back down on the table
and begins thinking.
o Since the philosophers are sharing chopsticks, it is not possible for all of them to
be eating at the same time.
o Now consider each philosopher as process and chopsticks are as resources. It is
a simple presentation of the need to allocate several resources among several
processes in a deadlock-free and starvation-free manner.
• A solution of the dining philosopher's problem is to use a semaphore to represent a
chopstick.
10. What is mutual exclusion?[1m]
• Mutual exclusion: If a process is executing in its critical section, then no other process
is allowed to execute in the critical section.
CHAPTER- 5
1 What are various dynamic allocation memory management methods?
• First Fit - Allocate the first hole that is big enough for the new process.
• Best Fit - Allocate the smallest hole that is big enough.
• Worst Fit - Allocate the largest hole.
2 Explain internal and external fragmentation.
• Internal Fragmentation : The process is allocated a memory block of size more than
the size of that process. Due to this some part of the memory is left unused and this
causes internal fragmentation.
-> When internal fragmentation occurs, a process that needs 57 bytes of memory, for
example, may be allocated a block that contains 60 bytes, or even 64.
- External Fragmentation : The total memory space is enough to satisfy a request or
to
resist a process in it, but it is not contiguous, so it cannot be used.
• Actually 30K of memory is free which satisfy the request but hole is not contiguous.

3 Define physical address space


• Physical address space in a system can be defined as the size of the main memory.
It is really important to compare the process size with the physical address space.
The process size must be less than the physical address space.

4 Explain MVT with advantage and disadvantage.


• Advantages : 1. It increases degree of multiprogramming due to which there is no
unused space in the memory. Thus more processes can be loaded into the memory
at the same time.
2) In MVT space in the main memory is allocated strictly according to the
requirement of the process thus there is no chance of internal fragmentation.
3)In MVT the size of process can grow or shrink dynamically thus the size of the
process cannot be restricted because the partition size is decided according to the
process size.
• Disadvantages : 1) MVT suffers from external fragmentation.
2) Difficult to implement.

5 What is the role of valid and invalid bit in demand paging.


6 What is external fragmentation? What are various ways to avoid external fragmentation
7 What is the advantage of paging with segmentation model
1. Paging allows jobs to be allocated in non-contiguous memory locations.
2. In paging memory used more efficiently.
3. Paging does not require any support for dynamic relocation because paging itself is
a form of dynamic relocation.
4. Paging support higher degree of multiprogramming.
8 What is fragmentation? Explain internal and external fragmentation in detail
• As process are loaded and removed from memory, the free memory space is broken
into little pieces. It happens after sometimes that processes cannot be allocated to
memory blocks considering their small size and memory blocks remains unused.
This problem is known as fragmentation.
• External Fragmentation : 1) It arises when free memory, areas existing in systems
are too small to be allocated to processes.
2) It can be eliminated by compaction technique.

• Internal Fragmentation : 1) It exists when memory allocated to a program is not fully


utilized.
2) It can be eliminated by allocating memory to processes dynamically.
9 Using segmentation find the physical address from the logical address 2,280 having
segment size 285 with base address 3000
• As the length of given segment was 285 which is greater than offset therefore
address will be vaid
• To find physical address we add the offset to the base address
• 3000+280=3280

10 List various dynamic allocation memory management methods


1. First Fit, Best Fit, Worst Fit

11 What is fragmentation? Explain types of fragmentation with suitable example


1. As processes are loaded and removed from memory, the free memory space is
broken into little pieces. It happens after sometimes that processes cannot be
allocated to memory blocks considering their small size and memory blocks remains
unused. This problem is known as fragmentation.
2. Fragmentation is of two types namely, external fragmentation and internal
fragmentation.
3. External fragmentation arises when free memory, areas existing in systems are too
small to be allocated to processes.
4. Internal fragmentation exists when memory allocated to a program is not fully utilized
by it.
12 Write a note on segmentation hardware
1. Each segment in segmentation has a name and a length.
2. A logical address consists of two parts a segment number 's' and an offset into that
segment 'd'.
3. Each entry of segment table has a segment base and a segment limit
4. Adv- Segmentation eliminates fragmentation problem.
5. It provides dynamic linking and loading.
6. Disadv-Increased complexity in the operating system.
7. Increased hardware cost processor overhead for address mapping.
13 What is page table? What are its contents
1. This table has the ability to mark an entry invalid thorough a valid- invalid bit or
special value of protection bits.
2. The page table has the base address of each page in physical memory which is
combined with page offset to define the physical memory address which is sent to
memory unit.
14 Define logical address
• The logical address is generated by CPU while a program is running and used as a
reference to access the physical memory location by CPU. Physical address
identifies a physical location of required data in a memory .
15 What is compaction
1. Compaction is a method used to overcome the external fragmentation problem all
free block are brought together as one large block of free space

16 Explain demand paging with example Discuss hardware required for demand paging
• Demand paging is a method of virtual memory management
• With demand-paged virtual memory, pages are only loaded when they are
demanded during program execution pages that are never accessed are thus never
loaded into physical memory
• The hardware to support demand paging:
o Page table
o Secondary memory

You might also like