chapter

    Operating System Short Notes for Gate Cs

    GATE CS Operating System: 5 chapters, 48 previous year questions (100% of Operating System), 1332 practice questions and one solved question from each chapter

    A question from this chapter

    Question 1
    Level 3: Exam Standard

    A single-threaded process P1 executes a read system call. While in kernel mode handling this call, a hardware timer interrupt occurs, causing a context switch to process P2. P2 is currently in the Ready state and was last running in user mode. After P2 executes for a while, it is preempted, and P1 is resumed, eventually returning to user mode. What is the minimum number of times the hardware mode bit changes state (from User to Kernel or Kernel to User) from the moment P1 executes the read instruction until P1 resumes its next user instruction?

    Question 2
    Level 3: Exam Standard

    Four processes arrive at times with CPU burst times respectively. The system uses Shortest Remaining Time First (SRTF) scheduling. Ignore context switching overhead. What is the sum of the response times of all four processes?

    Question 3
    Level 3: Exam Standard

    A system has 4 processes sharing a single resource type. The maximum resource demands of the processes are 3, 5, 6, and 8 instances respectively. What is the minimum number of total resource instances required to guarantee that the system is completely deadlock-free under any possible allocation?

    Question 4
    Level 3: Exam Standard

    Consider a system with a Translation Lookaside Buffer (TLB) and a two-level page table. The TLB hit ratio is 0.8. The TLB access time is 10 ns, and the main memory access time is 100 ns. Assume TLB and memory accesses are sequential. On a TLB miss, the system takes 2 memory accesses to walk the two-level page table, followed by 1 memory access to fetch the data. The page fault rate is zero. The Effective Access Time (in ns) is _________.

    Question 5
    Level 3: Exam Standard

    A file system supports both contiguous and linked allocation. Match the following file operations with the number of disk accesses required to perform them. Assume the File Control Block (FCB) is already in memory, and the data block to be inserted is already in memory. The insertion point is between the -th and -th block of a file.

    List I (Operation)

    P. Contiguous allocation, insert at in a 100-block file

    Q. Linked allocation, insert at in a 100-block file

    R. Contiguous allocation, insert at in a 100-block file

    S. Linked allocation, insert at in a 100-block file

    List II (Disk Accesses)

    1. 1
    2. 53
    3. 101
    4. 103

    Options:

    A. P-3, Q-2, R-1, S-4

    B. P-3, Q-4, R-1, S-2

    C. P-2, Q-3, R-1, S-4

    D. P-3, Q-2, R-4, S-1

    Free preview ends here

    Login to view the complete short notes

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Operating System Short Notes for GATE CS

    GATE CS Operating System: 5 chapters, 48 previous year questions (100% of Operating System), 1332 practice questions and one solved question from each chapter.

    About Operating System Short Notes

    Quick revision sheets for Operating System in GATE CS. Every chapter is condensed into key formulas, shortcuts and common traps so you can revise 5 chapters fast before the exam.

    Operating System Weightage in GATE CS

    Operating System accounts for 48 of 48 Operating System previous year questions in our bank (100%), about 4.8 per paper across 10 papers.

    Operating System Chapter Matrix

    ChapterTopicsPYQsShare of unit PYQsPractice questions
    Processes, Threads, System Calls and Context SwitchingProcess States, Ready Queues and Context Switching, Threads and Thread Context, System Calls and User-kernel Mode Transitions, Process Creation Using Fork and Wait919%253
    Cpu SchedulingSjf and Srtf Scheduling Metrics, Scheduling Properties, Preemption and Starvation, Round Robin Scheduling and Context-switch Sequences, Priority and Multiprocessor Scheduling919%255
    Concurrency, Synchronization and DeadlocksConcurrent Interleavings and Shared-state Outcomes, Semaphore Synchronization, Ordering and Critical Sections, Deadlock Conditions, Resource Graphs and Avoidance, Lock-based Resource Ownership, Livelock and Starvation1225%338
    Memory Management, Paging and Virtual MemoryPaging, Page Tables, Address Translation and Tlbs, Page Replacement, Page Faults and Locality, Contiguous Memory Allocation and Fragmentation1429%362
    File Systems and Storage AllocationContiguous and Linked File Allocation, Directory Search and File Operations, Free-space Management48%124

    More from Operating System

    One Solved Question from Each Operating System Chapter

    Question 1 · Processes, Threads, System Calls and Context Switching MCQ

    A single-threaded process P1 executes a read system call. While in kernel mode handling this call, a hardware timer interrupt occurs, causing a context switch to process P2. P2 is currently in the Ready state and was last running in user mode. After P2 executes for a while, it is preempted, and P1 is resumed, eventually returning to user mode. What is the minimum number of times the hardware mode bit changes state (from User to Kernel or Kernel to User) from the moment P1 executes the read instruction until P1 resumes its next user instruction?

    1. A.

      2

    2. B.

      4

    3. C.

      6

    4. D.

      8

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a minimum-value question testing the exact sequence of mode bit changes during system calls, interrupts, and context switches.

    Step 1: P1 executes read. This is a synchronous software trap. The mode bit changes from User to Kernel. (Change 1)

    Step 2: A timer interrupt occurs. P1 is already in Kernel mode. The interrupt handler runs in Kernel mode. No mode bit change occurs here.

    Step 3: The OS scheduler switches to P2. P2 was last running in User mode. To resume P2, the mode bit must change from Kernel to User. (Change 2)

    Step 4: P2 runs in User mode until it is preempted. Preemption involves a timer interrupt or software trap, forcing P2 into Kernel mode. The mode bit changes from User to Kernel. (Change 3)

    Step 5: The OS switches back to P1. P1 needs to return to its user-mode instruction after the read completes. The mode bit changes from Kernel to User. (Change 4)

    Step 6: Total minimum mode bit changes = 4.

    Answer: B

    Question 2 · CPU Scheduling MCQ

    Four processes arrive at times with CPU burst times respectively. The system uses Shortest Remaining Time First (SRTF) scheduling. Ignore context switching overhead. What is the sum of the response times of all four processes?

    1. A.

      8

    2. B.

      13

    3. C.

      31

    4. D.

      10

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: Response time is the duration from arrival until the first CPU allocation. Once a process gets the CPU for the first time, its response time is locked — preemptions afterward do not affect it. This is a SRTF trace where you must carefully track the first allocation instant for each process.

    Step 1: Build the SRTF Gantt chart by tracking remaining burst times (RBT) at every arrival event.

    • : Only has arrived. starts. First allocation of is at .
    • : has RBT . arrives with BT . Since , preempts . First allocation of is at .
    • : has RBT . arrives with BT . Since , no preemption. continues.
    • : finishes (CT ). arrives. Ready queue: (RBT ), (RBT ), (RBT ). Minimum RBT is . starts. First allocation of is at .
    • : finishes (CT ). Ready queue: (RBT ), (RBT ). starts.
    • : finishes (CT ). starts. First allocation of is at .
    • : finishes (CT ).

    Step 2: Compute response times.

    Step 3: Sum .

    Answer: 8

    Question 3 · Concurrency, Synchronization and Deadlocks MCQ

    A system has 4 processes sharing a single resource type. The maximum resource demands of the processes are 3, 5, 6, and 8 instances respectively. What is the minimum number of total resource instances required to guarantee that the system is completely deadlock-free under any possible allocation?

    1. A.

      18

    2. B.

      22

    3. C.

      19

    4. D.

      23

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a "minimum resources to prevent deadlock" question, recognizable because it asks for the absolute minimum instances to guarantee a deadlock-free state across multiple processes with varying maximum demands.

    Step 1: Identify the worst-case scenario for deadlock. This occurs when every process holds exactly one less than its maximum demand and is waiting for exactly one more instance.

    Step 2: Calculate the resources tied up in this worst case. For demands 3, 5, 6, and 8, the held instances are .

    Step 3: Add exactly 1 more resource instance to the system. This single instance guarantees that at least one process can acquire its final needed resource, finish execution, and release all its held resources, thereby breaking the deadlock chain.

    Step 4: Total minimum resources = .

    Answer: 19

    Question 4 · Memory Management, Paging and Virtual Memory NAT

    Consider a system with a Translation Lookaside Buffer (TLB) and a two-level page table. The TLB hit ratio is 0.8. The TLB access time is 10 ns, and the main memory access time is 100 ns. Assume TLB and memory accesses are sequential. On a TLB miss, the system takes 2 memory accesses to walk the two-level page table, followed by 1 memory access to fetch the data. The page fault rate is zero. The Effective Access Time (in ns) is _________.

    Correct Answer:

    150.00

    Step-by-Step Solution

    Key idea: Effective Access Time (EAT) is the weighted average of hit and miss times, including all sequential memory accesses.

    Step 1: Calculate hit time. TLB access + 1 memory access for data = ns.

    Step 2: Calculate miss time. TLB access + 2 memory accesses (page table walk) + 1 memory access (data) = ns.

    Step 3: Calculate EAT. ns.

    Answer: 150.00

    Question 5 · File Systems and Storage Allocation MCQ

    A file system supports both contiguous and linked allocation. Match the following file operations with the number of disk accesses required to perform them. Assume the File Control Block (FCB) is already in memory, and the data block to be inserted is already in memory. The insertion point is between the -th and -th block of a file.

    List I (Operation)

    P. Contiguous allocation, insert at in a 100-block file

    Q. Linked allocation, insert at in a 100-block file

    R. Contiguous allocation, insert at in a 100-block file

    S. Linked allocation, insert at in a 100-block file

    List II (Disk Accesses)

    1. 1
    2. 53
    3. 101
    4. 103

    Options:

    A. P-3, Q-2, R-1, S-4

    B. P-3, Q-4, R-1, S-2

    C. P-2, Q-3, R-1, S-4

    D. P-3, Q-2, R-4, S-1

    1. A.

      P-3, Q-2, R-1, S-4

    2. B.

      P-3, Q-4, R-1, S-2

    3. C.

      P-2, Q-3, R-1, S-4

    4. D.

      P-3, Q-2, R-4, S-1

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a disk access counting question for file insertion, recognizable by the specific allocation methods and insertion positions.

    Step 1: For contiguous allocation, inserting at position in an -block file requires shifting blocks to to the right. This takes reads and writes, plus 1 write for the new block. Total = .

    Step 2: For linked allocation, inserting at position requires traversing the chain to the -th block ( reads), reading the -th block to get its pointer (1 read), writing the new block (1 write), and updating the -th block's pointer (1 write). Total = .

    Step 3: Calculate for each case ():

    • P (Contiguous, ): . Matches 3.
    • Q (Linked, ): . Matches 2.
    • R (Contiguous, ): . Matches 1.
    • S (Linked, ): . Matches 4.

    Answer: P-3, Q-2, R-1, S-4.