Operating Systems Exam Questions
33 Questions
1 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the waiting time of each of these processes? (Use FCFS)

  • P1: 0, P2: 4, P3: 9, P4: 16 (correct)
  • P1: 0, P2: 2, P3: 7, P4: 14 (correct)
  • P1: 0, P2: 3, P3: 8, P4: 15 (correct)
  • P1: 0, P2: 4, P3: 7, P4: 12 (correct)
  • What is the average waiting time for these processes? (Use FCFS)

    5.75

    What is the turnaround time of each of these processes? (Use FCFS)

  • P1: 4, P2: 7, P3: 11, P4: 18
  • P1: 5, P2: 8, P3: 13, P4: 20
  • P1: 4, P2: 7, P3: 12, P4: 19 (correct)
  • P1: 4, P2: 8, P3: 12, P4: 19
  • What is the average turnaround time for these processes? (Use FCFS)

    <p>10.5</p> Signup and view all the answers

    What is the waiting time of each of these processes? (Use Round Robin with time quantum = 4)

    <p>P1: 0, P2: 10, P3: 14, P4: 18</p> Signup and view all the answers

    What is the average waiting time for these processes? (Use Round Robin with time quantum = 4)

    <p>10.5</p> Signup and view all the answers

    What is the turnaround time of each of these processes? (Use Round Robin with time quantum = 4)

    <p>P1: 14, P2: 18, P3: 22, P4: 26</p> Signup and view all the answers

    What is the average turnaround time for these processes? (Use Round Robin with time quantum = 4)

    <p>20</p> Signup and view all the answers

    What is the bootstrap program?

    <p>The bootstrap program is a small program that is loaded into memory when the computer is turned on. It initializes the system hardware, loads the operating system, and transfers control to the operating system.</p> Signup and view all the answers

    The memory layout of a process consists of 4 sections, what are these sections and what are the contents of each section?

    <p>The four sections of a process memory layout are code, data, heap, and stack. The code section contains the executable instructions of the program. The data section contains global variables and static variables. The heap section contains dynamically allocated memory. The stack section contains local variables and function call parameters.</p> Signup and view all the answers

    What are advantages of Multiprocessor Systems?

    <p>Multiprocessor systems offer advantages like: * Increased performance: By dividing tasks among multiple processors, overall execution time for complex tasks reduces significantly. * Enhanced reliability: If one processor fails, the system can continue running on the remaining processors. * Improved scalability: Systems can be easily scaled up by adding more processors as needed.</p> Signup and view all the answers

    What is External Fragmentation? What are the solutions to it?

    <p>External fragmentation occurs when available memory space is divided into multiple small, non-contiguous chunks, even though the total available memory is sufficient for a larger process. This hinders allocation of large processes despite the availability of enough free space in total. Solutions include: * Compaction: Shifts programs in memory to consolidate free spaces and reduce fragmentation. * Segmentation: Divides programs into logical segments, which are allocated individually, allowing flexibility in memory usage.</p> Signup and view all the answers

    Draw the diagram of process states.

    <p>The process states diagram typically includes states like: * New: Process is being created. * Ready: Process is waiting to be assigned to the CPU. * Running: Process is currently executing. * Waiting: Process is waiting for an event (e.g., I/O completion). * Terminated: Process has finished execution.</p> Signup and view all the answers

    What are the four conditions of deadlock?

    <p>The four conditions of deadlock are: * Mutual exclusion: Only one process can access a resource at a time. * Hold and wait: A process holds a resource while waiting for another. * No preemption: A resource cannot be forcibly taken from a process. * Circular wait: A circular chain of processes exists where each process is waiting for a resource held by the next process in the chain.</p> Signup and view all the answers

    What is the difference between Ordinary pipes and Named pipes?

    <p>Ordinary pipes are used for communication between related processes, typically a parent and child process. Named pipes are more flexible as they allow communication between unrelated processes and also permit communication between processes on different machines.</p> Signup and view all the answers

    What are advantages and disadvantages of the First Come First Served (FCFS) scheduling algorithm?

    <p>Advantages: * Simplicity: It is a relatively easy algorithm to implement. * Fairness: It gives each process a chance to run based on its arrival time. Disadvantages: * Inefficiency: It can lead to long waiting times for short processes if a long process arrives before them. * Not optimal for CPU utilization: It doesn't prioritize processes based on their CPU burst time. * Can cause starvation: Processes that are continually interrupted by long arrivals may never get a chance to complete.</p> Signup and view all the answers

    What are the advantages of multithreading?

    <p>Multithreading provides many benefits, including: * Improved performance: By concurrent execution of different parts of a task, overall execution time can be significantly reduced. * Enhanced responsiveness: While one thread is blocked (e.g., waiting for I/O), other threads can still execute, keeping the application responsive. * Efficient resource utilization: Threads share resources like memory and open files, leading to less overhead than creating multiple processes. * Better utilization of multicore systems: Threads can be mapped to different processor cores, further enhancing parallel execution speed.</p> Signup and view all the answers

    What is the direct access memory (DMA)?

    <p>Direct memory access (DMA) is a technique that allows peripheral devices to transfer data directly to or from main memory without involving the CPU. This frees the CPU from handling data transfers, allowing it to focus on other tasks. This technique is used for high-speed data transfers, such as reading or writing large files.</p> Signup and view all the answers

    Use the first-fit algorithm to place these processes in memory.

    <p>250 KB: 200 KB partition, 450 KB: 500 KB partition, 150 KB: 100 KB partition, 550 KB: 600 KB partition</p> Signup and view all the answers

    Which algorithm makes the most efficient use of memory?

    <p>Best-Fit</p> Signup and view all the answers

    Consider a computer system with a 32-bit logical address and 4 KB page size. The system supports up to 512 MB of physical memory. How many entries are there in the page table?

    <p>4096</p> Signup and view all the answers

    In a multi-programmed system, the process (currently executing by CPU) may have to wait for an I/O operation to complete. In this case, the CPU will do which of the following?

    <p>The operating system switches to, and executes, another process.</p> Signup and view all the answers

    Which of the following operating system structures is removing all non-essential components from the kernel and implementing them as user-level programs that reside in separate address spaces?

    <p>Microkernels System</p> Signup and view all the answers

    Which of the following instructions is not privileged?

    <p>Read the clock</p> Signup and view all the answers

    Deciding which processes (or parts of processes) and data to move into and out of memory is an activity of:

    <p>Memory Management</p> Signup and view all the answers

    Which of the following is a type of computing that delivers storage, computing, and applications as a service across a network?

    <p>Cloud Computing</p> Signup and view all the answers

    CLI stands for:

    <p>Command Line Interpreter</p> Signup and view all the answers

    Virtualization allows operating systems to run as applications within other operating systems.

    <p>True</p> Signup and view all the answers

    If a process in the “running” state and an interrupt occurs, then the process will be in the “Waiting” state.

    <p>True</p> Signup and view all the answers

    Caching is copying information from storage system A to storage system B where B is slower than A.

    <p>False</p> Signup and view all the answers

    Hard-disk drives are volatile storage devices and faster than the nonvolatile memory devices.

    <p>False</p> Signup and view all the answers

    Each device controller type has an operating system device driver to manage it.

    <p>True</p> Signup and view all the answers

    With DMA, device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention.

    <p>True</p> Signup and view all the answers

    Study Notes

    Operating Systems - Exam Questions

    • Question 1a: Processes (P1, P2, P3, P4) arrive at time 0 with burst times (milliseconds): P1-4, P2-3, P3-5, P4-7. Use FCFS scheduling algorithm to solve for waiting times, average waiting time, turnaround times, and average turnaround time.

    • Question 1b: Processes (P1, P2, P3, P4) arrive at time 0 with burst times (milliseconds): P1-7, P2-6, P3-5, P4-8. Use SJF scheduling algorithm to solve for waiting times, average waiting time, turnaround times, and average turnaround time.

    • Question 1c: Processes (P1, P2, P3, P4) arrive at time 0 with burst times (milliseconds): P1-10, P2-6, P3-4, P4-8. Use Round Robin scheduling algorithm (time quantum = 4) to solve for waiting times, average waiting time, turnaround times, and average turnaround time.

    Question 2 (32 Marks)

    • a. Bootstrap program: A program that initializes a computer by loading the operating system into memory.

    • b. Memory layout of a process: Consists of 4 sections - Text, Data, Stack, Heap.

    • Text section - Instructions of the program.

    • Data section - Static variables and initialized global data.

    • Stack section - Dynamic variables, function calls, and return addresses.

    • Heap section - Dynamic data allocated during runtime.

    • c. Advantages of Multiprocessor Systems: Increased throughput, reliability, cost-effectiveness, responsiveness, and resource sharing.

    • d. External Fragmentation: The memory is fragmented into small, unusable pieces; solutions include compaction (moving allocated memory together) and segmentation (memory split into fixed-size chunks).

    • e. Process States Diagram: A diagram visually representing the various stages a process undergoes (e.g., new, ready, running, waiting, terminated).

    • f. Deadlock conditions: Mutual exclusion, hold and wait, no preemption, circular wait.

    • g. Ordinary pipes vs. Named pipes: Ordinary pipes are temporary and unidirectional, named pipes have a persistent name and can be bidirectional.

    • h. First Come First Served (FCFS) scheduling algorithm: Advantages - Simple to understand and implement, Disadvantages - Can lead to long wait times for shorter processes, average waiting time can be high especially during periods with long and short processes.

    • i. Multithreading advantages: Increased responsiveness, resource sharing, efficient context switching, simplified programming in concurrent cases.

    • j. Direct Memory Access (DMA): A hardware mechanism that allows a device to directly access main memory without involving the CPU.

    Question 3 (16 Marks)

    • a. Memory partitioning (five partitions): Given the various sizes of partitions and the size of processes, determine the best fit, first fit and worst fit approaches.

    • b. Page table entries: Calculate the page table entries given the 32-bit logical address, page size (4KB), and supported physical memory (512 MB).

    Question 4 (12 Marks)

    • a. Choose the correct answer for the provided multiple choice questions.
      • I/O Operations in Multiprogramming, Operating System structures and instruction types, and the functionality & processes of memory management.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    This quiz covers various scheduling algorithms in Operating Systems, including FCFS, SJF, and Round Robin. It challenges students to calculate waiting times and turnaround times based on given burst times for multiple processes. Perfect for students preparing for exams in this field.

    More Like This

    Scheduling Algorithms Overview
    44 questions
    CPU Planavimo Algoritmai
    5 questions

    CPU Planavimo Algoritmai

    SweepingJasper324 avatar
    SweepingJasper324
    Use Quizgecko on...
    Browser
    Browser