Operating Systems Exam Questions

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 (C)</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 (A)</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 (C)</p> Signup and view all the answers

Which algorithm makes the most efficient use of memory?

<p>Best-Fit (D)</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. (A)</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 (B)</p> Signup and view all the answers

Which of the following instructions is not privileged?

<p>Read the clock (D)</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 (B)</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 (A)</p> Signup and view all the answers

CLI stands for:

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

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

<p>True (A)</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 (A)</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 (B)</p> Signup and view all the answers

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

<p>False (B)</p> Signup and view all the answers

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

<p>True (A)</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 (A)</p> Signup and view all the answers

Flashcards

Bootstrap Program

A program that loads the operating system into memory during system startup.

External Fragmentation

A memory management technique that allocates memory to processes in contiguous blocks, leaving gaps between them.

Multiprocessor Systems

A system that uses multiple processors (CPUs) to execute processes concurrently.

Paging

A memory management technique where a process is divided into fixed-size units called pages and loaded into non-contiguous memory locations.

Signup and view all the flashcards

Interprocess Communication (IPC)

A set of related system calls that allow processes to communicate with each other.

Signup and view all the flashcards

Ordinary Pipe

A type of communication channel that allows processes to communicate with each other in a unidirectional way (one-way).

Signup and view all the flashcards

Named Pipe

A type of communication channel that allows processes to communicate with each other using a named file, giving access to data from multiple processes.

Signup and view all the flashcards

Direct Memory Access (DMA)

A type of memory access where a device controller directly transfers data to or from memory without involving the CPU.

Signup and view all the flashcards

First Come First Served (FCFS)

A scheduling algorithm where processes are executed in the order they arrive, without considering their burst times.

Signup and view all the flashcards

Shortest Job First (SJF)

A scheduling algorithm where the process with the shortest burst time is executed first.

Signup and view all the flashcards

Round Robin Scheduling

A scheduling algorithm that divides time into small intervals called time quanta and allows each process to run for that time quantum before switching to the next process.

Signup and view all the flashcards

Turnaround Time

The total time a process spends in the system, from arrival to completion.

Signup and view all the flashcards

Waiting Time

The time a process spends waiting in the ready queue before being executed.

Signup and view all the flashcards

First-Fit Algorithm

A memory management algorithm that places a process in the first available memory partition that is large enough to accommodate it.

Signup and view all the flashcards

Best-Fit Algorithm

A memory management algorithm that places a process in the smallest available memory partition that is large enough to accommodate it.

Signup and view all the flashcards

Worst-Fit Algorithm

A memory management algorithm that places a process in the largest available memory partition.

Signup and view all the flashcards

Virtual Memory

A system that allows a process to have a logical address space larger than the physical address space.

Signup and view all the flashcards

Page Table

A table used by the operating system to map virtual addresses to physical addresses.

Signup and view all the flashcards

Caching

A technique that uses a smaller, faster memory (cache) to store frequently accessed data for faster retrieval.',

Signup and view all the flashcards

Volatile Memory

A type of memory storage that loses its data when power is removed.

Signup and view all the flashcards

Non-Volatile Memory

A type of memory storage that retains its data even when power is removed.

Signup and view all the flashcards

Device Driver

A software component that allows the operating system to communicate with a specific hardware device.

Signup and view all the flashcards

Layered System

A layered operating system structure where different functionalities are implemented as layers, with each layer building on top of the previous one.

Signup and view all the flashcards

Monolithic System

An operating system structure where all functionalities are implemented as part of a monolithic kernel, tightly integrated.

Signup and view all the flashcards

Hybrid System

An operating system structure that combines elements from layered and monolithic systems, offering benefits of both.

Signup and view all the flashcards

Microkernel System

An operating system structure that implements only the essential core functionalities in the kernel, while other services are implemented as separate user-level programs.

Signup and view all the flashcards

Multitasking

The ability of an operating system to run multiple tasks concurrently.',

Signup and view all the flashcards

Running Process

A process that is currently being executed by the CPU.

Signup and view all the flashcards

Ready Process

A process that is ready to be executed but waiting for its turn.

Signup and view all the flashcards

Waiting Process

A process that is waiting for a specific event to occur (like input-output (I/O) operation) before getting executed.

Signup and view all the flashcards

Terminated Process

A process that has finished its execution.

Signup and view all the flashcards

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

More Like This

Use Quizgecko on...
Browser
Browser