SerNo. | Hardware resource | Resources in kitchen of a restaurant |
---|---|---|
1 | CPU of the computer | (a) Countertop |
2 | Main Memory or RAM | (b) Cupboard |
3 | Disk | (c) Chef at the restaurant |
1-c,2-b,3-a
1-c,2-a,3-b
1-b,2-a,3-c
1-a,2-b,3-c
cd
ls
pwd
None of above
Collection of hardware components
Collection of input-output devices
All the above
Collection of software functions
OS acts as a resource manager
OS hides the hardware complexity
OS acts as an interface between applications and hardware
OS makes it easier for user to use the hardware.
Arbitration
Abstraction as well as arbitration
Abstraction
None of above
Arbitration
Abstraction as well as arbitration
Abstraction
None of above
Arbitration
Abstraction as well as arbitration
Abstraction
None of above
To allow people to use the computer
To keep system programmers employed
To make the most efficient use of computer hardware
To make it difficult for layman users to damage the computer system
File Editor
Cache Memory
File Manager
I/O manager
Process manager
Web browser
SerNo. | Task | Functionalities |
---|---|---|
1 | Reading the contents of a file | (a) Memory Management |
2 | Copying the file contents into the memory | (b) Process Management |
3 | Whole process of copying and pasting the contents of file | (c) File Management |
1-a,2-b,3-c
1-b,2-c,3-a
1-c,2-a,3-b
1-b,2-a,3-c
Polling
An indirect jump
A software interrupt
A privileged instruction
SerNo. | List-1 | List-2 |
---|---|---|
1 | exec() | (a) Creates a new process |
2 | exit() | (b) Keeps the process id same and replaces the running code with a new code |
3 | wait() | (c)Terminates a running process properly |
4 | fork() | (d)A process synchronizes with termination of child process |
(a)-3,(b)-2,(c)-4,(d)-1
(a)-2,(b)-3,(c)-4,(d)-1
(a)-2,(b)-3,(c)-4,(d)-1
(a)-2,(b)-4,(c)-3,(d)-1
SerNo. | Bracket-1 | Bracket-2 |
---|---|---|
1 | kill-3851 | (a) Passes a keyboard interrupt to the running process |
2 | kill-93851 | (b) Abruptly terminates the running process |
3 | kill-23851 | (c)Properly terminates the running process |
4 | kill-I | (d) Lists all the available signals that can be passed to kill command |
1 - c, 2 - d, 3 - a, 4 - b
1 - a, 2 - b, 3 - c, 4 - d
1 - c, 2 - b, 3 - a, 4 - d
1 - c, 2 - a, 3 - b, 4 - d
Operating systems are mostly implemented in C. System calls are function calls to implementations of functions where they interact with hardware resources.
Terminal commands are a wrapper over the system calls. Behind the scenes of terminal commands are function calls to the system calls.
System calls are used to interact with the kernel of Operating systems.
All the above statements are correct.
SerNo. | Bracket-1 | Bracket-2 |
---|---|---|
1 | cat newfile.txt | (a) It will append the contents of one file to another |
2 | cat newfile.txt anotherfile.txt | (b) It will show content of a file with line number |
3 | cat -n newfile.txt | (c)It will show the contents of both newfile.txt and anotherfile.t |
4 | cat newfile.txt >> anotherfile.txt | (d)It will show the contents of newfile.txt |
1 - a, 2 - c, 3 - b, 4 - d
1 - d, 2 - b, 3 - c, 4 - a
1 - d, 2 - c, 3 - b, 4 - a
1 - a, 2 - b, 3 - c, 4 - d
Abstraction includes OS’s abstracted form of application as well as hardware resources, mechanism is how to do something and policies are what will be done
Abstraction includes OS’s abstracted form of hardware resources, mechanism is what will be done and policies are how to do something
Abstraction includes OS’s abstracted form of hardware resources, mechanism is how to do something and policies are what will be done
Abstraction includes OS’s abstracted form of application as well as hardware resources, mechanism is what will be done and policies are how to do something
only A is correct
only B is correct
Both A and B are correct
Both are in correct
OS switches the CPU between different processes.
OS creates processes from the programs and data stored in disk.
OS runs multiple applications on a CPU and this creates the illusion that we are using multiple CPUs.
None.
30%
60%
70%
75%
3,4,2,1,5
3,4,1,2,5
3,2,4,1,5
,1,2,3,4,5
1 - a, 2 - b, 3 - c, 4 - d
1 - b, 2 - d, 3 - c, 4 - a
1 - b, 2 - c, 3 - d, 4 - a
1 - a, 2 - c, 3 - d, 4 - b
P = Memory Insufficient Error, Q = Stack Overflow Error
P = Illegal Memory Referencing Error, Q = Memory Insufficient Error
P = Stack Overflow Error, Q = Memory Insufficient Error
P = Memory Insufficient Error, Q = Illegal Memory Referencing Error
Process type variable
A block of space in disk for each application
Per process data structure
A block in memory for each application
2,3,1
3,1,2
2,1,3
1,2,3
I, II, and III only
II and III only
I, II, and IV only
I, II, III and IV only
Ready
Idle
Blocked
Running
when process is using the CPU
when process is scheduled to run after some execution
None of above
job queue
execution queue
ready queue
process queue
I and II
I and III
II and III
II and IV
SerNo. | List-1 | List-2 |
---|---|---|
A | Moves suspended process to secondary storage | (I) Short term scheduler |
B | Loads the process into memory for execution | (II) Long term scheduler |
C | Moves one of the processes to running state | (III) Medium Term Scheduler |
A - I, B - II, C - III
A - II, B - I, C - III
A - III, B - II, C - I
A - I, B - III, C - II
State Switch
Process State Change
Context Switch
PCB Change
Only B
Both are correct
Only A
Neither A nor B is correct
Only i
Only ii
Both i and ii
None of these
The child process is taking more resources than allocated.
The task assigned to the child process is no longer required.
All the above
The parent process is terminating, and the OS does not allow a child to continue if its parent exits
SerNo. | Bracket-1 | Bracket-2 |
---|---|---|
1 | grep -c "linux" cnfile.txt | (a) Displays only the matched pattern |
2 | grep -l "linux" * | (b) Checks the complete words in a file |
3 | grep -w "linux" cnfile.txt | (c) Displays the file names that matches the pattern |
4 | grep -o "linux" cnfile.txt | (d) Displays the count of number of matches |
1 - a, 2 - c, 3 - b, 4 - d
1 - d, 2 - b, 3 - c, 4 - a
1 - d, 2 - c, 3 - b, 4 - a
1 - a, 2 - b, 3 - c, 4 - d
SerNo. | Terms | Description |
---|---|---|
1 | Turn around time | (a) The time duration between process getting into ready queue and process getting CPU for the first time. |
2 | Wait time | (b) The time process spends waiting for the CPU. |
3 | Response time | (c) The time duration between the terminated state and ready state [this is taken from the first time process enters the ready state] |
1 - c, 2 - a, 3 - b
1 - b, 2 - c, 3 - a
1 - c, 2 - b, 3 - a
1 - a, 2 - b, 3 - c
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 5 | 4 |
P2 | 0 | 3 |
P3 | 1 | 2 |
P4 | 7 | 1 |
P5 | 4 | 6 |
Turnaround time: 7.2 units, Waiting time: 4.3 units
Turnaround time: 5.1 units, Waiting time: 3.1 units
Turnaround time: 6.6 units, Waiting time: 3.4 units
Turnaround time: 6.9 units, Waiting time: 5.1 units
Process ID | Arrival Time | Burst Time(in ms) |
---|---|---|
P1 | 0 | 8 |
P2 | 0.6 | 6 |
P3 | 3.8 | 4 |
P4 | 4.4 | 2 |
15
13
12.8
None of above
Convoy Effect is a situation where many processes, who need to use a resource for a short time, are blocked by one process holding that resource for a long time. This essentially leads to poor utilization of resources and hence poor performance.
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 7 |
P2 | 3 | 5 |
P3 | 5 | 11 |
P4 | 10 | 4 |
4.90 milliseconds
2.35 milliseconds
4.25 milliseconds
5.72 milliseconds
i and iv
i and iii
ii and iii
i and ii
ii and iii
i and iii
i and iv
i and ii
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 7 |
P2 | 3 | 3 |
P3 | 5 | 5 |
P4 | 6 | 2 |
5
4
3
6
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 10 |
P2 | 3 | 6 |
P3 | 7 | 1 |
P4 | 8 | 3 |
8.26
8.27
8.25
8.28
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 10 |
P2 | 3 | 6 |
P3 | 7 | 1 |
P4 | 8 | 3 |
32
31
29
30
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 5 |
P2 | 1 | 4 |
P3 | 2 | 2 |
P4 | 3 | 7 |
81.2%
72.3%
67.7%
71.4%
Process ID | P1 | P2 | P3 | P4 |
---|---|---|---|---|
Arrival Time | 0 | 1 | 3 | 4 |
CPU burst time | 3 | 1 | 3 | z |
2
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 11 |
P2 | 4 | 8 |
P3 | 6 | 2 |
P4 | 9 | 4 |
9.2 milliseconds
10 milliseconds
11 milliseconds
8.3 milliseconds
Process ID | Arrival Time | Burst Time | Priority |
---|---|---|---|
P1 | 0 | 10 | 2 |
P2 | 4 | 19 | 1 |
P3 | 10 | 1 | 3 |
P4 | 3 | 9 | 0 |
15 milliseconds
14 milliseconds
16 milliseconds
13 milliseconds
Process ID | Arrival Time | Burst Time | Priority |
---|---|---|---|
P1 | 0 | 5 | 1 |
P2 | 1 | 7 | 3 |
P3 | 2 | 3 | 2 |
P4 | 3 | 4 | 4 |
Turnaround time: 12.32 milliseconds, Waiting time: 7 milliseconds
Turnaround time: 11.56 milliseconds, Waiting time: 7 milliseconds
Turnaround time: 10.75 milliseconds, Waiting time: 6 milliseconds
Turnaround time: 13.43 milliseconds, Waiting time: 6 milliseconds
Process ID | Burst Time |
---|---|
P1 | 8 |
P2 | 7 |
P3 | 2 |
P4 | 4 |
4.25
5.50
5.25
6.25
1 and 2 are correct
2 and 3 are correct
All the statements are correct
1 and 3 are correct
1 and 2 are correct
2 and 3 are correct
1 and 3 are correct
All correct
Shortest Job First Scheduling
Priority Scheduling
First-Come, First-Served Scheduling
Round Robin Scheduling
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 5 |
P2 | 1 | 3 |
P3 | 2 | 1 |
P4 | 3 | 2 |
Turnaround time: 8.30 milliseconds, Waiting time: 5.40 milliseconds
Turnaround time: 6.37 milliseconds, Waiting time: 4.02 milliseconds
Turnaround time: 7.25 milliseconds, Waiting time: 4.50 milliseconds
Turnaround time: 7.02 milliseconds, Waiting time: 3.17 milliseconds
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 4 |
P2 | 2 | 2 |
P3 | 3 | 1 |
P1, P2, P3
P3, P2, P1
P2, P1, P3
P2, P3, P1
Process ID | Arrival Time | Burst Time |
---|---|---|
P1 | 0 | 3 |
P2 | 1 | 6 |
P3 | 4 | 4 |
P4 | 6 | 2 |
First Come First Serve
Non-preemptive Shortest Job First
Shortest Remaining Time
Round Robin with Quantum value two
Round-robin with time quantum less than the shortest CPU burst
Uniform random
Shortest remaining time first
Highest priority first with priority proportional to CPU burst length
A multi-level queue scheduling algorithm partitions the ready queue into several separate queues. The processes are permanently assigned to one queue, generally based on some property of the process, such as memory size, process priority, or process type. Most importantly, each queue has its own scheduling algorithm.
The number of queues
The scheduling algorithm for each queue which can be different from FIFO
All of these
The method used to determine when to promote a process to a higher priority queue
Saving and restoring register-level state (such as the program counter and general-purpose registers) is slow.
This approach may not work for processes requiring large amount of memory.
Saving the entire contents of memory to disk is extremely non-performant, as time taken to move the contents between these storage device is brutally slow. This makes this approach very slow.
There isn’t enough space for saving the entire state of processes so we may get insufficient memory error i.e. we may run out of memory.
Example of arbitration function of OS
Example of OS acting as an interface between hardware and applications
Example of abstraction function of OS
None of the above
code, stack, heap
stack
stack, heap
code, stack
Physical address 0KB
Physical address 320KB
Physical address 256KB
Physical address 512KB
True
False
1 and 2 are correct
2, 3 and 4 are correct
All the statements are correct
1, 2 and 3 are correct
This is done so that the process doesn’t have direct access to physical memory.
This is done for ease of usage of physical memory. Virtual memory makes it easier for the process to access physical memory.
This is done for protection. By adding this layer, the OS makes sure that processes are isolated and protected from one another.
None of above
It stores the contents in the virtual address space so that they can be transferred to their corresponding physical address space.
It is used to store all the physical addresses that form the address space of a program.
It transforms virtual addresses (generated by the program) into physical addresses.
It ensures that such addresses are within the confines of the address space.
The CPU modifies its bounds to access the memory that the process wants.
The CPU omits that particular instruction in the program
The CPU raises an exception.
None of above
Physical Address
Absolute Address
Virtual Address [also known as logical address]
None of above
CPU
Operating System
Memory Management Unit
None of above
The problem of Internal fragmentation is present in the Fixed Partitioning.
The degree of multiprogramming is fixed in Fixed Partitioning.
All the above statements are correct.
A process whose size is greater than the largest contiguous space available cannot be accommodated.
The problem of External fragmentation is present in the Fixed Partitioning.
It can be both. Insufficient data.
Dynamic Partitioning Method
Fixed Partitioning Method
Neither Fixed Partitioning nor Dynamic Partitioning
2 and 3 are solved
1 and 3 are solved
1 and 2 are solved
1, 2 and 3 are solved
Partitioning
Internal Fragmentation
External Fragmentation
None of the above
free hash table
free tree
free list
free heap
Partition sizes in KB | 4k | 8k | 20k | 2k | |||
---|---|---|---|---|---|---|---|
Jobs | 2k | 14k | 3k | 6k | 10k | 20k | 2k |
Times for Execution | 4 | 10 | 2 | 1 | 1 | 8 | 6 |
20 units of time
18 units of time
19 units of time
21 units of time
Best fit but not first fit.
Both First fit & Best fit.
First fit but not best fit.
Neither first fit nor best fit.
Best Fit
Worst Fit
First Fit
Next Fit
1. The First Fit algorithm scans the memory blocks, and whenever it finds the first big enough memory block to store a process, it stops scanning and loads the job into that block. This algorithm avoids exhaustive searches on entire free space.Buddy allocation
Growing the Heap
Segregated Lists
Merging
The hole created by the worst fit is always larger than the hole created by the first fit.
The hole created by the first fit is always larger than the hole created by the next fit.
The hole created by the best fit is never larger than the hole created by the first fit.
The hole created by the next fit is never larger than the hole created by best fit.
The capacity or size of segment
Stores the starting address of virtual address space of memory
Contains the starting address where process is loaded at physical memory
None of above
The data of segment bases are corrupted
A process requesting an address which exist absolutely fine.
A process accessing illegal address, which is beyond the bounds of address space assigned to process
A process accessing stack segment instead of heap segment
Read-write bits
Reading bits
Protection bits
Permission bits
False
Ture
False
Ture
the offset within the page
page table entry (PTE)
the virtual page number (VPN)
physical frame number (PFN)
page table entry (PTE)
page framepage offset
page table
None of above
Pages
Page Tables
Page Frames
Segments
Virtual Page Number | Physical Page Number |
---|---|
0 | 3 |
1 | 7 |
2 | 5 |
3 | 2 |
75
89
85
95
Ture
False
Division of physical address space into frames
Extra space allocated for page table
Too many memory references to access the actual data stored
Division of virtual address space into pages
Ture
False
The TLB contains the mapping for the requested physical address
The TLB checks and confirms whether this virtual address is accessible
The TLB contains the mapping for the requested virtual address
None of above
Valid bit
Protection bit
Address space identifier (ASID)
Permission bit
Segmentation Fault
Page Miss
Page Fault
Swap Space Hit
9
12
10
8
4
5
6
7
3
4
5
6
Program and Process, both are stored in main memory and threads are part of process and are, therefore, stored in main memory itself.
A program can have many processes, a process can have many threads and similarly one thread can be associated with multiple processes.
Program is stored in secondary memory, Process is stored in main memory and threads are part of process and are stored in main memory itself.
A program can have many processes, a process can have many threads, but one thread can belong to exactly one process.
No
Yes
To make optimal use of multiple CPUs
Avoid blocking due to I/O
To optimally utilize the memory
To keep CPU busy all the time
Yes
No
True
False
3
Yes
No
If a process is executing in its critical section, then no other process must be executing in their critical sections
If a process is executing in its critical section, then other processes must be executing in their critical sections
If a process is executing in its critical section, then all the resources of the system must be blocked until it finishes execution
None of above
We have to use hardware and OS support. It is well established that a simple flag variable cannot help us bring mutual exclusion and even Peterson's solution is valid only for two threads. For multiple threads (greater than two), we have to rely on hardware and OS support.
None of above
The other threads execute the critical section and make changes in a local copy of the shared variable. When the lock is available, then they update the shared variable with the local copy.
The other threads check the availability of locks. If it is not available, they will wait for it to be available again.
The other threads continuously check the availability of Lock.
The other threads cannot execute the critical section, until the lock is available.
When multiple threads are executing simultaneously
Whenever we are using threads
When multiple instructions need to be made atomic
When high priority threads don’t let low priority threads execute
Check if the condition is true
Increases the value of the count variable
Acquire the lock
Release the loc
6
Contention: If one of the threads has acquired the lock, then all the other threads have to wait till the thread releases the lock. Other threads have to make continuous checks if the lock is available, which will waste CPU cycles.
Starvation: If a low priority thread has acquired the lock, then even if a high priority thread comes, it cannot execute its critical section, until the low priority thread releases the lock.
Deadlock: If thread T1 has acquired the lock on resource R1 and is waiting for resource R2 and thread T2 has acquired the lock on resource R2 and is waiting for resource R1, then they get in a deadlock and can never get out of this situation.
Debugging: It becomes difficult to debug the programs with locks in it.
All the above
Contention: If one of the threads has acquired the lock, then all the other threads have to wait till the thread releases the lock. Other threads have to make continuous checks if the lock is available, which will waste CPU cycles.
Starvation: If a low priority thread has acquired the lock, then even if a high priority thread comes, it cannot execute its critical section, until the low priority thread releases the lock.
Deadlock: If thread T1 has acquired the lock on resource R1 and is waiting for resource R2 and thread T2 has acquired the lock on resource R2 and is waiting for resource R1, then they get in a deadlock and can never get out of this situation.
Debugging: It becomes difficult to debug the programs with locks in it.
All the above
The solution makes threads to check a condition and if that condition is true, then the threads go to sleep.
When the threads go to sleep, they execute the wait() operation. wait() operation adds it to the wait queue until this thread is notified that condition is false
When the thread using the lock releases it, then it notifies all the threads in the waiting queue.
The next thread to acquire the lock should be the last one to enter the waiting queue.
Deadlocks are not there in semaphores solution, whereas they are present in locks and conditional variables solution.
Debugging of locks and condition variables program is difficult, whereas the semaphores makes debugging easier
Locks and Condition Variables solution can be used to let only one thread execute the critical section, whereas the semaphores solution can be used to execute multiple threads in the critical section simultaneously.
None of above
Minimum = 6
Minimum = 4
Minimum = 2
Minimum = 8
The semaphore is released immediately after the value is incremented.
The semaphore is acquired just before the condition is checked
At any instant of time, only one thread can execute the critical section and increment the value of a shared variable.
All these instructions (releasing and acquiring the lock) are wrapped inside a condition i.e. the critical section can only be executed if the shared variable’s value is less than n.
Mutual exclusion
A process may hold allocated resources while awaiting assignment of other resources
All of the above
No resource can be forcibly removed from a process holding it
Using thread
Using pipes
Defining a linear ordering of resource types
All of the above
Circular Wait: There exists a circular chain between exactly two threads in such a way that each thread holds the resources that are needed by another thread in the chain.
Hold and Wait: Threads hold the resource with no intention to release it.
Circular wait: There exists a circular chain of threads in such a way that each thread holds the resources that are needed by another thread in the chain.
Hold and Wait: Threads hold the resource that has already been allocated to them and wait for the resource that they wish to acquire.
6
4
5
3
Yes
No
R1 | R2 | R3 | R4 | R5 | |
---|---|---|---|---|---|
PA | 1 | 0 | 2 | 1 | 1 |
PB | 2 | 0 | 1 | 1 | 0 |
PC | 1 | 1 | 0 | 1 | 1 |
PD | 1 | 1 | 1 | 1 | 0 |
R1 | R2 | R3 | R4 | R5 | |
---|---|---|---|---|---|
PA | 1 | 1 | 2 | 1 | 3 |
PB | 2 | 2 | 2 | 1 | 0 |
PC | 2 | 1 | 2 | 1 | 1 |
PD | 1 | 1 | 2 | 2 | 0 |
1
Only REQ1 can be permitted.
Both REQ1 and REQ2 can be permitted.
Only REQ2 can be permitted
Neither REQ1 nor REQ2 can be permitted
HDD consists of mechanical parts, whereas SSD uses NAND based flash memory to retrieve and write data.
HDD is faster in comparison to SSD in reading and writing data.
The smallest unit of HDD is sector and the smallest unit of SSD is page.
The data is read and written in blocks in both HDD and SSD.
Deletion involves removing all the attributes of a file, while truncation keeps all the attributes of a file.
Deletion releases the file space, while the truncation doesn’t.
Both the operations release the file space.
Deletion involves removing all the attributes of a file, while truncation keeps all the attributes of a file, except file length (which is set to zero).
When the file is closed by the process with most priority
When the file pointer moves to the beginning of the file
When the attribute file-open count becomes zero
When the file is closed by the process with least priority
Advisory lock and it is applied by Windows
Mandatory lock and it is applied by Unix
Mandatory lock and it is applied by Windows
Advisory lock and it is applied by Unix
ctime, atime and mtime are defined differently for File and Directory.
There is no difference in the inode numbers for file and directory.
For file, the type is defined as regular and for directory, it is defined as directory.
Inode number is only defined for a file.
Attribute | Description |
---|---|
1. ctime | a. Time at which file/ directory was last modified |
2. atime | b. Time at which attributes of file/ directory was last changed |
3. mtime | c. Time at which file/ directory was last accessed |
1 - c, 2 - a, 3 - b
1 - a, 2 - b, 3 - c
1 - b, 2 - c, 3 - a
1 - b, 2 - a, 3 - c
Access to the data is faster in comparison to contiguous allocation.
It allows both sequential as well as direct access.
There is no fragmentation and allows the file to grow dynamically over time.
None of above
I and III only
II only
II and III only
III only
3
FCFS
Circular SCAN
Elevator
None of above
10
Scheduling Algorithm | Distance Moved |
---|---|
1. FCFS | a. 1745 |
2. SSTF | b. 1917 |
3. SCAN | c. 3363 |
4. C-SCAN | d. 7081 |
5. C-LOOK | e. 9987 |
1 - d, 2 - a, 3 - b, 4 - c, 5 - e
1 - e, 2 - a, 3 - b, 4 - c, 5 - d
1 - d, 2 - a, 3 - b, 4 - e, 5 - c
1 - a, 2 - b, 3 - c, 4 - e, 5 - d