Course outline
Module 1
Module 1: What an Operating System Does
What an Operating System Does
Knowledge check
Q1. Which of the following best describes the main role of an operating system?
- A. To compile high-level programming languages into machine code
- B. To manage hardware resources and provide a common environment for application programs
- C. To design the physical layout of computer chips
- D. To connect computers to the internet without a network card
Q2. What is the kernel of an operating system?
- A. The graphical user interface that users interact with
- B. A collection of installed application programs
- C. The core component that directly controls hardware and manages system resources
- D. The keyboard driver used during system startup
Q3. Why does an operating system provide abstraction over hardware?
- A. So that programs can be written without needing to know the specific details of each hardware device
- B. So that the hardware runs at a slower and safer speed
- C. So that users are prevented from installing any new software
- D. So that the CPU can be replaced without changing the motherboard
Q4. What is the purpose of system calls in an operating system?
- A. To allow user programs to request services from the operating system kernel in a controlled way
- B. To permanently store files on the hard disk
- C. To display error messages on the monitor
- D. To turn the computer on and off automatically
Q5. Which function is an operating system responsible for when multiple programs run at the same time?
- A. Printing each program's output on separate pages
- B. Sharing the CPU and memory among the programs so they do not interfere with each other
- C. Installing a separate processor for each program
- D. Deleting programs that have been running too long without user input
Module 2
Module 2: Processes and Threads
Processes and Threads
Knowledge check
Q1. What is a process in an operating system?
- A. A program stored on disk that has not been executed yet
- B. An running instance of a program with its own memory space and resources ✓
- C. A hardware device that manages input and output
- D. A single instruction executed by the CPU
Why: A process is a program in execution. It has its own address space, registers, and resources, which distinguishes it from a program sitting on disk as a static file.
Q2. Which of the following best describes a thread?
- A. An independent process with its own separate memory
- B. A lightweight unit of execution within a process that shares the process's memory ✓
- C. A type of file stored in the operating system kernel
- D. A hardware interrupt signal sent to the CPU
Why: Threads are lightweight execution units inside a process. Threads within the same process share its code, data, and heap, but each has its own stack and program counter.
Q3. What does a process control block (PCB) store?
- A. Only the process's source code
- B. Information the OS needs to manage a process, such as its state, registers, and memory information ✓
- C. The user's login password
- D. A copy of the entire hard drive
Why: The PCB is a data structure the kernel uses to track each process, holding its state, program counter, CPU registers, scheduling information, and memory management details.
Q4. What are the typical states a process can be in?
- A. Open, closed, and locked
- B. New, ready, running, waiting, and terminated ✓
- C. Read, write, and execute
- D. Active, inactive, and deleted
Why: The classic process lifecycle includes new (being created), ready (waiting for CPU), running (executing), waiting (blocked on an event such as I/O), and terminated (finished).
Q5. What is the main difference between a process and a thread in terms of memory?
- A. Processes share memory while threads do not
- B. Threads share memory within their process, while separate processes have isolated memory ✓
- C. Neither processes nor threads use memory
- D. Threads always use more memory than processes
Why: Each process has its own isolated address space, whereas threads within the same process share that address space. This sharing makes thread communication faster but requires synchronization to avoid conflicts.
Module 3
Module 3: CPU Scheduling
CPU Scheduling
Knowledge check
Q1. What is the primary goal of CPU scheduling in an operating system?
- A. To allocate memory to running processes
- B. To decide which ready process gets the CPU next so the CPU is used efficiently ✓
- C. To manage files on the disk
- D. To control network communication between devices
Why: CPU scheduling determines which process in the ready queue is given the CPU next, aiming to keep the CPU busy and improve system performance and responsiveness.
Q2. Which scheduling algorithm executes processes in the order they arrive in the ready queue?
- A. Shortest Job First (SJF)
- B. Round Robin
- C. First-Come, First-Served (FCFS) ✓
- D. Priority Scheduling
Why: First-Come, First-Served (FCFS) is a non-preemptive algorithm that runs processes in arrival order, like a queue at a checkout counter.
Q3. What does the term 'time quantum' refer to in Round Robin scheduling?
- A. The total time a process needs to complete
- B. The fixed amount of CPU time each process receives before being preempted ✓
- C. The time spent waiting for input/output
- D. The time required for a context switch
Why: In Round Robin, each process gets the CPU for a fixed time slice called the time quantum. If it doesn't finish, it goes to the back of the ready queue.
Q4. What is a context switch?
- A. Moving a process from disk to memory
- B. Saving the state of one process and loading the state of another so the CPU can switch between them ✓
- C. Changing the priority of a process permanently
- D. Transferring data between two hard drives
Why: A context switch saves the current process's registers and state, then restores the saved state of the next process, allowing multitasking. It carries overhead, so it should be minimized.
Q5. Which problem can occur in priority scheduling when low-priority processes are constantly overtaken by higher-priority ones?
- A. Deadlock
- B. Starvation ✓
- C. Thrashing
- D. Fragmentation
Why: Starvation occurs when a low-priority process waits indefinitely because higher-priority processes keep arriving. Aging, which gradually raises a waiting process's priority, is a common solution.
Module 4
Module 4: Memory Management
Memory Management
Knowledge check
Q1. What is the main purpose of memory management in an operating system?
- A. To increase the clock speed of the CPU
- B. To allocate and track how memory is used by processes ✓
- C. To manage network connections between computers
- D. To control which users can log into the system
Why: Memory management allocates memory to processes, keeps track of which parts are in use, and frees memory when it is no longer needed, so that multiple programs can run safely and efficiently.
Q2. What is a virtual address?
- A. A physical location on the hard disk
- B. An address generated by a program that is translated to a physical address by the system ✓
- C. The IP address assigned to a computer on a network
- D. A memory address that cannot be accessed by any process
Why: Programs use virtual addresses, which the operating system and hardware translate into real physical RAM locations. This lets each process believe it has its own private address space.
Q3. What is paging in memory management?
- A. Printing documents stored in memory
- B. Dividing memory into fixed-size blocks called pages to simplify allocation ✓
- C. Storing user passwords in memory
- D. Sending memory contents over a network
Why: Paging divides both virtual memory and physical memory into fixed-size blocks, called pages and frames. This removes the need for contiguous allocation and reduces fragmentation.
Q4. What is a page fault?
- A. An error in a printed page of a document
- B. A hardware failure that destroys RAM
- C. An event that occurs when a program accesses a page not currently loaded in physical memory ✓
- D. A bug in the operating system kernel that crashes the computer
Why: A page fault happens when the requested page is not in RAM. The OS then loads the page from disk into memory and resumes the program, which is a normal part of virtual memory operation.
Q5. What does fragmentation mean in memory management?
- A. Splitting a file into smaller parts for backup
- B. Wasted memory that becomes unusable because free space is broken into scattered pieces ✓
- C. Dividing a program into multiple threads
- D. Encrypting memory to protect it from attackers
Why: Fragmentation wastes memory because free space is split into small scattered gaps that may be too small to satisfy new requests, even when enough total free memory exists.
Module 5
Module 5: File Systems and Storage
File Systems and Storage
Knowledge check
Q1. What is the primary purpose of a file system in an operating system?
- A. To execute programs faster by increasing CPU clock speed
- B. To organize and manage how data is stored, named, and retrieved on storage devices ✓
- C. To manage network connections between computers
- D. To allocate memory to running processes
Why: A file system provides a structured way to store, name, locate, and retrieve data on storage devices. Memory allocation is handled by the memory manager, and network connections by networking subsystems.
Q2. Which term describes a named collection of related data stored on a disk that users and programs can access?
- A. Register
- B. Cache
- C. File
- D. Kernel
Q3. What is a directory in a file system?
- A. A special type of file that stores executable code only
- B. A container that holds references to files and other directories, organizing them hierarchically
- C. A temporary storage area that is erased on reboot
- D. A hardware device that reads data from disks
Q4. Why do operating systems use block-based storage rather than reading and writing individual bytes on disk?
- A. Blocks make files impossible to fragment
- B. Storage devices read and write data efficiently in fixed-size chunks, and blocks simplify allocation and management
- C. Blocks encrypt data automatically
- D. Individual bytes cannot be stored on any physical medium
Q5. What does the term 'file permissions' refer to?
- A. The amount of disk space a file is allowed to occupy
- B. The speed at which a file can be read from disk
- C. Rules that define which users or processes can read, write, or execute a file
- D. The maximum size a file may grow to
Module 6
Module 6: Input, Output, and Device Drivers
Input, Output, and Device Drivers
Knowledge check
Q1. What is the main role of a device driver in an operating system?
- A. To replace the CPU scheduler with a faster algorithm
- B. To translate generic OS requests into device-specific commands ✓
- C. To store user files on the hard disk
- D. To encrypt all data sent over the network
Why: A device driver acts as an intermediary between the operating system and a hardware device. It converts the OS's generic input/output requests into the specific commands and signals that the particular device understands.
Q2. Which term describes a hardware signal sent by a device to the CPU to request attention?
- A. Context switch
- B. Page fault
- C. Interrupt ✓
- D. Deadlock
Why: An interrupt is a signal from a device (such as a keyboard or disk controller) that tells the CPU an event needs attention. The CPU pauses its current work, handles the interrupt, and then resumes.
Q3. What is the difference between a character device and a block device?
- A. Character devices are always faster than block devices
- B. Character devices transfer data one byte or character at a time, while block devices transfer data in fixed-size blocks ✓
- C. Block devices cannot be read from, only written to
- D. Character devices are only used for storage
Why: Character devices, such as keyboards and serial ports, handle data as a stream of individual characters. Block devices, such as hard drives and SSDs, read and write data in fixed-size blocks, which allows random access.
Q4. Why does the operating system use buffering during input and output operations?
- A. To permanently store user passwords
- B. To encrypt data before it reaches the device
- C. To temporarily hold data so that speed differences between devices and the CPU do not cause delays or data loss ✓
- D. To prevent any device from being connected at the same time
Why: Devices and the CPU operate at very different speeds. A buffer is a temporary memory area that holds data while it is being transferred, allowing the faster component to continue working without waiting for the slower one.
Q5. What is polling in the context of input/output handling?
- A. A method where the CPU repeatedly checks a device's status to see if it needs service ✓
- B. A method where the device sends a survey to the user
- C. A method for deleting unused device drivers
- D. A method for dividing memory into equal pages
Why: In polling, the CPU continuously checks a device's status register to determine whether it is ready. This is simple but wastes CPU time, which is why interrupts are often preferred for efficiency.
Module 7
Module 7: Security and User Isolation
Security and User Isolation
Knowledge check
Q1. What is the main purpose of user accounts in an operating system?
- A. To make the computer run faster
- B. To separate each user's files, settings, and permissions from others ✓
- C. To reduce the amount of storage the system needs
- D. To allow the hardware to be replaced without reinstalling software
Why: User accounts provide isolation so that each user's data and settings are kept separate and access is controlled by permissions.
Q2. What does the principle of least privilege mean?
- A. Users should have the fewest possible files on their computer
- B. Every process and user should have only the permissions needed to perform its task ✓
- C. Only the administrator should be allowed to log in
- D. Programs should run with the highest available system access
Why: Least privilege limits each user or program to the minimum access required, reducing damage if something goes wrong or is compromised.
Q3. Why do operating systems typically separate user mode from kernel mode?
- A. To make programs load more quickly from disk
- B. To prevent ordinary applications from directly modifying critical system code and hardware ✓
- C. To allow multiple monitors to be used at once
- D. To compress memory automatically
Why: Kernel mode has full hardware access, so restricting user programs to user mode protects the system from crashes and malicious changes.
Q4. What is the purpose of file permissions such as read, write, and execute?
- A. To control which users or groups can perform specific actions on a file ✓
- B. To automatically back up files to another drive
- C. To compress files so they take up less space
- D. To encrypt files so they cannot be copied over a network
Why: File permissions define which users or groups may read, modify, or run a file, enforcing access control on stored data.
Q5. Which of the following best describes process isolation?
- A. All programs share the same memory space for faster communication
- B. Each process is given its own protected memory space that other processes cannot freely access ✓
- C. Processes are stored on a separate physical computer
- D. Only one process can run on the system at a time
Why: Process isolation gives each running program its own protected address space, so one faulty or malicious program cannot read or corrupt another's memory.